Skip to content

Commit 6d785ca

Browse files
authored
[Clang] Fix the clang/test/PCH/ignored-pch.c test. (llvm#144737)
Change the test to check the exit status of the 'ls' command line (instead of error message) since the error message is different when running 'ls' command on the different Host machine.
1 parent 13510c0 commit 6d785ca

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

clang/test/PCH/ignored-pch.c

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
11
// RUN: rm -rf %t.pch %t.ll
22
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -o %t.pch
33
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -o %t.ll
4-
// RUN: ls %t.pch | FileCheck --check-prefix=CHECK-PCH %s
5-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
4+
// RUN: ls %t.pch
5+
// RUN: ls %t.ll
66

77
// RUN: rm -rf %t.pch %t.ll
88
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -o %t.pch
99
// RUN: %clang %s -emit-ast -include-pch %t.pch -o %t.ll
10-
// RUN: ls %t.pch | FileCheck --check-prefix=CHECK-PCH %s
11-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
10+
// RUN: ls %t.pch
11+
// RUN: ls %t.ll
1212

1313
// Check that -ignore-pch causes -emit-pch and -include-pch options to be ignored.
1414
// RUN: rm -rf %t.pch %t.ll
1515
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -o %t.pch
1616
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -o %t.ll
17-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH-ERROR %s
18-
// RUN: ls %t.ll 2>&1 | FileCheck --check-prefix=CHECK-OBJ %s
17+
// RUN: not ls %t.pch
18+
// RUN: ls %t.ll
1919

2020
// RUN: rm -rf %t.pch %t.ll
2121
// RUN: %clang -emit-ast %s -include-pch %t.pch -ignore-pch -o %t.ll
22-
// RUN: not ls %t.ll 2>&1 | FileCheck --check-prefix=CHECK-OBJ-ERROR %s
22+
// RUN: not ls %t.ll
2323

2424
// Check that -ignore-pch works for multiple PCH related options.
2525
// Test with -building-pch-with-obj.
2626
// RUN: rm -rf %t.pch %t.ll
2727
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -building-pch-with-obj -o %t.pch
2828
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -Xclang -building-pch-with-obj -o %t.ll
29-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH-ERROR %s
30-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
29+
// RUN: not ls %t.pch
30+
// RUN: ls %t.ll
3131

3232
// Test with -fallow-pch-with-compiler-errors.
3333
// RUN: rm -rf %t.pch %t.ll
3434
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -fallow-pch-with-compiler-errors -o %t.pch
3535
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -Xclang -fallow-pch-with-compiler-errors -o %t.ll
36-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH-ERROR %s
37-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
36+
// RUN: not ls %t.pch
37+
// RUN: ls %t.ll
3838

3939
// Test with -fallow-pch-with-different-modules-cache-path.
4040
// RUN: rm -rf %t.pch %t.ll
4141
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -fallow-pch-with-different-modules-cache-path -o %t.pch
4242
// RUN: %clang -S -emit-llvm %s -ignore-pch -include-pch %t.pch -Xclang -fallow-pch-with-different-modules-cache-path -o %t.ll
43-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH-ERROR %s
44-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
43+
// RUN: not ls %t.pch
44+
// RUN: ls %t.ll
4545

4646
// Test with -fpch-codegen.
4747
// RUN: rm -rf %t.pch %t.ll
4848
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -fpch-codegen -o %t.pch
4949
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -fpch-codegen -o %t.ll
50-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH-ERROR %s
51-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
50+
// RUN: not ls %t.pch
51+
// RUN: ls %t.ll
5252

5353
// Test with -fpch-debuginfo.
5454
// RUN: rm -rf %t.pch %t.ll
5555
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -fpch-debuginfo -o %t.pch
5656
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -fpch-debuginfo -o %t.ll
57-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
58-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
57+
// RUN: not ls %t.pch
58+
// RUN: ls %t.ll
5959

6060
// Test with -fpch-instantiate-templates.
6161
// RUN: rm -rf %t.pch %t.ll
6262
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -fpch-instantiate-templates -o %t.pch
6363
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -fpch-instantiate-templates -o %t.ll
64-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
65-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
64+
// RUN: not ls %t.pch
65+
// RUN: ls %t.ll
6666

6767
// Test with -fno-pch-timestamp.
6868
// RUN: rm -rf %t.pch %t.ll
6969
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -fno-pch-timestamp -o %t.pch
7070
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -Xclang -fno-pch-timestamp -o %t.ll
71-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
72-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
71+
// RUN: not ls %t.pch
72+
// RUN: ls %t.ll
7373

7474
// Test with -fno-validate-pch.
7575
// RUN: rm -rf %t.pch %t.ll
7676
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -fno-validate-pch -o %t.pch
7777
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -Xclang -fno-validate-pch -o %t.ll
78-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
79-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
78+
// RUN: not ls %t.pch
79+
// RUN: ls %t.ll
8080

8181
// Test with -relocatable-pch.
8282
// RUN: rm -rf %t.pch %t.ll
8383
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -relocatable-pch -o %t.pch
8484
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -relocatable-pch -o %t.ll
85-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
86-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
85+
// RUN: not ls %t.pch
86+
// RUN: ls %t.ll
8787

8888
// Test with -pch-through-hdrstop-create/-pch-through-hdrstop-use
8989
// RUN: rm -rf %t.pch %t.ll
9090
// RUN: %clang -x c-header %S/Inputs/ignored-pch.h -ignore-pch -Xclang -pch-through-hdrstop-create -o %t.pch
9191
// RUN: %clang -S -emit-llvm %s -include-pch %t.pch -ignore-pch -Xclang -pch-through-hdrstop-use -o %t.ll
92-
// RUN: not ls %t.pch 2>&1 | FileCheck --check-prefix=CHECK-PCH %s
93-
// RUN: ls %t.ll | FileCheck --check-prefix=CHECK-OBJ %s
92+
// RUN: not ls %t.pch
93+
// RUN: ls %t.ll
9494

9595

9696
// Test with AST dump output:
@@ -99,10 +99,6 @@
9999
// RUN: %clang %s -include-pch %t.pch -Xclang -ast-dump-all -c | FileCheck --check-prefix=CHECK-AST-PCH %s
100100
// RUN: %clang %s -include-pch %t.pch -ignore-pch -Xclang -ast-dump-all -c | FileCheck --check-prefix=CHECK-AST %s
101101

102-
// CHECK-PCH: ignored-pch.c.{{.*}}.pch
103-
// CHECK-OBJ: ignored-pch.c.{{.*}}.ll
104-
// CHECK-PCH-ERROR: ignored-pch.c.{{.*}}.pch{{'?}}: No such file or directory
105-
// CHECK-OBJ-ERROR: ignored-pch.c.{{.*}}.ll{{'?}}: No such file or directory
106102
// CHECK-AST-PCH: <undeserialized declarations>
107103
// CHECK-AST-NOT: <undeserialized declarations>
108104

0 commit comments

Comments
 (0)