Jordy Rose | 43d9f0d | 2012-05-16 16:01:10 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-store region -analyzer-ipa=inlining -cfg-add-initializers -verify %s |
Ted Kremenek | b277159 | 2011-03-30 17:41:19 +0000 | [diff] [blame] | 2 | // XFAIL: * |
Zhongxing Xu | d074441 | 2011-01-13 12:30:12 +0000 | [diff] [blame] | 3 | |
Jordy Rose | 43d9f0d | 2012-05-16 16:01:10 +0000 | [diff] [blame] | 4 | void clang_analyzer_eval(bool); |
| 5 | |
Zhongxing Xu | d074441 | 2011-01-13 12:30:12 +0000 | [diff] [blame] | 6 | class A { |
| 7 | int x; |
| 8 | public: |
| 9 | A(); |
| 10 | int getx() const { |
| 11 | return x; |
| 12 | } |
| 13 | }; |
| 14 | |
| 15 | A::A() : x(0) { |
| 16 | } |
| 17 | |
| 18 | class B : public A { |
| 19 | int y; |
| 20 | public: |
| 21 | B(); |
| 22 | }; |
| 23 | |
| 24 | B::B() { |
| 25 | } |
| 26 | |
| 27 | void f() { |
| 28 | B b; |
Jordy Rose | 43d9f0d | 2012-05-16 16:01:10 +0000 | [diff] [blame] | 29 | clang_analyzer_eval(b.getx() == 0); // expected-warning{{TRUE}} |
Zhongxing Xu | d074441 | 2011-01-13 12:30:12 +0000 | [diff] [blame] | 30 | } |