Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic -verify && |
Ted Kremenek | e1cea75 | 2009-07-06 21:58:46 +0000 | [diff] [blame] | 2 | // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=basic-new-cast -verify && |
Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 3 | // RUN: clang-cc -analyze -checker-cfref %s --analyzer-store=region -verify |
Ted Kremenek | abb042f | 2008-12-13 19:24:37 +0000 | [diff] [blame] | 4 | |
| 5 | typedef int bar_return_t; |
| 6 | typedef struct { |
| 7 | unsigned char int_rep; |
| 8 | } Foo_record_t; |
| 9 | extern Foo_record_t Foo_record; |
| 10 | struct QuxSize {}; |
| 11 | typedef struct QuxSize QuxSize; |
| 12 | typedef struct { |
| 13 | Foo_record_t Foo; |
| 14 | QuxSize size; |
| 15 | } __Request__SetPortalSize_t; |
| 16 | |
| 17 | static __inline__ bar_return_t |
| 18 | __Beeble_check__Request__SetPortalSize_t(__attribute__((__unused__)) __Request__SetPortalSize_t *In0P) { |
| 19 | if (In0P->Foo.int_rep != Foo_record.int_rep) { |
| 20 | do { |
| 21 | int __i__, __C__ = (2); |
| 22 | for (__i__ = 0; |
| 23 | __i__ < __C__; |
| 24 | __i__++) do { |
| 25 | *(&((double *)(&In0P->size))[__i__]) = |
| 26 | __Foo_READSWAP__double(&((double *)(&In0P->size))[__i__]); |
| 27 | } |
| 28 | while (0); |
| 29 | } |
| 30 | while (0); |
| 31 | } |
| 32 | } |