Skip to content

Commit 1fac188

Browse files
Migrate 3C regression tests from %clang_cc1 to %clang. (#596)
This requires replacing `%clang_cc1 -verify` with `%clang -Xclang -verify` in the tests that use it. This is one part of the RUN command cleanup that we've wanted to do for a while in #346, and now it is blocking part of #576. This is because the single behavior difference we know of between %clang_cc1 and %clang (other than the need for `-Xclang`) is that %clang_cc1 turns off the system headers, and we want two of our tests that currently use %clang_cc1 to be able to get checked declarations from the system headers. As recently as dac3f97 (August 2020), all of the tests that used %clang_cc1 used -verify. Since then, a few tests have been added that use %clang_cc1 and not -verify. This lends support to my theory that the only reason we used %clang_cc1 was that we were unaware that -verify could be used with %clang via -Xclang, and some subsequently added tests copied the use of %clang_cc1 only because the authors didn't know any better. Thus, I believe that the risk of the migration affecting the validity of the tests (e.g., causing them to falsely pass) is low.
1 parent 81cbd4c commit 1fac188

21 files changed

+24
-24
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_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
2+
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
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/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_cc1 -verify -fcheckedc-extension -x c -
8+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
6+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
5+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
5+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -fcheckedc-extension -x c -
6-
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -fcheckedc-extension -x c -
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 -
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_cc1 -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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/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_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
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/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_cc1 -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
8+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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/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_cc1 -fcheckedc-extension -x c -
5-
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang_cc1 -fcheckedc-extension -x c -
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 -
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/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_cc1 -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -verify -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
55
// expected-no-diagnostics
66
//
77

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_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
4+
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
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_cc1 -fcheckedc-extension -x c -
3+
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
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_cc1 -fcheckedc-extension -x c -
2+
//RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
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_cc1 -fcheckedc-extension -x c -
5-
// RUN: 3c -base-dir=%S --addcr %s -- | %clang_cc1 -fcheckedc-extension -x c -
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 -
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_cc1 -verify -fcheckedc-extension -x c -
7+
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
88
// expected-no-diagnostics
99
#include <stdarg.h>
1010

0 commit comments

Comments
 (0)