1 // RUN: %clang_cc1 -no-opaque-pointers -fobjc-arc -fblocks -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-HEAP %s
2 // RUN: %clang_cc1 -no-opaque-pointers -fobjc-arc -fblocks -fobjc-avoid-heapify-local-blocks -emit-llvm %s -o - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-NOHEAP %s
5 typedef void (^block_t)(void);
6 void use_block(block_t);
9 // rdar://problem/10211676
12 block_t block = ^{ use_int(i); };
13 // CHECK-LABEL: define {{.*}}void @test0(
14 // CHECK-HEAP: call {{.*}}i8* @llvm.objc.retainBlock(i8* {{%.*}}) [[NUW:#[0-9]+]], !clang.arc.copy_on_escape
15 // CHECK-NOHEAP-NOT: @llvm.objc.retainBlock(
20 id block = ^{ use_int(i); };
21 // CHECK-LABEL: define {{.*}}void @test1(
22 // CHECK-HEAP: call {{.*}}i8* @llvm.objc.retainBlock(i8* {{%.*}}) [[NUW]]
23 // CHECK-NOHEAP: call {{.*}}i8* @llvm.objc.retainBlock(i8* {{%.*}}) [[NUW:#[0-9]+]]
24 // CHECK-NOT: !clang.arc.copy_on_escape
28 // CHECK: attributes [[NUW]] = { nounwind }