diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-02 21:33:44 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-02 21:33:44 +0000 |
commit | d295b8229c119e0f2b085874249437347084e320 (patch) | |
tree | 3b977ea9974f3b7a54923c4d32fa16e64a555309 /test/CodeGen/capture-complex-expr-in-block.c | |
parent | 8289f49c0c094bacdac9cc0da8882042506e3fc1 (diff) |
blocks: Support capturing complex variable in block.
// rdar://10033896
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/capture-complex-expr-in-block.c')
-rw-r--r-- | test/CodeGen/capture-complex-expr-in-block.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/capture-complex-expr-in-block.c b/test/CodeGen/capture-complex-expr-in-block.c new file mode 100644 index 0000000000..c38823707c --- /dev/null +++ b/test/CodeGen/capture-complex-expr-in-block.c @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s +// rdar://10033986 + +typedef void (^BLOCK)(void); +int main () +{ + _Complex double c; + BLOCK b = ^() { + _Complex double z; + z = z + c; + }; + b(); +} + +// CHECK: define internal void @__main_block_invoke_0 +// CHECK: [[C1:%.*]] = alloca { double, double }, align 8 +// CHECK: [[C1]].realp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0 +// CHECK-NEXT: [[C1]].real = load double* [[C1]].realp +// CHECK-NEXT: [[C1]].imagp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1 +// CHECK-NEXT: [[C1]].imag = load double* [[C1]].imagp |