diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-12-12 21:16:36 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-12-12 21:16:36 +0000 |
commit | 364a59ed8f0b3adb6a9eb9f2d687650ec1d0d8e5 (patch) | |
tree | 73fe6c2973491ec7bed45919847297070054fa8c /test/Sema/pragma-ms_struct.c | |
parent | 9631939f82c0eaa6fb3936a0ce58a41adfbc9011 (diff) |
Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/pragma-ms_struct.c')
-rw-r--r-- | test/Sema/pragma-ms_struct.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Sema/pragma-ms_struct.c b/test/Sema/pragma-ms_struct.c index b2c2684c61..d76ee8bab3 100644 --- a/test/Sema/pragma-ms_struct.c +++ b/test/Sema/pragma-ms_struct.c @@ -32,3 +32,24 @@ struct S { } __attribute__((ms_struct)) t2; +// rdar://10513599 +#pragma ms_struct on + +typedef struct +{ +void *pv; +int l; +} Foo; + +typedef struct +{ +void *pv1; +Foo foo; +unsigned short fInited : 1; +void *pv2; +} PackOddity; + +#pragma ms_struct off + +static int arr[sizeof(PackOddity) == 40 ? 1 : -1]; + |