Eric Christopher | 3883e66 | 2011-07-26 22:17:02 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - |
| 2 | |
| 3 | // Aggregates of size zero should be dropped from argument list. |
| 4 | typedef long int Tlong; |
| 5 | struct S2411 { |
| 6 | __attribute__((aligned)) Tlong:0; |
| 7 | }; |
| 8 | |
| 9 | extern struct S2411 a2411[5]; |
| 10 | extern void checkx2411(struct S2411); |
| 11 | void test2411(void) { |
| 12 | checkx2411(a2411[0]); |
| 13 | } |
| 14 | |
| 15 | // Proper handling of zero sized fields during type conversion. |
| 16 | typedef unsigned long long int Tal2ullong __attribute__((aligned(2))); |
| 17 | struct S2525 { |
| 18 | Tal2ullong: 0; |
| 19 | struct { |
| 20 | } e; |
| 21 | }; |
| 22 | struct S2525 s2525; |
| 23 | |
| 24 | struct { |
| 25 | signed char f; |
| 26 | char :0; |
| 27 | struct{}h; |
| 28 | char * i[5]; |
| 29 | } data; |
| 30 | |
| 31 | // Taking address of a zero sized field. |
| 32 | struct Z {}; |
| 33 | struct Y { |
| 34 | int i; |
| 35 | struct Z z; |
| 36 | }; |
| 37 | void *f(struct Y *y) { |
| 38 | return &y->z; |
| 39 | } |