xref: /llvm-project/clang/test/Analysis/ctu-implicit.c (revision 56b9b97c1ef594f218eb06d2e62daa85cc238500)
1 // RUN: rm -rf %t && mkdir %t
2 // RUN: mkdir -p %t/ctudir2
3 // RUN: %clang_cc1  \
4 // RUN:   -emit-pch -o %t/ctudir2/ctu-import.c.ast %S/Inputs/ctu-import.c
5 // RUN: cp %S/Inputs/ctu-import.c.externalDefMap.ast-dump.txt %t/ctudir2/externalDefMap.txt
6 // RUN: %clang_cc1 -analyze \
7 // RUN:   -analyzer-checker=core,debug.ExprInspection \
8 // RUN:   -analyzer-config eagerly-assume=false \
9 // RUN:   -analyzer-config experimental-enable-naive-ctu-analysis=true \
10 // RUN:   -analyzer-config  display-ctu-progress=true \
11 // RUN:   -analyzer-config ctu-dir=%t/ctudir2 \
12 // RUN:   -verify %s
13 
14 void clang_analyzer_eval(int);
15 
16 int testStaticImplicit(void);
func(void)17 int func(void) {
18   int ret = testStaticImplicit();
19   clang_analyzer_eval(ret == 4); // expected-warning{{TRUE}} ctu
20                                  // expected-warning@-1{{UNKNOWN}} stu
21   return testStaticImplicit();
22 }
23