xref: /llvm-project/clang/test/Analysis/solver-sym-simplification-no-crash.c (revision 0646e3625499b08a3ac9efd48396f3b463a19139)
1 // RUN: %clang_analyze_cc1 %s \
2 // RUN:   -analyzer-checker=core \
3 // RUN:   -analyzer-checker=debug.ExprInspection \
4 // RUN:   -verify
5 
6 // Here, we test that symbol simplification in the solver does not produce any
7 // crashes.
8 
9 // expected-no-diagnostics
10 
11 static int a, b;
12 static long c;
13 
f(int i,int j)14 static void f(int i, int j)
15 {
16     (void)(j <= 0 && i ? i : j);
17 }
18 
g(void)19 static void g(void)
20 {
21     int d = a - b | (c < 0);
22     for (;;)
23     {
24         f(d ^ c, c);
25     }
26 }
27