1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
2*f4a2713aSLionel Sambuc // rdar://10033986
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc typedef void (^BLOCK)(void);
main()5*f4a2713aSLionel Sambuc int main ()
6*f4a2713aSLionel Sambuc {
7*f4a2713aSLionel Sambuc     _Complex double c;
8*f4a2713aSLionel Sambuc     BLOCK b =  ^() {
9*f4a2713aSLionel Sambuc       _Complex double z;
10*f4a2713aSLionel Sambuc       z = z + c;
11*f4a2713aSLionel Sambuc     };
12*f4a2713aSLionel Sambuc     b();
13*f4a2713aSLionel Sambuc }
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal void @__main_block_invoke
16*f4a2713aSLionel Sambuc // CHECK:  [[C1:%.*]] = alloca { double, double }, align 8
17*f4a2713aSLionel Sambuc // CHECK:  [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0
18*f4a2713aSLionel Sambuc // CHECK-NEXT:  [[R:%.*]] = load double* [[RP]]
19*f4a2713aSLionel Sambuc // CHECK-NEXT:  [[IP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1
20*f4a2713aSLionel Sambuc // CHECK-NEXT:  [[I:%.*]] = load double* [[IP]]
21