[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Analysis / symbol-simplification-fixpoint-two-iterations.cpp
blob679ed3fda7a7a74e6114e65d4aa24bb64472a20f
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 TWO iterations.
9 void clang_analyzer_printState();
11 void test(int a, int b, int c, int d) {
12 if (a + b + c != d)
13 return;
14 if (c + b != 0)
15 return;
16 clang_analyzer_printState();
17 // CHECK: "constraints": [
18 // CHECK-NEXT: { "symbol": "(((reg_$0<int a>) + (reg_$1<int b>)) + (reg_$2<int c>)) != (reg_$3<int d>)", "range": "{ [0, 0] }" },
19 // CHECK-NEXT: { "symbol": "(reg_$2<int c>) + (reg_$1<int b>)", "range": "{ [0, 0] }" }
20 // CHECK-NEXT: ],
21 // CHECK-NEXT: "equivalence_classes": [
22 // CHECK-NEXT: [ "((reg_$0<int a>) + (reg_$1<int b>)) + (reg_$2<int c>)", "reg_$3<int d>" ]
23 // CHECK-NEXT: ],
24 // CHECK-NEXT: "disequality_info": null,
26 // Simplification starts here.
27 if (b != 0)
28 return;
29 clang_analyzer_printState();
30 // CHECK: "constraints": [
31 // CHECK-NEXT: { "symbol": "(reg_$0<int a>) != (reg_$3<int d>)", "range": "{ [0, 0] }" },
32 // CHECK-NEXT: { "symbol": "reg_$1<int b>", "range": "{ [0, 0] }" },
33 // CHECK-NEXT: { "symbol": "reg_$2<int c>", "range": "{ [0, 0] }" }
34 // CHECK-NEXT: ],
35 // CHECK-NEXT: "equivalence_classes": [
36 // CHECK-NEXT: [ "(reg_$0<int a>) != (reg_$3<int d>)" ],
37 // CHECK-NEXT: [ "reg_$0<int a>", "reg_$3<int d>" ],
38 // CHECK-NEXT: [ "reg_$2<int c>" ]
39 // CHECK-NEXT: ],
40 // CHECK-NEXT: "disequality_info": null,
42 // Keep the symbols and the constraints! alive.
43 (void)(a * b * c * d);
44 return;