blob: 643caffb6d2ac35fc31c50b3e61a59e312c1b771 [file] [log] [blame]
Evan Cheng6bccafd2008-01-26 00:35:43 +00001// RUN: %llvmgcc %s -S -o -
2
3// Aggregates of size zero should be dropped from argument list.
4typedef long int Tlong;
5struct S2411 {
6 __attribute__((aligned)) Tlong:0;
7};
8
9extern struct S2411 a2411[5];
10extern void checkx2411(struct S2411);
11void test2411(void) {
12 checkx2411(a2411[0]);
13}
14
Evan Chengc7484122008-01-29 19:30:05 +000015// Proper handling of zero sized fields during type conversion.
Evan Cheng6bccafd2008-01-26 00:35:43 +000016typedef unsigned long long int Tal2ullong __attribute__((aligned(2)));
17struct S2525 {
18 Tal2ullong: 0;
19 struct {
20 } e;
21};
22struct S2525 s2525;
Devang Patel15b86db2008-01-26 01:21:48 +000023
24struct {
25 signed char f;
26 char :0;
27 struct{}h;
28 char * i[5];
29} data;
30
Evan Chengc7484122008-01-29 19:30:05 +000031// Taking address of a zero sized field.
32struct Z {};
33struct Y {
34 int i;
35 struct Z z;
36};
37void *f(struct Y *y) {
38 return &y->z;
39}