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

0 commit comments

Comments
 (0)