Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic --verify -fblocks %s |
Ted Kremenek | 2dabd42 | 2009-01-22 18:53:15 +0000 | [diff] [blame] | 2 | |
| 3 | //--------------------------------------------------------------------------- |
| 4 | // Test case 'checkaccess_union' differs for region store and basic store. |
| 5 | // The basic store doesn't reason about compound literals, so the code |
| 6 | // below won't fire an "uninitialized value" warning. |
| 7 | //--------------------------------------------------------------------------- |
| 8 | |
| 9 | // PR 2948 (testcase; crash on VisitLValue for union types) |
| 10 | // http://llvm.org/bugs/show_bug.cgi?id=2948 |
| 11 | |
| 12 | void checkaccess_union() { |
| 13 | int ret = 0, status; |
| 14 | if (((((__extension__ (((union { // no-warning |
| 15 | __typeof (status) __in; int __i;} |
| 16 | ) |
| 17 | { |
| 18 | .__in = (status)} |
| 19 | ).__i))) & 0xff00) >> 8) == 1) |
| 20 | ret = 1; |
| 21 | } |