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 how the solver's symbol simplification mechanism
7 // simplifies the disequality info.
9 void clang_analyzer_printState();
11 void test(int a
, int b
, int c
, int d
) {
14 clang_analyzer_printState();
15 // CHECK: "disequality_info": [
17 // CHECK-NEXT: "class": [ "((reg_$0<int a>) + (reg_$1<int b>)) + (reg_$2<int c>)" ],
18 // CHECK-NEXT: "disequal_to": [
19 // CHECK-NEXT: [ "reg_$3<int d>" ]]
22 // CHECK-NEXT: "class": [ "reg_$3<int d>" ],
23 // CHECK-NEXT: "disequal_to": [
24 // CHECK-NEXT: [ "((reg_$0<int a>) + (reg_$1<int b>)) + (reg_$2<int c>)" ]]
29 // Simplification starts here.
32 clang_analyzer_printState();
33 // CHECK: "disequality_info": [
35 // CHECK-NEXT: "class": [ "(reg_$0<int a>) + (reg_$2<int c>)" ],
36 // CHECK-NEXT: "disequal_to": [
37 // CHECK-NEXT: [ "reg_$3<int d>" ]]
40 // CHECK-NEXT: "class": [ "reg_$3<int d>" ],
41 // CHECK-NEXT: "disequal_to": [
42 // CHECK-NEXT: [ "(reg_$0<int a>) + (reg_$2<int c>)" ]]
48 clang_analyzer_printState();
49 // CHECK: "disequality_info": [
51 // CHECK-NEXT: "class": [ "reg_$0<int a>" ],
52 // CHECK-NEXT: "disequal_to": [
53 // CHECK-NEXT: [ "reg_$3<int d>" ]]
56 // CHECK-NEXT: "class": [ "reg_$3<int d>" ],
57 // CHECK-NEXT: "disequal_to": [
58 // CHECK-NEXT: [ "reg_$0<int a>" ]]
62 // Keep the symbols and the constraints! alive.
63 (void)(a
* b
* c
* d
);