From 0e535442f42aeec23761686a55de8557e1e4277c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 2 Jun 2016 18:17:15 +0200 Subject: [PATCH] source_date_epoch-1.c (main): Test __DATE__ and __TIME__ strings with __builtin_strcmp instead of printf and... * gcc.dg/cpp/source_date_epoch-1.c (main): Test __DATE__ and __TIME__ strings with __builtin_strcmp instead of printf and dg-output. From-SVN: r237039 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fcf6bbd2279..270bde1e315 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-06-02 Jakub Jelinek + + * gcc.dg/cpp/source_date_epoch-1.c (main): Test __DATE__ and + __TIME__ strings with __builtin_strcmp instead of printf and + dg-output. + 2016-06-02 Martin Liska * gcc.dg/predict-9.c: New test. diff --git a/gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c b/gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c index f6aa1a360ff..d0a1ee032f5 100644 --- a/gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c +++ b/gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c @@ -2,10 +2,10 @@ /* { dg-set-compiler-env-var SOURCE_DATE_EPOCH "630333296" } */ int -main(void) +main () { - __builtin_printf ("%s %s\n", __DATE__, __TIME__); + if (__builtin_strcmp (__DATE__, "Dec 22 1989") != 0 + || __builtin_strcmp (__TIME__, "12:34:56") != 0) + __builtin_abort (); return 0; } - -/* { dg-output "^Dec 22 1989 12:34:56\n$" } */ -- 2.30.2