From: Jakub Jelinek Date: Thu, 2 Jun 2016 16:17:15 +0000 (+0200) Subject: source_date_epoch-1.c (main): Test __DATE__ and __TIME__ strings with __builtin_strcm... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e535442f42aeec23761686a55de8557e1e4277c;p=gcc.git 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 --- 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$" } */