Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / loop-widening.cpp
blobfbcb72dee160aee7ddce09c60759dfb598b77365
1 // RUN: %clang_analyze_cc1 -verify %s \
2 // RUN: -analyzer-checker=core \
3 // RUN: -analyzer-config widen-loops=true \
4 // RUN: -analyzer-config track-conditions=false \
5 // RUN: -analyzer-max-loop 2 -analyzer-output=text
7 namespace pr43102 {
8 class A {
9 public:
10 void m_fn1();
12 bool g;
13 void fn1() {
14 A a;
15 A *b = &a;
17 for (;;) { // expected-note{{Loop condition is true. Entering loop body}}
18 // expected-note@-1{{Loop condition is true. Entering loop body}}
19 // expected-note@-2{{Value assigned to 'b'}}
20 // no crash during bug report construction
22 g = !b; // expected-note{{Assuming 'b' is null}}
23 b->m_fn1(); // expected-warning{{Called C++ object pointer is null}}
24 // expected-note@-1{{Called C++ object pointer is null}}
27 } // end of namespace pr43102