Skip to content

Commit fc7b8e7

Browse files
committed
[test] Fix dr324.c again for non-writeable source directories
In general, the source tree is not assumed to be writeable, so modifying `%s` does not work for all CI systems. Instead of touching `%s`, copy it to a writeable dir using `%t`, and touch it there. Actually, `dr0xx.c` isn't really needed at all, so just create a new `dep.c` file in the build tree. This was recently added in cb088e8, fixed in 1481fcf, and fixed again in d16c590.
1 parent b7ada67 commit fc7b8e7

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

clang/test/C/drs/dr324.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
/* RUN: touch %s
2-
RUN: %clang_cc1 -std=c89 -fsyntax-only -fms-extensions -pedantic -verify %s
3-
RUN: %clang_cc1 -std=c99 -fsyntax-only -fms-extensions -pedantic -verify %s
4-
RUN: %clang_cc1 -std=c11 -fsyntax-only -fms-extensions -pedantic -verify %s
5-
RUN: %clang_cc1 -std=c17 -fsyntax-only -fms-extensions -pedantic -verify %s
6-
RUN: %clang_cc1 -std=c2x -fsyntax-only -fms-extensions -pedantic -verify %s
1+
/* RUN: rm -rf %t && mkdir %t
2+
RUN: cp %s %t/dr324.c
3+
4+
Note: this file (dr324.c) must be newer than the file used for the
5+
dependency pragma (dep.c), otherwise we get an unrelated "current file is
6+
older than dependency" warning. Touch dep.c first to make sure it's
7+
always older.
8+
RUN: touch %t/dep.c
9+
RUN: touch %t/dr324.c
10+
11+
RUN: %clang_cc1 -std=c89 -fsyntax-only -fms-extensions -pedantic -verify %t/dr324.c
12+
RUN: %clang_cc1 -std=c99 -fsyntax-only -fms-extensions -pedantic -verify %t/dr324.c
13+
RUN: %clang_cc1 -std=c11 -fsyntax-only -fms-extensions -pedantic -verify %t/dr324.c
14+
RUN: %clang_cc1 -std=c17 -fsyntax-only -fms-extensions -pedantic -verify %t/dr324.c
15+
RUN: %clang_cc1 -std=c2x -fsyntax-only -fms-extensions -pedantic -verify %t/dr324.c
716
*/
817

918
/* WG14 DR324: yes
@@ -25,7 +34,7 @@ char lit_char = '\y'; /* expected-warning {{unknown escape sequence '\y'}}
2534
/* This test only makes sense on Windows targets, where the backslash is a valid
2635
* path separator.
2736
*/
28-
#pragma GCC dependency "oops\..\dr0xx.c"
37+
#pragma GCC dependency "oops\..\dep.c"
2938
#endif
3039
#pragma message("this has a \t tab escape and an invalid \d escape") /* expected-warning {{this has a tab escape and an invalid d escape}}
3140
expected-warning {{unknown escape sequence '\d'}}

0 commit comments

Comments
 (0)