blob: d9059856254fd19acf1bde7ae09ef1dd193673c6 [file] [log] [blame]
Eric Christopher3883e662011-07-26 22:17:02 +00001// RUN: %clang_cc1 %s -emit-llvm -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
15// Proper handling of zero sized fields during type conversion.
16typedef unsigned long long int Tal2ullong __attribute__((aligned(2)));
17struct S2525 {
18 Tal2ullong: 0;
19 struct {
20 } e;
21};
22struct S2525 s2525;
23
24struct {
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.
32struct Z {};
33struct Y {
34 int i;
35 struct Z z;
36};
37void *f(struct Y *y) {
38 return &y->z;
39}