clang/test/Analysis/solver-sym-simplification-no-crash.c
raw| 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 | |
| 14 | static void f(int i, int j) |
| 15 | { |
| 16 | (void)(j <= 0 && i ? i : j); |
| 17 | } |
| 18 | |
| 19 | static void g(void) |
| 20 | { |
| 21 | int d = a - b | (c < 0); |
| 22 | for (;;) |
| 23 | { |
| 24 | f(d ^ c, c); |
| 25 | } |
| 26 | } |