blob: d576eae8f6526ef82ad181f72b5caf9bb5985e46 [file] [log] [blame]
Argyrios Kyrtzidisc4d2c902011-02-28 19:49:42 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=basic -verify
2// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental %s -analyzer-store=region -verify
Ted Kremenekabb042f2008-12-13 19:24:37 +00003
4typedef int bar_return_t;
5typedef struct {
6 unsigned char int_rep;
7} Foo_record_t;
8extern Foo_record_t Foo_record;
9struct QuxSize {};
10typedef struct QuxSize QuxSize;
11typedef struct {
12 Foo_record_t Foo;
Jordy Rose32f26562010-07-04 00:00:41 +000013 QuxSize size[0];
Ted Kremenekabb042f2008-12-13 19:24:37 +000014} __Request__SetPortalSize_t;
15
Chris Lattnere0303582010-01-09 20:43:19 +000016double __Foo_READSWAP__double(double*);
17
Ted Kremenekabb042f2008-12-13 19:24:37 +000018static __inline__ bar_return_t
Anders Carlsson2127ecc2010-10-22 23:37:08 +000019__Beeble_check__Request__SetPortalSize_t(__Request__SetPortalSize_t *In0P) {
Ted Kremenekabb042f2008-12-13 19:24:37 +000020 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 Stump6fed58e2009-07-21 19:00:12 +000033 return 0;
Ted Kremenekabb042f2008-12-13 19:24:37 +000034}