Fariborz Jahanian | 62055b0 | 2011-04-26 23:52:16 +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 | { |
| 8 | char foo; |
| 9 | long : 0; |
| 10 | char bar; |
| 11 | } ATTR t1; |
| 12 | |
| 13 | struct |
| 14 | { |
| 15 | char foo; |
| 16 | long : 0; |
| 17 | char : 0; |
| 18 | int : 0; |
| 19 | char bar; |
| 20 | } ATTR t2; |
| 21 | |
| 22 | struct |
| 23 | { |
| 24 | char foo; |
| 25 | long : 0; |
| 26 | char : 0; |
| 27 | int : 0; |
| 28 | char bar; |
| 29 | long : 0; |
| 30 | char : 0; |
| 31 | } ATTR t3; |
| 32 | |
| 33 | struct |
| 34 | { |
| 35 | long : 0; |
| 36 | char bar; |
| 37 | } ATTR t4; |
| 38 | |
| 39 | struct |
| 40 | { |
| 41 | long : 0; |
| 42 | long : 0; |
| 43 | char : 0; |
| 44 | char bar; |
| 45 | } ATTR t5; |
| 46 | |
| 47 | struct |
| 48 | { |
| 49 | long : 0; |
| 50 | long : 0; |
| 51 | char : 0; |
| 52 | char bar; |
| 53 | } ATTR t6; |
| 54 | |
| 55 | struct |
| 56 | { |
| 57 | char foo; |
| 58 | long : 0; |
| 59 | int : 0; |
| 60 | char bar; |
| 61 | char bar1; |
| 62 | long : 0; |
| 63 | char bar2; |
| 64 | char bar3; |
| 65 | char : 0; |
| 66 | char bar4; |
| 67 | char bar5; |
| 68 | char : 0; |
| 69 | char bar6; |
| 70 | char bar7; |
| 71 | } ATTR t7; |
| 72 | |
| 73 | struct |
| 74 | { |
| 75 | long : 0; |
| 76 | long : 0; |
| 77 | char : 0; |
| 78 | } ATTR t8; |
| 79 | |
| 80 | struct |
| 81 | { |
| 82 | char foo; |
| 83 | long : 0; |
| 84 | int : 0; |
| 85 | char bar; |
| 86 | char bar1; |
| 87 | long : 0; |
| 88 | char bar2; |
| 89 | char bar3; |
| 90 | char : 0; |
| 91 | char bar4; |
| 92 | char bar5; |
| 93 | char : 0; |
| 94 | char bar6; |
| 95 | char bar7; |
| 96 | int i1; |
| 97 | char : 0; |
| 98 | long : 0; |
| 99 | char :4; |
| 100 | char bar8; |
| 101 | char : 0; |
| 102 | char bar9; |
| 103 | char bar10; |
| 104 | int i2; |
| 105 | char : 0; |
| 106 | long : 0; |
| 107 | char :4; |
| 108 | } ATTR t9; |
| 109 | |
| 110 | static int arr1[(sizeof(t1) == 2) -1]; |
| 111 | static int arr2[(sizeof(t2) == 2) -1]; |
| 112 | static int arr3[(sizeof(t3) == 2) -1]; |
| 113 | static int arr4[(sizeof(t4) == 1) -1]; |
| 114 | static int arr5[(sizeof(t5) == 1) -1]; |
| 115 | static int arr6[(sizeof(t6) == 1) -1]; |
| 116 | static int arr7[(sizeof(t7) == 9) -1]; |
| 117 | static int arr8[(sizeof(t8) == 0) -1]; |
| 118 | static int arr9[(sizeof(t9) == 28) -1]; |
| 119 | |
| 120 | int main() { |
| 121 | return 0; |
| 122 | } |
| 123 | |