diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-11-02 22:51:18 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-11-02 22:51:18 +0000 |
commit | 2dd78192676a842bdd86b3b6fab85bc3e5fe3275 (patch) | |
tree | b5566f601456ac767705c1d7c1d73a28cbc9f8cd /clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m | |
parent | 3b0af848d31e5fbab4d03c0f58ea3d915874fd2f (diff) | |
download | bcm5719-llvm-2dd78192676a842bdd86b3b6fab85bc3e5fe3275.tar.gz bcm5719-llvm-2dd78192676a842bdd86b3b6fab85bc3e5fe3275.zip |
objective-C mrr block. Block variable layout metadata in
mrr mode.
llvm-svn: 167331
Diffstat (limited to 'clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m')
-rw-r--r-- | clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m b/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m new file mode 100644 index 00000000000..c715caa3108 --- /dev/null +++ b/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m @@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -O0 -emit-llvm %s -o %t-64.s +// rdar://12184410 + +void x(id y) {} +void y(int a) {} + +extern id opaque_id(); +__weak id wid; + +void f() { + __block int byref_int = 0; + const id bar = (id) opaque_id(); + id baz = 0; + __strong id strong_void_sta; + __block id byref_bab = (id)0; + __block id bl_var1; + +// Inline instruction for block variable layout: 0x0100 +// CKECK-LP64: i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i64 256 } + void (^b)() = ^{ + x(bar); + }; + +// Inline instruction for block variable layout: 0x0210 +// CKECK-LP64: i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i64 528 } + void (^c)() = ^{ + x(bar); + x(baz); + byref_int = 1; + }; + +// Inline instruction for block variable layout: 0x0230 +// CKECK-LP64: i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i64 560 } + void (^d)() = ^{ + x(bar); + x(baz); + byref_int = 1; + bl_var1 = 0; + byref_bab = 0; + }; + +// Inline instruction for block variable layout: 0x0230 +// CKECK-LP64: i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i64 560 } + id (^e)() = ^{ + x(bar); + x(baz); + byref_int = 1; + bl_var1 = 0; + byref_bab = 0; + return wid; + }; + +// Inline instruction for block variable layout: 0x020 +// CKECK-LP64: i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i64 32 } + void (^ii)() = ^{ + byref_int = 1; + byref_bab = 0; + }; +} |