Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / symbol-simplification-assertion.c
blobe17f5a619158ab4169dad7ed7d938633acaef60c
1 // RUN: %clang_analyze_cc1 %s \
2 // RUN: -analyzer-checker=core \
3 // RUN: -analyzer-checker=debug.ExprInspection \
4 // RUN: -analyzer-config eagerly-assume=true \
5 // RUN: -verify
7 // Here we test that no assertion is fired during symbol simplification.
8 // Related issue: https://github.com/llvm/llvm-project/issues/55546
10 extern void abort() __attribute__((__noreturn__));
11 #define assert(expr) ((expr) ? (void)(0) : abort())
13 void clang_analyzer_warnIfReached();
15 int a, b, c;
16 long L, L1;
17 void test() {
18 assert(a + L + 1 + b != c);
19 assert(L == a);
20 assert(c == 0);
21 L1 = 0;
22 assert(a + L1 + 1 + b != c);
23 assert(a == 0); // no-assertion
24 clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}