source_date_epoch-1.c (main): Test __DATE__ and __TIME__ strings with __builtin_strcm...
authorJakub Jelinek <jakub@redhat.com>
Thu, 2 Jun 2016 16:17:15 +0000 (18:17 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 2 Jun 2016 16:17:15 +0000 (18:17 +0200)
* 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
gcc/testsuite/gcc.dg/cpp/source_date_epoch-1.c

index fcf6bbd2279d079df479516416e8d2c2097b7726..270bde1e3155d446b4f20da7b07342cc57d83d26 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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  <mliska@suse.cz>
 
        * gcc.dg/predict-9.c: New test.
index f6aa1a360ffc5067020576a482a98517e5b63e86..d0a1ee032f54e151a7c5c1643dcce6494d17762f 100644 (file)
@@ -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$" } */