[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / capture-complex-expr-in-block.c
blob4ac7f3859db2c890b420cb49c82e8a9d2917043a
1 // RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
3 typedef void (^BLOCK)(void);
4 int main (void)
6 _Complex double c;
7 BLOCK b = ^() {
8 _Complex double z;
9 z = z + c;
11 b();
14 // CHECK-LABEL: define internal void @__main_block_invoke
15 // CHECK: [[C1:%.*]] = alloca { double, double }, align 8
16 // CHECK: [[RP:%.*]] = getelementptr inbounds nuw { double, double }, ptr [[C1]], i32 0, i32 0
17 // CHECK-NEXT: [[R:%.*]] = load double, ptr [[RP]]
18 // CHECK-NEXT: [[IP:%.*]] = getelementptr inbounds nuw { double, double }, ptr [[C1]], i32 0, i32 1
19 // CHECK-NEXT: [[I:%.*]] = load double, ptr [[IP]]