Fariborz Jahanian | 855a8e7 | 2011-05-03 20:21:04 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-darwin9 %s |
| 2 | // rdar://8823265 |
| 3 | |
| 4 | #define ATTR __attribute__((__ms_struct__)) |
| 5 | |
| 6 | struct { |
| 7 | unsigned int bf_1 : 12; |
| 8 | unsigned int : 0; |
| 9 | unsigned int bf_2 : 12; |
| 10 | } ATTR t1; |
| 11 | static int a1[(sizeof(t1) == 8) -1]; |
| 12 | |
| 13 | struct |
| 14 | { |
| 15 | char foo : 4; |
| 16 | short : 0; |
| 17 | char bar; |
| 18 | } ATTR t2; |
| 19 | static int a2[(sizeof(t2) == 4) -1]; |
| 20 | |
| 21 | #pragma ms_struct on |
| 22 | struct |
| 23 | { |
| 24 | char foo : 4; |
| 25 | short : 0; |
| 26 | char bar; |
| 27 | } t3; |
| 28 | #pragma ms_struct off |
| 29 | static int a3[(sizeof(t3) == 4) -1]; |
| 30 | |
| 31 | struct |
| 32 | { |
| 33 | char foo : 6; |
| 34 | long : 0; |
| 35 | } ATTR t4; |
| 36 | static int a4[(sizeof(t4) == 8) -1]; |
| 37 | |
| 38 | struct |
| 39 | { |
| 40 | char foo : 4; |
| 41 | short : 0; |
| 42 | char bar : 8; |
| 43 | } ATTR t5; |
| 44 | static int a5[(sizeof(t5) == 4) -1]; |
| 45 | |