Chad Rosier | 4ab0024 | 2011-08-04 00:19:13 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -target-abi apcs-gnu -triple armv7-apple-darwin10 %s -verify |
| 2 | |
| 3 | #include <stddef.h> |
| 4 | |
| 5 | struct t1 |
| 6 | { |
| 7 | int foo : 1; |
| 8 | char : 0; |
| 9 | char bar; |
| 10 | }; |
| 11 | static int arr1_offset[(offsetof(struct t1, bar) == 1) ? 0 : -1]; |
| 12 | static int arr1_sizeof[(sizeof(struct t1) == 2) ? 0 : -1]; |
| 13 | |
| 14 | struct t2 |
| 15 | { |
| 16 | int foo : 1; |
| 17 | short : 0; |
| 18 | char bar; |
| 19 | }; |
| 20 | static int arr2_offset[(offsetof(struct t2, bar) == 1) ? 0 : -1]; |
| 21 | static int arr2_sizeof[(sizeof(struct t2) == 2) ? 0 : -1]; |
| 22 | |
| 23 | struct t3 |
| 24 | { |
| 25 | int foo : 1; |
| 26 | int : 0; |
| 27 | char bar; |
| 28 | }; |
| 29 | static int arr3_offset[(offsetof(struct t3, bar) == 1) ? 0 : -1]; |
| 30 | static int arr3_sizeof[(sizeof(struct t3) == 2) ? 0 : -1]; |
| 31 | |
| 32 | struct t4 |
| 33 | { |
| 34 | int foo : 1; |
| 35 | long : 0; |
| 36 | char bar; |
| 37 | }; |
| 38 | static int arr4_offset[(offsetof(struct t4, bar) == 1) ? 0 : -1]; |
| 39 | static int arr4_sizeof[(sizeof(struct t4) == 2) ? 0 : -1]; |
| 40 | |
| 41 | struct t5 |
| 42 | { |
| 43 | int foo : 1; |
| 44 | long long : 0; |
| 45 | char bar; |
| 46 | }; |
| 47 | static int arr5_offset[(offsetof(struct t5, bar) == 1) ? 0 : -1]; |
| 48 | static int arr5_sizeof[(sizeof(struct t5) == 2) ? 0 : -1]; |
| 49 | |
| 50 | struct t6 |
| 51 | { |
| 52 | int foo : 1; |
| 53 | char : 0; |
| 54 | char bar : 1; |
| 55 | char bar2; |
| 56 | }; |
| 57 | static int arr6_offset[(offsetof(struct t6, bar2) == 1) ? 0 : -1]; |
| 58 | static int arr6_sizeof[(sizeof(struct t6) == 2) ? 0 : -1]; |
| 59 | |
| 60 | struct t7 |
| 61 | { |
| 62 | int foo : 1; |
| 63 | short : 0; |
| 64 | char bar1 : 1; |
| 65 | char bar2; |
| 66 | }; |
| 67 | static int arr7_offset[(offsetof(struct t7, bar2) == 1) ? 0 : -1]; |
| 68 | static int arr7_sizeof[(sizeof(struct t7) == 2) ? 0 : -1]; |
| 69 | |
| 70 | struct t8 |
| 71 | { |
| 72 | int foo : 1; |
| 73 | int : 0; |
| 74 | char bar1 : 1; |
| 75 | char bar2; |
| 76 | }; |
| 77 | static int arr8_offset[(offsetof(struct t8, bar2) == 1) ? 0 : -1]; |
| 78 | static int arr8_sizeof[(sizeof(struct t8) == 2) ? 0 : -1]; |
| 79 | |
| 80 | struct t9 |
| 81 | { |
| 82 | int foo : 1; |
| 83 | long : 0; |
| 84 | char bar1 : 1; |
| 85 | char bar2; |
| 86 | }; |
| 87 | static int arr9_offset[(offsetof(struct t9, bar2) == 1) ? 0 : -1]; |
| 88 | static int arr9_sizeof[(sizeof(struct t9) == 2) ? 0 : -1]; |
| 89 | |
| 90 | struct t10 |
| 91 | { |
| 92 | int foo : 1; |
| 93 | long long : 0; |
| 94 | char bar1 : 1; |
| 95 | char bar2; |
| 96 | }; |
| 97 | static int arr10_offset[(offsetof(struct t10, bar2) == 1) ? 0 : -1]; |
| 98 | static int arr10_sizeof[(sizeof(struct t10) == 2) ? 0 : -1]; |
| 99 | |
| 100 | |
| 101 | struct t11 |
| 102 | { |
| 103 | int foo : 1; |
| 104 | long long : 0; |
| 105 | char : 0; |
| 106 | char bar1 : 1; |
| 107 | char bar2; |
| 108 | }; |
| 109 | static int arr11_offset[(offsetof(struct t11, bar2) == 1) ? 0 : -1]; |
| 110 | static int arr11_sizeof[(sizeof(struct t11) == 2) ? 0 : -1]; |
| 111 | |
| 112 | int main() { |
| 113 | return 0; |
| 114 | } |
| 115 | |