diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
| commit | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch) | |
| tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/CodeGen/block-byref-aggr.c | |
| parent | c3b054d250cdca485c71845089c316e10610ebad (diff) | |
Notes
Diffstat (limited to 'test/CodeGen/block-byref-aggr.c')
| -rw-r--r-- | test/CodeGen/block-byref-aggr.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/block-byref-aggr.c b/test/CodeGen/block-byref-aggr.c new file mode 100644 index 000000000000..3027df04861c --- /dev/null +++ b/test/CodeGen/block-byref-aggr.c @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s +// rdar://9309454 + +typedef struct { int v; } RetType; + +RetType func(); + +int main () { + __attribute__((__blocks__(byref))) RetType a = {100}; + + a = func(); +} +// CHECK: [[C1:%.*]] = call i32 (...)* @func() +// CHECK-NEXT: [[CO:%.*]] = getelementptr +// CHECK-NEXT: store i32 [[C1]], i32* [[CO]] +// CHECK-NEXT: [[FORWARDING:%.*]] = getelementptr inbounds [[BR:%.*]]* [[A:%.*]], i32 0, i32 1 +// CHECK-NEXT: [[O:%.*]] = load [[BR]]** [[FORWARDING]] |
