[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Analysis / symbol-simplification-fixpoint-one-iteration.cpp
blob73922d420a8c3d397f6e9abc25a29b320b85c056
1 // RUN: %clang_analyze_cc1 %s \
2 // RUN: -analyzer-checker=core \
3 // RUN: -analyzer-checker=debug.ExprInspection \
4 // RUN: 2>&1 | FileCheck %s
6 // In this test we check whether the solver's symbol simplification mechanism
7 // is capable of reaching a fixpoint. This should be done after one iteration.
9 void clang_analyzer_printState();
11 void test(int a, int b, int c) {
12 if (a + b != c)
13 return;
14 clang_analyzer_printState();
15 // CHECK: "constraints": [
16 // CHECK-NEXT: { "symbol": "((reg_$0<int a>) + (reg_$1<int b>)) != (reg_$2<int c>)", "range": "{ [0, 0] }" }
17 // CHECK-NEXT: ],
18 // CHECK-NEXT: "equivalence_classes": [
19 // CHECK-NEXT: [ "(reg_$0<int a>) + (reg_$1<int b>)", "reg_$2<int c>" ]
20 // CHECK-NEXT: ],
21 // CHECK-NEXT: "disequality_info": null,
23 // Simplification starts here.
24 if (b != 0)
25 return;
26 clang_analyzer_printState();
27 // CHECK: "constraints": [
28 // CHECK-NEXT: { "symbol": "(reg_$0<int a>) != (reg_$2<int c>)", "range": "{ [0, 0] }" },
29 // CHECK-NEXT: { "symbol": "reg_$1<int b>", "range": "{ [0, 0] }" }
30 // CHECK-NEXT: ],
31 // CHECK-NEXT: "equivalence_classes": [
32 // CHECK-NEXT: [ "(reg_$0<int a>) != (reg_$2<int c>)" ],
33 // CHECK-NEXT: [ "reg_$0<int a>", "reg_$2<int c>" ]
34 // CHECK-NEXT: ],
35 // CHECK-NEXT: "disequality_info": null,
37 // Keep the symbols and the constraints! alive.
38 (void)(a * b * c);
39 return;