diff options
Diffstat (limited to 'clang/test/CodeGen/blocks.c')
-rw-r--r-- | clang/test/CodeGen/blocks.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/CodeGen/blocks.c b/clang/test/CodeGen/blocks.c index 3eb4c43505a..4203fce051d 100644 --- a/clang/test/CodeGen/blocks.c +++ b/clang/test/CodeGen/blocks.c @@ -1,7 +1,20 @@ -// RUN: clang-cc %s -emit-llvm -o %t -fblocks +// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o %t -fblocks && void (^f)(void) = ^{}; // rdar://6768379 int f0(int (^a0)()) { return a0(1, 2, 3); } + +// Verify that attributes on blocks are set correctly. +typedef struct s0 T; +struct s0 { + int a[64]; +}; + +// RUN: grep 'internal void @__f2_block_invoke_(.struct.s0\* noalias sret .*, .*, .* byval .*)' %t && +struct s0 f2(struct s0 a0) { + return ^(struct s0 a1){ return a1; }(a0); +} + +// RUN: true |