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
) {
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] }" }
18 // CHECK-NEXT: "equivalence_classes": [
19 // CHECK-NEXT: [ "(reg_$0<int a>) + (reg_$1<int b>)", "reg_$2<int c>" ]
21 // CHECK-NEXT: "disequality_info": null,
23 // Simplification starts here.
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] }" }
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>" ]
35 // CHECK-NEXT: "disequality_info": null,
37 // Keep the symbols and the constraints! alive.