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
) {
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] }" }
21 // CHECK-NEXT: "equivalence_classes": [
22 // CHECK-NEXT: [ "((reg_$0<int a>) + (reg_$1<int b>)) + (reg_$2<int c>)", "reg_$3<int d>" ]
24 // CHECK-NEXT: "disequality_info": null,
26 // Simplification starts here.
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] }" }
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>" ]
40 // CHECK-NEXT: "disequality_info": null,
42 // Keep the symbols and the constraints! alive.
43 (void)(a
* b
* c
* d
);