diff options
Diffstat (limited to 'test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m')
-rw-r--r-- | test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m b/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m index f1e02dd..bb3a20b 100644 --- a/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m +++ b/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m @@ -1,5 +1,8 @@ -// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -O0 -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -fblocks -triple i386-apple-darwin -O0 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-i386 %s +// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple x86_64-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-64.layout +// RUN: FileCheck --input-file=%t-64.layout %s +// RUN: %clang_cc1 -fblocks -fobjc-runtime-has-weak -triple i386-apple-darwin -O0 -print-ivar-layout -emit-llvm -o /dev/null %s > %t-32.layout +// RUN: FileCheck -check-prefix=CHECK-i386 --input-file=%t-32.layout %s +// rdar://12184410 // rdar://12184410 void x(id y) {} @@ -16,25 +19,25 @@ void f() { __block id byref_bab = (id)0; __block id bl_var1; -// block variable layout: BL_UNRETAINED:1, BL_OPERATOR:0 -// CHECK: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [2 x i8] c"`\00" -// CHECK-i386: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [2 x i8] c"`\00" +// block variable layout: BL_STRONG:1, BL_OPERATOR:0 +// CHECK: Inline instruction for block variable layout: 0x0100 +// CHECK-i386: Inline instruction for block variable layout: 0x0100 void (^b)() = ^{ x(bar); }; -// block variable layout: BL_UNRETAINED:2, BL_BYREF:1, BL_OPERATOR:0 -// CHECK: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"a@\00" -// CHECK-i386: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"a@\00" +// block variable layout: BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0 +// CHECK: Inline instruction for block variable layout: 0x0210 +// CHECK-i386: Inline instruction for block variable layout: 0x0210 void (^c)() = ^{ x(bar); x(baz); byref_int = 1; }; -// block variable layout: BL_UNRETAINED:2, BL_BYREF:3, BL_OPERATOR:0 -// CHECK: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"aB\00 -// CHECK-i386: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"aB\00 +// block variable layout: BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 +// CHECK: Inline instruction for block variable layout: 0x0230 +// CHECK-i386: Inline instruction for block variable layout: 0x0230 void (^d)() = ^{ x(bar); x(baz); @@ -43,9 +46,9 @@ void f() { byref_bab = 0; }; -// block variable layout: BL_UNRETAINED:2, BL_BYREF:3, BL_OPERATOR:0 -// CHECK: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"aB\00" -// CHECK-i386: @"\01L_OBJC_CLASS_NAME_{{.*}}" = internal global [3 x i8] c"aB\00" +// block variable layout: BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 +// CHECK: Inline instruction for block variable layout: 0x0230 +// CHECK-i386: Inline instruction for block variable layout: 0x0230 id (^e)() = ^{ x(bar); x(baz); @@ -55,9 +58,8 @@ void f() { return wid; }; -// Inline instruction for block variable layout: 0x020 -// CHECK: i8* getelementptr inbounds ([6 x i8]* {{@.*}}, i32 0, i32 0), i64 32 } -// CHECK-i386: i8* getelementptr inbounds ([6 x i8]* {{@.*}}, i32 0, i32 0), i32 32 } +// CHECK: Inline instruction for block variable layout: 0x020 +// CHECK-i386: Inline instruction for block variable layout: 0x020 void (^ii)() = ^{ byref_int = 1; byref_bab = 0; |