Skip to content

Commit c3f8dd1

Browse files
authored
[NFC][analyzer] Use %clang_analyze_cc1 consistently (#145895)
A large majority of the LIT tests of the clang static analyzer use RUN lines with the placeholder `%clang_analyze_cc1` which expands to `%clang_cc1 -analyze -setup-static-analyzer` where the only effect of `-setup-static-analyzer` is that it ensures that the macro `__clang_analyzer__` is defined. However, there were some tests that used `%clang_cc1 -analyze` directly; this commit changes those to using `%clang_analyze_cc1` for the sake of consistency. Previously `%clang_analyze_cc1` did not work within the directory `exploded-graph-rewriter` (because that directory has its own custom `lit.local.cfg`) but this problem was eliminated by the recent commit 40cc437, so it was possible to resolve and delete the FIXME comments asking for this change. There are a few tests that use `%clang --analyze` or other command-line flags (e.g. help flags), those are not affected by this change. This cleanup was discussed in the discourse thread https://discourse.llvm.org/t/taking-ownership-of-clang-test-analysis/84689/11
1 parent 3a7d608 commit c3f8dd1

39 files changed

+58
-65
lines changed

clang/test/Analysis/ArrayDelete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -analyze -analyzer-checker=cplusplus.ArrayDelete -std=c++11 -verify -analyzer-output=text %s
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.ArrayDelete -std=c++11 -verify -analyzer-output=text %s
22

33
struct Base {
44
virtual ~Base() = default;

clang/test/Analysis/DeleteWithNonVirtualDtor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.cplusplus.DeleteWithNonVirtualDtor -std=c++11 -verify -analyzer-output=text %s
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.cplusplus.DeleteWithNonVirtualDtor -std=c++11 -verify -analyzer-output=text %s
22

33
struct Virtual {
44
virtual ~Virtual() {}

clang/test/Analysis/PR37855.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -analyze -analyzer-checker=core -w -DNO_CROSSCHECK -verify %s
2-
// RUN: %clang_cc1 -analyze -analyzer-checker=core -w -analyzer-config crosscheck-with-z3=true -verify %s
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -DNO_CROSSCHECK -verify %s
2+
// RUN: %clang_analyze_cc1 -analyzer-checker=core -w -analyzer-config crosscheck-with-z3=true -verify %s
33
// REQUIRES: z3
44

55
// XFAIL: *

clang/test/Analysis/aggrinit-cfg-output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -analyzer-config cfg-expand-default-aggr-inits=true %s > %t 2>&1
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -analyzer-config cfg-expand-default-aggr-inits=true %s > %t 2>&1
22
// RUN: FileCheck --input-file=%t %s
33

44
static char a[] = "foobar";

clang/test/Analysis/compound-literals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple=i386-apple-darwin10 -verify %s -analyze \
1+
// RUN: %clang_analyze_cc1 -triple=i386-apple-darwin10 -verify %s \
22
// RUN: -analyzer-checker=debug.ExprInspection
33

44
#define NULL 0

clang/test/Analysis/ctu-cxxdefaultinitexpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
44
// RUN: -emit-pch -o %t/ctudir/ctu-cxxdefaultinitexpr-import.cpp.ast %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp
55
// RUN: cp %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
6-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 -analyze \
6+
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
77
// RUN: -analyzer-checker=core \
88
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
99
// RUN: -analyzer-config ctu-dir=%t/ctudir \

clang/test/Analysis/ctu-implicit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clang_cc1 \
44
// RUN: -emit-pch -o %t/ctudir2/ctu-import.c.ast %S/Inputs/ctu-import.c
55
// RUN: cp %S/Inputs/ctu-import.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
6-
// RUN: %clang_cc1 -analyze \
6+
// RUN: %clang_analyze_cc1 \
77
// RUN: -analyzer-checker=core,debug.ExprInspection \
88
// RUN: -analyzer-config eagerly-assume=false \
99
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Ensure analyzer option 'ctu-import-threshold' is a recognized option.
22
//
3-
// RUN: %clang_cc1 -analyze -analyzer-config ctu-import-threshold=30 -verify %s
4-
// RUN: %clang_cc1 -analyze -analyzer-config ctu-import-cpp-threshold=30 -verify %s
3+
// RUN: %clang_analyze_cc1 -analyzer-config ctu-import-threshold=30 -verify %s
4+
// RUN: %clang_analyze_cc1 -analyzer-config ctu-import-cpp-threshold=30 -verify %s
55
//
66
// expected-no-diagnostics

clang/test/Analysis/ctu-lookup-name-with-space.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: %clang_cc1 -emit-pch %/S/Inputs/ctu-lookup-name-with-space.cpp -o %t/importee.ast
88

99
// RUN: cd %t
10-
// RUN: %clang_cc1 -analyze \
10+
// RUN: %clang_analyze_cc1 \
1111
// RUN: -analyzer-checker=core \
1212
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
1313
// RUN: -analyzer-config ctu-dir=. \

clang/test/Analysis/ctu-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: -emit-pch -o %t/ctudir2/ctu-other.c.ast %S/Inputs/ctu-other.c
55
// RUN: cp %S/Inputs/ctu-other.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
66

7-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c89 -analyze \
7+
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c89 \
88
// RUN: -analyzer-checker=core,debug.ExprInspection \
99
// RUN: -analyzer-config eagerly-assume=false \
1010
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
@@ -14,7 +14,7 @@
1414

1515
// Simulate the behavior of the previous CTU implementation by inlining all
1616
// functions during the first phase. This way, the second phase is a noop.
17-
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c89 -analyze \
17+
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c89 \
1818
// RUN: -analyzer-checker=core,debug.ExprInspection \
1919
// RUN: -analyzer-config eagerly-assume=false \
2020
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \

0 commit comments

Comments
 (0)