Skip to content

Commit 91db852

Browse files
Fix regression tests to not create temp files outside the lit temp directory. (#624)
* Follow new guideline: Avoid `cd DIR && FOO` in RUN lines. Instead, put `FOO` on a separate run line. `cd` affects later RUN lines, and `cd DIR && FOO` could mislead the reader that it doesn't and that's why we needed to put both parts on one line. I added the proposed guideline to #346. I'm changing the existing tests before changing more tests to use `cd` as part of this PR. * Add `-o /dev/null` to clang commands that use `-` as input. * Add -working-directory to clang commands with named input files. * `cd` to a temporary directory for `3c -dump-stats` commands.
1 parent 157e2cd commit 91db852

34 files changed

+45
-38
lines changed

clang/test/3C/addrof_crash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck %s
2-
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
2+
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
33

44
// No conversions expected for these two, they just shouldn't crash
55

clang/test/3C/allocator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
7-
// RUN: 3c -base-dir=%S %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// RUN: 3c -base-dir=%S -output-dir=%t.checked %s --
99
// RUN: 3c -base-dir=%t.checked %t.checked/allocator.c -- | diff %t.checked/allocator.c -
1010
// expected-no-diagnostics

clang/test/3C/base_subdir/canwrite_constraints.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
// not allow canwrite_constraints.h to change, and the internal types of q and
1111
// the return should remain wild.
1212
//
13-
// RUN: cd %S && 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify
13+
// RUN: cd %S
14+
// RUN: 3c -alltypes -addcr -output-dir=%t.checked/base_subdir -warn-all-root-cause %s -- -Xclang -verify
1415
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_LOWER --input-file %t.checked/base_subdir/canwrite_constraints.c %s
1516
// RUN: test ! -f %t.checked/canwrite_constraints.checked.h
1617

1718
// "Higher" case: When -base-dir is set to the parent directory, we can change
1819
// canwrite_constraints.h, so both q and the return should become checked.
1920
//
20-
// RUN: cd %S && 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s --
21+
// RUN: 3c -alltypes -addcr -base-dir=.. -output-dir=%t.checked2 %s --
2122
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/base_subdir/canwrite_constraints.c %s
2223
// RUN: FileCheck -match-full-lines -check-prefixes=CHECK_HIGHER --input-file %t.checked2/canwrite_constraints.h %S/../canwrite_constraints.h
2324

clang/test/3C/base_subdir/canwrite_constraints_symlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
// Now 3C should know that it can't write to base_subdir_partial_defn.h because
2121
// the symlink goes out of the base dir.
2222
//
23-
// RUN: cd %t.base && 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify
23+
// RUN: cd %t.base
24+
// RUN: 3c -addcr canwrite_constraints_symlink.c -- -Xclang -verify
2425

2526
// expected-error@base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
2627
// expected-note@*:* {{-dump-unwritable-changes}}

clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// an error diagnostic.
44
// (https://github.com/correctcomputation/checkedc-clang/issues/387)
55

6-
// RUN: cd %S && 3c -addcr %s -- -Xclang -verify
6+
// RUN: cd %S
7+
// RUN: 3c -addcr %s -- -Xclang -verify
78

89
// expected-error@../base_subdir_partial_defn.h:1 {{3C internal error: 3C generated changes to this file even though it is not allowed to write to the file}}
910
// expected-note@*:* {{-dump-unwritable-changes}}

clang/test/3C/basic_checks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
77
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
8-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
8+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
99
// expected-no-diagnostics
1010
//
1111

clang/test/3C/basic_inter_field.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Tests properties about constraint propagation of structure fields
44
// across functions
55
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
6-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
77
// expected-no-diagnostics
88
//
99

clang/test/3C/basic_inter_field_arr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Tests properties about arr constraints propagation.
44
//
55
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
6-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
77
// expected-no-diagnostics
88
//
99
// This tests the propagation of constraints

clang/test/3C/basic_local_field.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Tests properties about type re-writing and replacement of structure members
44
//
55
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
6-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
77
// expected-no-diagnostics
88
//
99

clang/test/3C/boundary_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// RUN: rm -rf %t*
44
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
5-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
5+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
66
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
77
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/boundary_tests.c -- | diff %t.checked/boundary_tests.c -
88
// expected-no-diagnostics

clang/test/3C/bounds_interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// RUN: rm -rf %t*
44
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
5-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
5+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
66
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
77
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/bounds_interface.c -- | diff %t.checked/bounds_interface.c -
88
// expected-no-diagnostics

clang/test/3C/cant_be_nt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//
33
// Checks to make sure _Nt_arrrays only contain pointers & integers
44
//
5-
// RUN: 3c -alltypes -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -
6-
// RUN: 3c -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -
5+
// RUN: 3c -alltypes -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
77
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
88
// RUN: 3c -alltypes -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
99
// expected-no-diagnostics

clang/test/3C/const_tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
7-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
99
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/const_tests.c -- | diff %t.checked/const_tests.c -
1010
// expected-no-diagnostics

clang/test/3C/extGVarbar1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked %s %S/extGVarbar2.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked/extGVarbar1.c %s
4-
//RUN: %clang -c %t.checked/extGVarbar1.c %t.checked/extGVarbar2.c
4+
//RUN: %clang -working-directory=%t.checked -c extGVarbar1.c extGVarbar2.c
55

66
// This test cannot use pipes because it requires multiple output files
77

clang/test/3C/extGVarbar2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked2 %s %S/extGVarbar1.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked2/extGVarbar2.c %s
4-
//RUN: %clang -c %t.checked2/extGVarbar2.c %t.checked2/extGVarbar1.c
4+
//RUN: %clang -working-directory=%t.checked2 -c extGVarbar2.c extGVarbar1.c
55

66
// This test cannot use pipes because it requires multiple output files
77

clang/test/3C/extGVarm1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked %s %S/extGVarm2.c %S/extGVarm3.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked/extGVarm1.c %s
4-
//RUN: %clang -c %t.checked/extGVarm1.c %t.checked/extGVarm2.c %t.checked/extGVarm3.c
4+
//RUN: %clang -working-directory=%t.checked -c extGVarm1.c extGVarm2.c extGVarm3.c
55

66
// This test cannot use pipes because it requires multiple output files
77

clang/test/3C/extGVarm2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked2 %s %S/extGVarm1.c %S/extGVarm3.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked2/extGVarm2.c %s
4-
//RUN: %clang -c %t.checked2/extGVarm2.c %t.checked2/extGVarm3.c %t.checked2/extGVarm1.c
4+
//RUN: %clang -working-directory=%t.checked2 -c extGVarm2.c extGVarm3.c extGVarm1.c
55

66
// This test cannot use pipes because it requires multiple output files
77

clang/test/3C/extGVarm3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked3 %s %S/extGVarm1.c %S/extGVarm2.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked3/extGVarm3.c %s
4-
//RUN: %clang -c %t.checked3/extGVarm3.c %t.checked3/extGVarm2.c %t.checked3/extGVarm1.c
4+
//RUN: %clang -working-directory=%t.checked3 -c extGVarm3.c extGVarm2.c extGVarm1.c
55

66
// This test cannot use pipes because it requires multiple output files
77

clang/test/3C/global.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
7-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
99
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/global.c -- | diff %t.checked/global.c -
1010
// expected-no-diagnostics

clang/test/3C/json_formating.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// RUN: rm -rf %t*
2+
// RUN: mkdir %t.alltypes && cd %t.alltypes
13
// RUN: 3c -base-dir=%S -alltypes -dump-stats -dump-intermediate -debug-solver %s
24
// RUN: python -c "import json, glob; [json.load(open(f)) for f in glob.glob('*.json')]"
5+
// RUN: mkdir %t.noalltypes && cd %t.noalltypes
36
// RUN: 3c -base-dir=%S -dump-stats -dump-intermediate -debug-solver %s
47
// RUN: python -c "import json, glob; [json.load(open(f)) for f in glob.glob('*.json')]"
58

clang/test/3C/multipledecls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
7-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
99
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/multipledecls.c -- | diff %t.checked/multipledecls.c -
1010
// expected-no-diagnostics

clang/test/3C/placements.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK","CHECK_NOALL","CHECK-NEXT" %s
77
// RUN: 3c -base-dir=%S -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK","CHECK_ALL","CHECK-NEXT" %s
8-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
8+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
99
// RUN: 3c -base-dir=%S -addcr -alltypes -output-dir=%t.checked %s --
1010
// RUN: 3c -base-dir=%t.checked -addcr -alltypes %t.checked/placements.c -- | diff %t.checked/placements.c -
1111
// expected-no-diagnostics

clang/test/3C/prototype_success1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked %s %S/prototype_success2.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked/prototype_success1.c %s
4-
//RUN: %clang -c %t.checked/prototype_success1.c %t.checked/prototype_success2.c
4+
//RUN: %clang -working-directory=%t.checked -c prototype_success1.c prototype_success2.c
55

66
/*Note: this file is part of a multi-file regression test in tandem with
77
prototype_success2.c*/

clang/test/3C/prototype_success2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//RUN: rm -rf %t*
22
//RUN: 3c -base-dir=%S -output-dir=%t.checked2 %s %S/prototype_success1.c --
33
//RUN: FileCheck -match-full-lines --input-file %t.checked2/prototype_success2.c %s
4-
//RUN: %clang -c %t.checked2/prototype_success1.c %t.checked2/prototype_success2.c
4+
//RUN: %clang -working-directory=%t.checked2 -c prototype_success1.c prototype_success2.c
55

66
/*Note: this file is part of a multi-file regression test in tandem with
77
prototype_success1.c. For comments about the different functions in this file,

clang/test/3C/ptrtoconstarr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: rm -rf %t*
22
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
33
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
4-
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
5-
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
5+
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
66
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
77
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/ptrtoconstarr.c -- | diff %t.checked/ptrtoconstarr.c -
88

clang/test/3C/qualifiers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: rm -rf %t*
22
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checkedALL %s --
33
// RUN: 3c -base-dir=%S -output-dir=%t.checkedNOALL %s --
4-
// RUN: %clang -c %t.checkedNOALL/qualifiers.c
4+
// RUN: %clang -working-directory=%t.checkedNOALL -c qualifiers.c
55
// RUN: FileCheck -match-full-lines --input-file %t.checkedNOALL/qualifiers.c %s
66
// RUN: FileCheck -match-full-lines --input-file %t.checkedALL/qualifiers.c %s
77

clang/test/3C/simple_locals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: rm -rf %t*
66
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
7-
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// RUN: 3c -base-dir=%S -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
99
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
1010
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/simple_locals.c -- | diff %t.checked/simple_locals.c -

clang/test/3C/some_checked.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Tests for the 3C.
22
//
33
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
4-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
55
// expected-no-diagnostics
66
//
77

clang/test/3C/statstest.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: rm -rf %t*
2-
// RUN: 3c -dump-stats -base-dir=%S -alltypes -addcr %s -- 2>%t.stderr | FileCheck -match-full-lines %s
3-
// RUN: FileCheck -match-full-lines -check-prefixes="CHECK_STDERR" --input-file %t.stderr %s
2+
// RUN: mkdir %t && cd %t
3+
// RUN: 3c -dump-stats -base-dir=%S -alltypes -addcr %s -- 2>stderr | FileCheck -match-full-lines %s
4+
// RUN: FileCheck -match-full-lines -check-prefixes="CHECK_STDERR" --input-file %t/stderr %s
45

56

67
#include <stdlib.h>

clang/test/3C/struct_init_list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: rm -rf %t*
22
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines %s
33
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
4-
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
55
// RUN: 3c -base-dir=%S -output-dir=%t.checked -alltypes %s --
66
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/struct_init_list.c -- | diff %t.checked/struct_init_list.c -
77
// expected-no-diagnostics

clang/test/3C/typedefbounds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t*
22
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
3-
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
3+
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
44
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s
55
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/typedefbounds.c -- | diff %t.checked/typedefbounds.c -
66

clang/test/3C/typedefnoptr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK" %s
2-
//RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
2+
//RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
33

44
typedef unsigned int uint_t;
55
typedef uint_t *ptr_uint_t;

clang/test/3C/typedefs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: rm -rf %t*
22
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
33
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
4-
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
5-
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
5+
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
66
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s
77
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/typedefs.c -- | diff %t.checked/typedefs.c -
88

clang/test/3C/vargs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
66
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines %s
7-
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -o /dev/null -
88
// expected-no-diagnostics
99
#include <stdarg.h>
1010

0 commit comments

Comments
 (0)