1 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
3 // CHECK: @ArrayRecurs = internal global
4 // CHECK: @FUNC.ArrayRecurs = internal global
5 // CHECK: @FUNC.ArrayRecurs.1 = internal global
6 // CHECK: @FUNC1.ArrayRecurs = internal global
10 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
12 for(id rawAddress in addresses)
14 NSArray *separatedAddresses = ((NSArray*)0);
15 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
20 extern NSArray *address;
21 extern unsigned long level;
25 ArrayRecurs(address, level);
27 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
29 for(id rawAddress in addresses)
31 NSArray *separatedAddresses = ((NSArray*)0);
32 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
36 ArrayRecurs(address, level);
39 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
41 for(id rawAddress in addresses)
43 NSArray *separatedAddresses = ((NSArray*)0);
44 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
48 ArrayRecurs(address, level);
53 static void (^const block1)(int) = ^(int a){
59 // CHECK-LABEL: define{{.*}} void @FUNC2(
60 // CHECK: define internal void @_block_invoke{{.*}}(
61 // CHECK: call void %{{.*}}(ptr noundef @__block_literal_global{{.*}}, i32 noundef %{{.*}})
65 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
67 for(id rawAddress in addresses)
69 NSArray *separatedAddresses = ((NSArray*)0);
70 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
74 ArrayRecurs(address, level);