Skip to content

Commit

Permalink
Migrate 3C regression tests from %clang_cc1 to %clang. (#596)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattmccutchen-cci authored May 21, 2021
1 parent 81cbd4c commit 1fac188
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion clang/test/3C/addrof_crash.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck %s
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -

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

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked %t.checked/allocator.c -- | diff %t.checked/allocator.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/basic_checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
//

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/basic_inter_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Tests properties about constraint propagation of structure fields
// across functions
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
//

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/basic_inter_field_arr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Tests properties about arr constraints propagation.
//
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
//
// This tests the propagation of constraints
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/basic_local_field.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Tests properties about type re-writing and replacement of structure members
//
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
//

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/boundary_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/boundary_tests.c -- | diff %t.checked/boundary_tests.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/bounds_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/bounds_interface.c -- | diff %t.checked/bounds_interface.c -
// expected-no-diagnostics
Expand Down
4 changes: 2 additions & 2 deletions clang/test/3C/cant_be_nt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// Checks to make sure _Nt_arrrays only contain pointers & integers
//
// RUN: 3c -alltypes -base-dir=%S %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -alltypes -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -alltypes -base-dir=%S %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/const_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/const_tests.c -- | diff %t.checked/const_tests.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/global.c -- | diff %t.checked/global.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/multipledecls.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr %t.checked/multipledecls.c -- | diff %t.checked/multipledecls.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/placements.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK","CHECK_NOALL","CHECK-NEXT" %s
// RUN: 3c -base-dir=%S -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK","CHECK_ALL","CHECK-NEXT" %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -alltypes -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -addcr -alltypes %t.checked/placements.c -- | diff %t.checked/placements.c -
// expected-no-diagnostics
Expand Down
4 changes: 2 additions & 2 deletions clang/test/3C/ptrtoconstarr.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -base-dir=%S --addcr %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/ptrtoconstarr.c -- | diff %t.checked/ptrtoconstarr.c -

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/simple_locals.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -base-dir=%S -addcr %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s --
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/simple_locals.c -- | diff %t.checked/simple_locals.c -
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/some_checked.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Tests for the 3C.
//
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
//

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/struct_init_list.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fcheckedc-extension -x c -o /dev/null -
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang_cc1 -fno-builtin -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -alltypes %s -- | %clang -c -fno-builtin -Xclang -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -output-dir=%t.checked -alltypes %s --
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/struct_init_list.c -- | diff %t.checked/struct_init_list.c -
// expected-no-diagnostics
Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/typedefbounds.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/typedefbounds.c -- | diff %t.checked/typedefbounds.c -

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/typedefnoptr.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK" %s
//RUN: 3c -base-dir=%S --addcr %s -- | %clang_cc1 -fcheckedc-extension -x c -
//RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -

typedef unsigned int uint_t;
typedef uint_t *ptr_uint_t;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/3C/typedefs.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: rm -rf %t*
// RUN: 3c -base-dir=%S -alltypes -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
// RUN: 3c -base-dir=%S -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr %s -- | %clang_cc1 -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr --alltypes %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S --addcr %s -- | %clang -c -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S -alltypes -output-dir=%t.checked %s
// RUN: 3c -base-dir=%t.checked -alltypes %t.checked/typedefs.c -- | diff %t.checked/typedefs.c -

Expand Down
2 changes: 1 addition & 1 deletion clang/test/3C/vargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// RUN: 3c -base-dir=%S %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S -alltypes %s -- | FileCheck -match-full-lines %s
// RUN: 3c -base-dir=%S %s -- | %clang_cc1 -verify -fcheckedc-extension -x c -
// RUN: 3c -base-dir=%S %s -- | %clang -c -Xclang -verify -fcheckedc-extension -x c -
// expected-no-diagnostics
#include <stdarg.h>

Expand Down

0 comments on commit 1fac188

Please sign in to comment.