[NFC][clang][analyzer] Move CTU tests and inputs into a dedicated subfolder
Move CTU related LIT tests to a dedicated directory. -- CPP-7804
This commit is contained in:
parent
5524fa4c23
commit
4e383ec78c
@ -1,4 +0,0 @@
|
||||
14:c:@S@foo@value ctu-cxxdefaultinitexpr-import.cpp.ast
|
||||
35:c:@S@QDomElementPrivate@F@importee# ctu-cxxdefaultinitexpr-import.cpp.ast
|
||||
45:c:@S@QDomElementPrivate@F@QDomElementPrivate# ctu-cxxdefaultinitexpr-import.cpp.ast
|
||||
39:c:@S@QDomNodePrivate@F@QDomNodePrivate# ctu-cxxdefaultinitexpr-import.cpp.ast
|
||||
@ -1 +0,0 @@
|
||||
23:c:@F@testStaticImplicit ctu-import.c.ast
|
||||
@ -1,2 +0,0 @@
|
||||
9:c:@F@bar# ctu-onego-existingdef-other.cpp.ast
|
||||
11:c:@F@other# ctu-onego-existingdef-other.cpp.ast
|
||||
@ -1,2 +0,0 @@
|
||||
11:c:@F@other# ctu-onego-indirect-other.cpp.ast
|
||||
9:c:@F@bar# ctu-onego-indirect-other.cpp.ast
|
||||
@ -1 +0,0 @@
|
||||
9:c:@F@bar# ctu-onego-small-other.cpp.ast
|
||||
@ -1 +0,0 @@
|
||||
13:c:@F@other#I# ctu-onego-toplevel-other.cpp.ast
|
||||
@ -1,7 +0,0 @@
|
||||
14:c:@F@inlineAsm ctu-other.c.ast
|
||||
6:c:@F@g ctu-other.c.ast
|
||||
6:c:@F@f ctu-other.c.ast
|
||||
14:c:@F@enumCheck ctu-other.c.ast
|
||||
18:c:@F@identImplicit ctu-other.c.ast
|
||||
18:c:@F@structInProto ctu-other.c.ast
|
||||
23:c:@F@switchWithoutCases ctu-other.c.ast
|
||||
@ -1,31 +0,0 @@
|
||||
19:c:@N@chns@F@chf1#I# ctu-other.cpp.ast
|
||||
30:c:@N@myns@N@embed_ns@F@fens#I# ctu-other.cpp.ast
|
||||
9:c:@F@g#I# ctu-other.cpp.ast
|
||||
21:c:@S@mycls@F@fscl#I#S ctu-other.cpp.ast
|
||||
19:c:@S@mycls@F@fcl#I# ctu-other.cpp.ast
|
||||
20:c:@S@mycls@F@fvcl#I# ctu-other.cpp.ast
|
||||
31:c:@N@myns@S@embed_cls@F@fecl#I# ctu-other.cpp.ast
|
||||
34:c:@S@mycls@S@embed_cls2@F@fecl2#I# ctu-other.cpp.ast
|
||||
22:c:@S@derived@F@fvcl#I# ctu-other.cpp.ast
|
||||
9:c:@F@f#I# ctu-other.cpp.ast
|
||||
18:c:@N@myns@F@fns#I# ctu-other.cpp.ast
|
||||
9:c:@F@h#I# ctu-other.cpp.ast
|
||||
15:c:@F@h_chain#I# ctu-chain.cpp.ast
|
||||
27:c:@N@chns@S@chcls@F@chf4#I# ctu-chain.cpp.ast
|
||||
19:c:@N@chns@F@chf2#I# ctu-chain.cpp.ast
|
||||
29:c:@F@fun_using_anon_struct#I# ctu-other.cpp.ast
|
||||
24:c:@F@other_macro_diag#I# ctu-other.cpp.ast
|
||||
9:c:@extInt ctu-other.cpp.ast
|
||||
17:c:@N@intns@extInt ctu-other.cpp.ast
|
||||
7:c:@extS ctu-other.cpp.ast
|
||||
9:c:@extNTS ctu-other.cpp.ast
|
||||
8:c:@S@A@a ctu-other.cpp.ast
|
||||
8:c:@extSC ctu-other.cpp.ast
|
||||
10:c:@S@ST@sc ctu-other.cpp.ast
|
||||
9:c:@extSCN ctu-other.cpp.ast
|
||||
12:c:@extSubSCN ctu-other.cpp.ast
|
||||
9:c:@extSCC ctu-other.cpp.ast
|
||||
7:c:@extU ctu-other.cpp.ast
|
||||
26:c:@S@TestAnonUnionUSR@Test ctu-other.cpp.ast
|
||||
53:c:@F@testImportOfIncompleteDefaultParmDuringImport#I# ctu-other.cpp.ast
|
||||
39:c:@F@testImportOfDelegateConstructor#I# ctu-other.cpp.ast
|
||||
@ -1,5 +0,0 @@
|
||||
47:c:@N@std@S@allocator_traits@F@allocator_traits# ctu-test-import-failure-import.cpp.ast
|
||||
29:c:@N@CommandLine@RootCommands ctu-test-import-failure-import.cpp.ast
|
||||
55:c:@N@std@N@__cxx11@ST>3#T#T#T@basic_string@F@_M_assign# ctu-test-import-failure-import.cpp.ast
|
||||
97:c:@S@CommandLineOptionDefinition@F@CommandLineOptionDefinition#&1$@S@CommandLineOptionDefinition# ctu-test-import-failure-import.cpp.ast
|
||||
29:c:@N@CommandLine@RootExamples ctu-test-import-failure-import.cpp.ast
|
||||
@ -0,0 +1,4 @@
|
||||
14:c:@S@foo@value cxxdefaultinitexpr-import.cpp.ast
|
||||
35:c:@S@QDomElementPrivate@F@importee# cxxdefaultinitexpr-import.cpp.ast
|
||||
45:c:@S@QDomElementPrivate@F@QDomElementPrivate# cxxdefaultinitexpr-import.cpp.ast
|
||||
39:c:@S@QDomNodePrivate@F@QDomNodePrivate# cxxdefaultinitexpr-import.cpp.ast
|
||||
@ -0,0 +1 @@
|
||||
23:c:@F@testStaticImplicit import.c.ast
|
||||
@ -0,0 +1 @@
|
||||
14:c:@F@external# invalid-ast-other.cpp.ast
|
||||
@ -0,0 +1 @@
|
||||
14:c:@F@external# wrong-missing-ast.cpp.ast
|
||||
@ -0,0 +1,2 @@
|
||||
9:c:@F@bar# onego-existingdef-other.cpp.ast
|
||||
11:c:@F@other# onego-existingdef-other.cpp.ast
|
||||
@ -0,0 +1,2 @@
|
||||
11:c:@F@other# onego-indirect-other.cpp.ast
|
||||
9:c:@F@bar# onego-indirect-other.cpp.ast
|
||||
@ -0,0 +1 @@
|
||||
9:c:@F@bar# onego-small-other.cpp.ast
|
||||
@ -0,0 +1 @@
|
||||
13:c:@F@other#I# onego-toplevel-other.cpp.ast
|
||||
@ -0,0 +1,7 @@
|
||||
14:c:@F@inlineAsm other.c.ast
|
||||
6:c:@F@g other.c.ast
|
||||
6:c:@F@f other.c.ast
|
||||
14:c:@F@enumCheck other.c.ast
|
||||
18:c:@F@identImplicit other.c.ast
|
||||
18:c:@F@structInProto other.c.ast
|
||||
23:c:@F@switchWithoutCases other.c.ast
|
||||
@ -1,4 +1,4 @@
|
||||
#include "../ctu-hdr.h"
|
||||
#include "../hdr.h"
|
||||
|
||||
int callback_to_main(int x);
|
||||
int f(int x) {
|
||||
@ -0,0 +1,31 @@
|
||||
19:c:@N@chns@F@chf1#I# other.cpp.ast
|
||||
30:c:@N@myns@N@embed_ns@F@fens#I# other.cpp.ast
|
||||
9:c:@F@g#I# other.cpp.ast
|
||||
21:c:@S@mycls@F@fscl#I#S other.cpp.ast
|
||||
19:c:@S@mycls@F@fcl#I# other.cpp.ast
|
||||
20:c:@S@mycls@F@fvcl#I# other.cpp.ast
|
||||
31:c:@N@myns@S@embed_cls@F@fecl#I# other.cpp.ast
|
||||
34:c:@S@mycls@S@embed_cls2@F@fecl2#I# other.cpp.ast
|
||||
22:c:@S@derived@F@fvcl#I# other.cpp.ast
|
||||
9:c:@F@f#I# other.cpp.ast
|
||||
18:c:@N@myns@F@fns#I# other.cpp.ast
|
||||
9:c:@F@h#I# other.cpp.ast
|
||||
15:c:@F@h_chain#I# chain.cpp.ast
|
||||
27:c:@N@chns@S@chcls@F@chf4#I# chain.cpp.ast
|
||||
19:c:@N@chns@F@chf2#I# chain.cpp.ast
|
||||
29:c:@F@fun_using_anon_struct#I# other.cpp.ast
|
||||
24:c:@F@other_macro_diag#I# other.cpp.ast
|
||||
9:c:@extInt other.cpp.ast
|
||||
17:c:@N@intns@extInt other.cpp.ast
|
||||
7:c:@extS other.cpp.ast
|
||||
9:c:@extNTS other.cpp.ast
|
||||
8:c:@S@A@a other.cpp.ast
|
||||
8:c:@extSC other.cpp.ast
|
||||
10:c:@S@ST@sc other.cpp.ast
|
||||
9:c:@extSCN other.cpp.ast
|
||||
12:c:@extSubSCN other.cpp.ast
|
||||
9:c:@extSCC other.cpp.ast
|
||||
7:c:@extU other.cpp.ast
|
||||
26:c:@S@TestAnonUnionUSR@Test other.cpp.ast
|
||||
53:c:@F@testImportOfIncompleteDefaultParmDuringImport#I# other.cpp.ast
|
||||
39:c:@F@testImportOfDelegateConstructor#I# other.cpp.ast
|
||||
@ -0,0 +1,5 @@
|
||||
47:c:@N@std@S@allocator_traits@F@allocator_traits# test-import-failure-import.cpp.ast
|
||||
29:c:@N@CommandLine@RootCommands test-import-failure-import.cpp.ast
|
||||
55:c:@N@std@N@__cxx11@ST>3#T#T#T@basic_string@F@_M_assign# test-import-failure-import.cpp.ast
|
||||
97:c:@S@CommandLineOptionDefinition@F@CommandLineOptionDefinition#&1$@S@CommandLineOptionDefinition# test-import-failure-import.cpp.ast
|
||||
29:c:@N@CommandLine@RootExamples test-import-failure-import.cpp.ast
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-cxxdefaultinitexpr-import.cpp.ast %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp
|
||||
// RUN: cp %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/cxxdefaultinitexpr-import.cpp.ast %S/Inputs/cxxdefaultinitexpr-import.cpp
|
||||
// RUN: cp %S/Inputs/cxxdefaultinitexpr-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
|
||||
// RUN: -analyzer-checker=core \
|
||||
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/other.cpp.ast %S/Inputs/other.cpp
|
||||
// RUN: cp %S/Inputs/other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: %clang_analyze_cc1 -std=c++14 -triple powerpc64-montavista-linux-gnu \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
||||
@ -11,7 +11,7 @@
|
||||
// RUN: -verify %s
|
||||
|
||||
// We expect an error in this file, but without a location.
|
||||
// expected-error-re@./ctu-different-triples.cpp:*{{imported AST from {{.*}} had been generated for a different target, current: powerpc64-montavista-linux-gnu, imported: x86_64-pc-linux-gnu}}
|
||||
// expected-error-re@./different-triples.cpp:*{{imported AST from {{.*}} had been generated for a different target, current: powerpc64-montavista-linux-gnu, imported: x86_64-pc-linux-gnu}}
|
||||
|
||||
int f(int);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir2
|
||||
// RUN: %clang_cc1 \
|
||||
// RUN: -emit-pch -o %t/ctudir2/ctu-import.c.ast %S/Inputs/ctu-import.c
|
||||
// RUN: cp %S/Inputs/ctu-import.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir2/import.c.ast %S/Inputs/import.c
|
||||
// RUN: cp %S/Inputs/import.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
|
||||
// RUN: %clang_analyze_cc1 \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
// RUN: -analyzer-config eagerly-assume=false \
|
||||
@ -2,9 +2,9 @@
|
||||
//
|
||||
// RUN: rm -rf %t && mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-inherited-default-ctor-other.cpp.ast \
|
||||
// RUN: %S/Inputs/ctu-inherited-default-ctor-other.cpp
|
||||
// RUN: echo "59:c:@N@clang@S@DeclContextLookupResult@SingleElementDummyList ctu-inherited-default-ctor-other.cpp.ast" \
|
||||
// RUN: -emit-pch -o %t/ctudir/inherited-default-ctor-other.cpp.ast \
|
||||
// RUN: %S/Inputs/inherited-default-ctor-other.cpp
|
||||
// RUN: echo "59:c:@N@clang@S@DeclContextLookupResult@SingleElementDummyList inherited-default-ctor-other.cpp.ast" \
|
||||
// RUN: > %t/ctudir/externalDefMap.txt
|
||||
//
|
||||
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
@ -17,7 +17,7 @@
|
||||
//
|
||||
// expected-no-diagnostics
|
||||
//
|
||||
// CHECK: CTU loaded AST file: ctu-inherited-default-ctor-other.cpp.ast
|
||||
// CHECK: CTU loaded AST file: inherited-default-ctor-other.cpp.ast
|
||||
|
||||
namespace clang {}
|
||||
namespace llvm {}
|
||||
@ -4,7 +4,7 @@
|
||||
// RUN: echo '41:c:@S@G@F@G#@Sa@F@operator void (*)(int)#1 %/t/importee.ast' >> %t/externalDefMap.txt
|
||||
// RUN: echo '38:c:@S@G@F@G#@Sa@F@operator void (*)()#1 %/t/importee.ast' >> %t/externalDefMap.txt
|
||||
// RUN: echo '14:c:@F@importee# %/t/importee.ast' >> %t/externalDefMap.txt
|
||||
// RUN: %clang_cc1 -emit-pch %/S/Inputs/ctu-lookup-name-with-space.cpp -o %t/importee.ast
|
||||
// RUN: %clang_cc1 -emit-pch %/S/Inputs/lookup-name-with-space.cpp -o %t/importee.ast
|
||||
|
||||
// RUN: cd %t
|
||||
// RUN: %clang_analyze_cc1 \
|
||||
@ -35,7 +35,7 @@ void importee();
|
||||
|
||||
void trigger() {
|
||||
// Call an external function to trigger the parsing process of CTU index.
|
||||
// Refer to file Inputs/ctu-lookup-name-with-space.cpp for more details.
|
||||
// Refer to file Inputs/lookup-name-with-space.cpp for more details.
|
||||
|
||||
importee(); // expected-no-diagnostics
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir2
|
||||
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir2/ctu-other.c.ast %S/Inputs/ctu-other.c
|
||||
// RUN: cp %S/Inputs/ctu-other.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir2/other.c.ast %S/Inputs/other.c
|
||||
// RUN: cp %S/Inputs/other.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
|
||||
|
||||
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c89 \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
@ -69,8 +69,8 @@ int testInlineAsm(void) {
|
||||
struct S;
|
||||
int g(struct S *);
|
||||
void testMacro(void) {
|
||||
g(0); // newctu-warning@Inputs/ctu-other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
// oldctu-warning@Inputs/ctu-other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
g(0); // newctu-warning@Inputs/other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
// oldctu-warning@Inputs/other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
}
|
||||
|
||||
// The external function prototype is incomplete.
|
||||
@ -1,10 +1,10 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
|
||||
// RUN: -emit-pch -o %t/ctudir/other.cpp.ast %S/Inputs/other.cpp
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-chain.cpp.ast %S/Inputs/ctu-chain.cpp
|
||||
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/chain.cpp.ast %S/Inputs/chain.cpp
|
||||
// RUN: cp %S/Inputs/other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
|
||||
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
@ -30,10 +30,10 @@
|
||||
// RUN: -analyzer-config ctu-dir=%t/ctudir \
|
||||
// RUN: -analyzer-config display-ctu-progress=true 2>&1 %s | FileCheck %s
|
||||
|
||||
// CHECK: CTU loaded AST file: {{.*}}ctu-other.cpp.ast
|
||||
// CHECK: CTU loaded AST file: {{.*}}ctu-chain.cpp.ast
|
||||
// CHECK: CTU loaded AST file: {{.*}}other.cpp.ast
|
||||
// CHECK: CTU loaded AST file: {{.*}}chain.cpp.ast
|
||||
|
||||
#include "ctu-hdr.h"
|
||||
#include "hdr.h"
|
||||
|
||||
void clang_analyzer_eval(int);
|
||||
|
||||
@ -203,8 +203,8 @@ int main() {
|
||||
clang_analyzer_eval(other_macro_diag(1) == 1); // newctu-warning{{TRUE}} ctu
|
||||
// newctu-warning@-1{{UNKNOWN}} stu
|
||||
// oldctu-warning@-2{{TRUE}}
|
||||
// newctu-warning@Inputs/ctu-other.cpp:93{{REACHABLE}}
|
||||
// oldctu-warning@Inputs/ctu-other.cpp:93{{REACHABLE}}
|
||||
// newctu-warning@Inputs/other.cpp:93{{REACHABLE}}
|
||||
// oldctu-warning@Inputs/other.cpp:93{{REACHABLE}}
|
||||
MACRODIAG(); // newctu-warning{{REACHABLE}}
|
||||
// oldctu-warning@-1{{REACHABLE}}
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: mkdir -p %t
|
||||
// RUN: cp "%s" "%t/ctu-on-demand-parsing.c"
|
||||
// RUN: cp "%S/Inputs/ctu-other.c" "%t/ctu-other.c"
|
||||
// RUN: cp "%s" "%t/on-demand-parsing.c"
|
||||
// RUN: cp "%S/Inputs/other.c" "%t/other.c"
|
||||
//
|
||||
// Path substitutions on Windows platform could contain backslashes. These are escaped in the json file.
|
||||
// compile_commands.json is only needed for extdef_mapping, not for the analysis itself.
|
||||
// RUN: echo '[{"directory":"%t","command":"gcc -std=c89 -Wno-visibility ctu-other.c","file":"ctu-other.c"}]' | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
|
||||
// RUN: echo '[{"directory":"%t","command":"gcc -std=c89 -Wno-visibility other.c","file":"other.c"}]' | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
|
||||
//
|
||||
// RUN: echo '"%t/ctu-other.c": ["gcc", "-std=c89", "-Wno-visibility", "ctu-other.c"]' | sed -e 's/\\/\\\\/g' > %t/invocations.yaml
|
||||
// RUN: echo '"%t/other.c": ["gcc", "-std=c89", "-Wno-visibility", "other.c"]' | sed -e 's/\\/\\\\/g' > %t/invocations.yaml
|
||||
//
|
||||
// RUN: cd "%t" && %clang_extdef_map "%t/ctu-other.c" > externalDefMap.txt
|
||||
// RUN: cd "%t" && %clang_extdef_map "%t/other.c" > externalDefMap.txt
|
||||
//
|
||||
// RUN: cd "%t" && %clang_analyze_cc1 -std=c89 \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
@ -17,7 +17,7 @@
|
||||
// RUN: -analyzer-config ctu-dir=. \
|
||||
// RUN: -analyzer-config ctu-invocation-list=invocations.yaml \
|
||||
// RUN: -analyzer-config ctu-phase1-inlining=all \
|
||||
// RUN: -verify ctu-on-demand-parsing.c
|
||||
// RUN: -verify on-demand-parsing.c
|
||||
//
|
||||
// FIXME: On-demand ctu should be tested in the same file that we have for the
|
||||
// PCH version, but with a different verify prefix (e.g. -verfiy=on-demand-ctu)
|
||||
@ -58,7 +58,7 @@ struct S;
|
||||
int g(struct S *);
|
||||
void testMacro(void) {
|
||||
g(0);
|
||||
// expected-warning@ctu-other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
// expected-warning@other.c:29 {{Access to field 'a' results in a dereference of a null pointer (loaded from variable 'ctx')}}
|
||||
}
|
||||
|
||||
// The external function prototype is incomplete.
|
||||
@ -1,17 +1,17 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: mkdir -p %t/Inputs
|
||||
// RUN: cp %s %t/ctu-on-demand-parsing.cpp
|
||||
// RUN: cp %S/ctu-hdr.h %t/ctu-hdr.h
|
||||
// RUN: cp %S/Inputs/ctu-chain.cpp %t/Inputs/ctu-chain.cpp
|
||||
// RUN: cp %S/Inputs/ctu-other.cpp %t/Inputs/ctu-other.cpp
|
||||
// RUN: cp %s %t/on-demand-parsing.cpp
|
||||
// RUN: cp %S/hdr.h %t/hdr.h
|
||||
// RUN: cp %S/Inputs/chain.cpp %t/Inputs/chain.cpp
|
||||
// RUN: cp %S/Inputs/other.cpp %t/Inputs/other.cpp
|
||||
//
|
||||
// Path substitutions on Windows platform could contain backslashes. These are escaped in the json file.
|
||||
// compile_commands.json is only needed for the extdef_mapping, not for the analysis itself.
|
||||
// RUN: echo '[{"directory":"%t/Inputs","command":"clang++ ctu-chain.cpp","file":"ctu-chain.cpp"},{"directory":"%t/Inputs","command":"clang++ ctu-other.cpp","file":"ctu-other.cpp"}]' | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
|
||||
// RUN: echo '[{"directory":"%t/Inputs","command":"clang++ chain.cpp","file":"chain.cpp"},{"directory":"%t/Inputs","command":"clang++ other.cpp","file":"other.cpp"}]' | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
|
||||
//
|
||||
// RUN: echo '{"%t/Inputs/ctu-chain.cpp": ["g++", "%t/Inputs/ctu-chain.cpp"], "%t/Inputs/ctu-other.cpp": ["g++", "%t/Inputs/ctu-other.cpp"]}' | sed -e 's/\\/\\\\/g' > %t/invocations.yaml
|
||||
// RUN: echo '{"%t/Inputs/chain.cpp": ["g++", "%t/Inputs/chain.cpp"], "%t/Inputs/other.cpp": ["g++", "%t/Inputs/other.cpp"]}' | sed -e 's/\\/\\\\/g' > %t/invocations.yaml
|
||||
//
|
||||
// RUN: cd "%t" && %clang_extdef_map Inputs/ctu-chain.cpp Inputs/ctu-other.cpp > externalDefMap.txt
|
||||
// RUN: cd "%t" && %clang_extdef_map Inputs/chain.cpp Inputs/other.cpp > externalDefMap.txt
|
||||
//
|
||||
// RUN: cd "%t" && %clang_analyze_cc1 \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
@ -19,16 +19,16 @@
|
||||
// RUN: -analyzer-config ctu-dir=. \
|
||||
// RUN: -analyzer-config ctu-invocation-list=invocations.yaml \
|
||||
// RUN: -analyzer-config ctu-phase1-inlining=all \
|
||||
// RUN: -verify ctu-on-demand-parsing.cpp
|
||||
// RUN: -verify on-demand-parsing.cpp
|
||||
// RUN: cd "%t" && %clang_analyze_cc1 \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
||||
// RUN: -analyzer-config ctu-dir=. \
|
||||
// RUN: -analyzer-config ctu-invocation-list=invocations.yaml \
|
||||
// RUN: -analyzer-config display-ctu-progress=true ctu-on-demand-parsing.cpp 2>&1 | FileCheck %t/ctu-on-demand-parsing.cpp
|
||||
// RUN: -analyzer-config display-ctu-progress=true on-demand-parsing.cpp 2>&1 | FileCheck %t/on-demand-parsing.cpp
|
||||
//
|
||||
// CHECK: CTU loaded AST file: {{.*}}ctu-other.cpp
|
||||
// CHECK: CTU loaded AST file: {{.*}}ctu-chain.cpp
|
||||
// CHECK: CTU loaded AST file: {{.*}}other.cpp
|
||||
// CHECK: CTU loaded AST file: {{.*}}chain.cpp
|
||||
|
||||
// FIXME: On-demand ctu should be tested in the same file that we have for the
|
||||
// PCH version, but with a different verify prefix (e.g. -verfiy=on-demand-ctu)
|
||||
@ -37,7 +37,7 @@
|
||||
// REQUIRES: system-linux
|
||||
// UNSUPPORTED: target={{.*}}-zos{{.*}}
|
||||
|
||||
#include "ctu-hdr.h"
|
||||
#include "hdr.h"
|
||||
|
||||
void clang_analyzer_eval(int);
|
||||
|
||||
@ -111,6 +111,6 @@ int main() {
|
||||
clang_analyzer_eval(fun_using_anon_struct(8) == 8); // expected-warning{{TRUE}}
|
||||
|
||||
clang_analyzer_eval(other_macro_diag(1) == 1); // expected-warning{{TRUE}}
|
||||
// expected-warning@Inputs/ctu-other.cpp:93{{REACHABLE}}
|
||||
// expected-warning@Inputs/other.cpp:93{{REACHABLE}}
|
||||
MACRODIAG(); // expected-warning{{REACHABLE}}
|
||||
}
|
||||
@ -7,8 +7,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-onego-existingdef-other.cpp.ast %S/Inputs/ctu-onego-existingdef-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-onego-existingdef-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/onego-existingdef-other.cpp.ast %S/Inputs/onego-existingdef-other.cpp
|
||||
// RUN: cp %S/Inputs/onego-existingdef-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
|
||||
// Existing and equal function definition in both TU. `other` calls `bar` thus
|
||||
// `bar` will be indirectly imported. During the import we recognize that there
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-onego-indirect-other.cpp.ast %S/Inputs/ctu-onego-indirect-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-onego-indirect-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/onego-indirect-other.cpp.ast %S/Inputs/onego-indirect-other.cpp
|
||||
// RUN: cp %S/Inputs/onego-indirect-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
|
||||
int bar();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-onego-small-other.cpp.ast %S/Inputs/ctu-onego-small-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-onego-small-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/onego-small-other.cpp.ast %S/Inputs/onego-small-other.cpp
|
||||
// RUN: cp %S/Inputs/onego-small-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
|
||||
// Small function defined in another TU.
|
||||
int bar();
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-onego-toplevel-other.cpp.ast %S/Inputs/ctu-onego-toplevel-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-onego-toplevel-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/onego-toplevel-other.cpp.ast %S/Inputs/onego-toplevel-other.cpp
|
||||
// RUN: cp %S/Inputs/onego-toplevel-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
|
||||
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
@ -1,8 +1,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-test-import-failure-import.cpp.ast %S/Inputs/ctu-test-import-failure-import.cpp
|
||||
// RUN: cp %S/Inputs/ctu-test-import-failure-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/test-import-failure-import.cpp.ast %S/Inputs/test-import-failure-import.cpp
|
||||
// RUN: cp %S/Inputs/test-import-failure-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
|
||||
// RUN: -analyzer-checker=core \
|
||||
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
||||
@ -28,7 +28,7 @@ namespace CommandLine {
|
||||
extern const int RootExamples[];
|
||||
}
|
||||
|
||||
// expected-warning@Inputs/ctu-test-import-failure-import.cpp:14{{incompatible definitions}}
|
||||
// expected-warning@Inputs/ctu-test-import-failure-import.cpp:14{{incompatible definitions}}
|
||||
// expected-note@Inputs/ctu-test-import-failure-import.cpp:14{{no corresponding field here}}
|
||||
// expected-note@Inputs/ctu-test-import-failure-import.cpp:14{{no corresponding field here}}
|
||||
// expected-warning@Inputs/test-import-failure-import.cpp:14{{incompatible definitions}}
|
||||
// expected-warning@Inputs/test-import-failure-import.cpp:14{{incompatible definitions}}
|
||||
// expected-note@Inputs/test-import-failure-import.cpp:14{{no corresponding field here}}
|
||||
// expected-note@Inputs/test-import-failure-import.cpp:14{{no corresponding field here}}
|
||||
@ -4,8 +4,8 @@
|
||||
// RUN: rm -rf %t && mkdir %t
|
||||
// RUN: mkdir -p %t/ctudir
|
||||
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
||||
// RUN: -emit-pch -o %t/ctudir/ctu-other.cpp.ast %S/Inputs/ctu-other.cpp
|
||||
// RUN: cp %S/Inputs/ctu-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: -emit-pch -o %t/ctudir/other.cpp.ast %S/Inputs/other.cpp
|
||||
// RUN: cp %S/Inputs/other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
||||
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-unknown-linux-gnu \
|
||||
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
||||
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
||||
Loading…
x
Reference in New Issue
Block a user