Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 %s -emit-llvm -triple i386-apple-darwin -o - | FileCheck %s
      2 extern void abort();
      3 extern void exit(int);
      4 struct T
      5 {
      6 unsigned i:8;
      7 unsigned c:24;
      8 };
      9 f(struct T t)
     10 {
     11 struct T s[1];
     12 s[0]=t;
     13 return(char)s->c;
     14 }
     15 main()
     16 {
     17 // CHECK:  getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0
     18 // CHECK:  getelementptr inbounds [1 x %struct.T], [1 x %struct.T]* %s, i32 0, i32 0
     19 struct T t;
     20 t.i=0xff;
     21 t.c=0xffff11;
     22 if(f(t)!=0x11)abort();
     23 exit(0);
     24 }
     25