Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / 2010-07-14-ref-off-end.c
blob0b479fe043294fbde126bd41ac721f0af6265f3c
1 // RUN: %clang_cc1 %s -emit-llvm -triple i386-apple-darwin -o - | FileCheck %s
2 extern void abort(void);
3 extern void exit(int);
4 struct T
6 unsigned i:8;
7 unsigned c:24;
8 };
9 int f(struct T t)
11 struct T s[1];
12 s[0]=t;
13 return(char)s->c;
15 int main(void)
17 // CHECK: getelementptr inbounds [1 x %struct.T], ptr %s, i32 0, i32 0
18 // CHECK: getelementptr inbounds [1 x %struct.T], ptr %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);