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 fcf6bbd..270bde1 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 f6aa1a3..d0a1ee0 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$" } */