https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67087

            Bug ID: 67087
           Summary: FAIL: gcc.dg/cpp/_Pragma3.c (test for excess errors) -
                    file timestamp issue
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: miyuki at gcc dot gnu.org
  Target Milestone: ---

I see the following in test log:

Executing on host: /home/jenkins/workspace/build-gcc-trunk/build/gcc/xgcc
-B/home/jenkins/workspace/build-gcc-trunk/build/gcc/
/home/jenkins/workspace/build-gcc-trunk/src/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
  -fno-diagnostics-show-caret -fdiagnostics-color=never    -ansi
-pedantic-errors -E   -o _Pragma3.i    (timeout = 300)
spawn /home/jenkins/workspace/build-gcc-trunk/build/gcc/xgcc
-B/home/jenkins/workspace/build-gcc-trunk/build/gcc/
/home/jenkins/workspace/build-gcc-trunk/src/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -E
-o _Pragma3.i
/home/jenkins/workspace/build-gcc-trunk/src/gcc/testsuite/gcc.dg/cpp/_Pragma3.c:11:16:
warning: current file is older than mi1c.h

$ ls --full-time _Pragma3.c mi1c.h
-rw-r--r-- 1 jenkins jenkins 214 2015-06-13 16:28:23.586067577 +0300 mi1c.h
-rw-r--r-- 1 jenkins jenkins 309 2015-06-13 16:28:22.794063649 +0300 _Pragma3.c

This may be a subversion-specific issue. I have several other GCC trees, but
they all use git and don't have this problem, because the timestamps almost
match:

$ ls --full-time _Pragma3.c mi1c.h
-rw-r--r-- 1 jenkins jenkins 214 2015-06-19 18:40:34.659650568 +0300 mi1c.h
-rw-r--r-- 1 jenkins jenkins 309 2015-06-19 18:40:34.655650549 +0300 _Pragma3.c

Nevertheless I suppose that this test should not depend on file timestamp. The
test is related to timestamp, but AFAIU, it is enough to check that we do not
ICE, and warnings are irrelevant. In that case

diff --git a/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
b/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
index 7d1b42a..7c744c4 100644
--- a/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
+++ b/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
@@ -1,6 +1,7 @@
 /* Copyright (C) 2002 Free Software Foundation, Inc.  */

 /* { dg-do preprocess } */
+/* { dg-options -w } */

 /* Pragma buffers have a NULL "inc" member, which we would dereference
    when getting a file's date and time.

is enough (the test passes).

If for some reason silencing all warnings is not appropriate here, the fix will
probably require some kind of file timestamp adjustment. Unfortunately my
knowledge of TCL and various exotic GCC hosts (like Solaris and AIX) is not
good enough to implement it.

Reply via email to