Skip to content

Commit 91b61ab

Browse files
committed
[NFC] Disallow unused prefixes in clang/test/Analysis
Differential Revision: https://reviews.llvm.org/D95249
1 parent eace81c commit 91b61ab

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

clang/test/Analysis/auto-obj-dtors-cfg-output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_analyze_cc1 -std=c++98 -fcxx-exceptions -fexceptions -analyzer-checker=debug.DumpCFG -analyzer-config cfg-rich-constructors=false %s > %t 2>&1
2-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX98,WARNINGS,CXX98-WARNINGS %s
2+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX98,WARNINGS %s
33
// RUN: %clang_analyze_cc1 -std=c++98 -fcxx-exceptions -fexceptions -analyzer-checker=debug.DumpCFG -analyzer-config cfg-rich-constructors=true %s > %t 2>&1
44
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX98,ANALYZER,CXX98-ANALYZER %s
55
// RUN: %clang_analyze_cc1 -std=c++11 -fcxx-exceptions -fexceptions -analyzer-checker=debug.DumpCFG -analyzer-config cfg-rich-constructors=false %s > %t 2>&1

clang/test/Analysis/cfg-rich-constructors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w %s > %t 2>&1
2-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,ELIDE,CXX11-ELIDE %s
2+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-ELIDE %s
33
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w %s > %t 2>&1
4-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17,ELIDE,CXX17-ELIDE %s
4+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
55
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w -analyzer-config elide-constructors=false %s > %t 2>&1
6-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,NOELIDE,CXX11-NOELIDE %s
6+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-NOELIDE %s
77
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w -analyzer-config elide-constructors=false %s > %t 2>&1
8-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17,NOELIDE,CXX17-NOELIDE %s
8+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
99

1010
class C {
1111
public:

clang/test/Analysis/cfg-rich-constructors.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w %s > %t 2>&1
2-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,ELIDE,CXX11-ELIDE %s
2+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-ELIDE %s
33
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w %s > %t 2>&1
4-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17,ELIDE,CXX17-ELIDE %s
4+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
55
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++11 -w -analyzer-config elide-constructors=false %s > %t 2>&1
6-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,NOELIDE,CXX11-NOELIDE %s
6+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX11,CXX11-NOELIDE %s
77
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++17 -w -analyzer-config elide-constructors=false %s > %t 2>&1
8-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17,NOELIDE,CXX17-NOELIDE %s
8+
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,CXX17 %s
99

1010
class D {
1111
public:

clang/test/Analysis/cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -fheinous-gnu-extensions %s > %t 2>&1
2-
// RUN: FileCheck --input-file=%t -check-prefixes=CHECK,WARNINGS %s
2+
// RUN: FileCheck --input-file=%t --check-prefix=CHECK %s
33

44
// This file is the C version of cfg.cpp.
55
// Tests that are C-specific should go into this file.

clang/test/Analysis/exploded-graph-rewriter/trimmers.dot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// RUN: %exploded_graph_rewriter %s \
22
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
33
// RUN: %exploded_graph_rewriter -s %s \
4-
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
4+
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTTHREE,FOUR
55
// RUN: %exploded_graph_rewriter --to=0x2 %s \
6-
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
6+
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTTHREE,NOTFOUR
77
// RUN: %exploded_graph_rewriter --to 2 %s \
8-
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
8+
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTTHREE,NOTFOUR
99
// RUN: %exploded_graph_rewriter --to 2,3 %s \
10-
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,NOFOUR
10+
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,NOTFOUR
1111
// RUN: %exploded_graph_rewriter --to 4 %s \
1212
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
1313
// RUN: %exploded_graph_rewriter --to 4 -s %s \
14-
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
14+
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTTHREE,FOUR
1515

1616
Node0x1 [shape=record,label=
1717
"{{ "state_id": 0, "program_state": null, "program_points": [

clang/test/Analysis/lit.local.cfg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
2-
2+
from lit.llvm.subst import ToolSubst
33
import site
44

55
# Load the custom analyzer test format, which runs the test again with Z3 if it
@@ -26,3 +26,9 @@ config.substitutions.append(('%normalize_sarif',
2626

2727
if not config.root.clang_staticanalyzer:
2828
config.unsupported = True
29+
30+
fc = ToolSubst('FileCheck', unresolved='fatal')
31+
# Insert this first. Then, we'll first update the blank FileCheck command; then,
32+
# the default substitution of FileCheck will replace it to its full path.
33+
config.substitutions.insert(0, (fc.regex,
34+
'FileCheck --allow-unused-prefixes=false'))

0 commit comments

Comments
 (0)