Ted Kremenek | 565e465 | 2010-02-05 02:06:54 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem %s -analyzer-store=basic -verify |
| 2 | // RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem %s -analyzer-store=region -verify |
Ted Kremenek | abb042f | 2008-12-13 19:24:37 +0000 | [diff] [blame] | 3 | |
| 4 | typedef int bar_return_t; |
| 5 | typedef struct { |
| 6 | unsigned char int_rep; |
| 7 | } Foo_record_t; |
| 8 | extern Foo_record_t Foo_record; |
| 9 | struct QuxSize {}; |
| 10 | typedef struct QuxSize QuxSize; |
| 11 | typedef struct { |
| 12 | Foo_record_t Foo; |
Jordy Rose | 32f2656 | 2010-07-04 00:00:41 +0000 | [diff] [blame^] | 13 | QuxSize size[0]; |
Ted Kremenek | abb042f | 2008-12-13 19:24:37 +0000 | [diff] [blame] | 14 | } __Request__SetPortalSize_t; |
| 15 | |
Chris Lattner | e030358 | 2010-01-09 20:43:19 +0000 | [diff] [blame] | 16 | double __Foo_READSWAP__double(double*); |
| 17 | |
Ted Kremenek | abb042f | 2008-12-13 19:24:37 +0000 | [diff] [blame] | 18 | static __inline__ bar_return_t |
| 19 | __Beeble_check__Request__SetPortalSize_t(__attribute__((__unused__)) __Request__SetPortalSize_t *In0P) { |
| 20 | if (In0P->Foo.int_rep != Foo_record.int_rep) { |
| 21 | do { |
| 22 | int __i__, __C__ = (2); |
| 23 | for (__i__ = 0; |
| 24 | __i__ < __C__; |
| 25 | __i__++) do { |
| 26 | *(&((double *)(&In0P->size))[__i__]) = |
| 27 | __Foo_READSWAP__double(&((double *)(&In0P->size))[__i__]); |
| 28 | } |
| 29 | while (0); |
| 30 | } |
| 31 | while (0); |
| 32 | } |
Mike Stump | 6fed58e | 2009-07-21 19:00:12 +0000 | [diff] [blame] | 33 | return 0; |
Ted Kremenek | abb042f | 2008-12-13 19:24:37 +0000 | [diff] [blame] | 34 | } |