diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-02 18:39:40 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-02 18:39:40 +0000 |
| commit | f30bc001034566aa1fdeb63b2a3f9a533abacb93 (patch) | |
| tree | 19263f28a52e606cf336abbc321f09ea720d7a0c /clang/test/CodeGen | |
| parent | 97fe09ad2ee725837fe959b9ccf090c44d260c3b (diff) | |
| download | bcm5719-llvm-f30bc001034566aa1fdeb63b2a3f9a533abacb93.tar.gz bcm5719-llvm-f30bc001034566aa1fdeb63b2a3f9a533abacb93.zip | |
blocks: Support capturing complex variable in block.
// rdar://10033896
llvm-svn: 139020
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/capture-complex-expr-block.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGen/capture-complex-expr-block.c b/clang/test/CodeGen/capture-complex-expr-block.c new file mode 100644 index 00000000000..17d3cc5a0c9 --- /dev/null +++ b/clang/test/CodeGen/capture-complex-expr-block.c @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s +// rdar://10033986 + +int main () +{ + _Complex double c; + ^() { + _Complex double z; + z = z + c; + }; + return 0; +} + +// 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 |

