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