blob: deea8bac13ea9b2bfe16ccab90538dc2916f7ec6 [file] [log] [blame]
John McCall260611a2012-06-20 06:18:46 +00001// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fobjc-runtime=macosx-fragile-10.5 -emit-llvm %s -o %t-64.ll
Fariborz Jahanian09349142010-09-07 23:26:17 +00002// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.ll %s
3// rdar: // 8390455
4
5@class NSArray;
6
7static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
8
9 for(id rawAddress in addresses)
10 {
11 NSArray *separatedAddresses = ((NSArray*)0);
12 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
13 }
14 return (NSArray *)0;
15};
16
17void FUNC()
18{
19 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
20
21 for(id rawAddress in addresses)
22 {
23 NSArray *separatedAddresses = ((NSArray*)0);
24 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
25 }
26 return (NSArray *)0;
27 };
28
29 if (ArrayRecurs) {
30 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
31
32 for(id rawAddress in addresses)
33 {
34 NSArray *separatedAddresses = ((NSArray*)0);
35 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
36 }
37 return (NSArray *)0;
38 };
39 }
40}
41
42void FUNC1()
43{
44 static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) {
45
46 for(id rawAddress in addresses)
47 {
48 NSArray *separatedAddresses = ((NSArray*)0);
49 separatedAddresses = ArrayRecurs((NSArray *)rawAddress, level+1);
50 }
51 return (NSArray *)0;
52 };
53}
54// CHECK-LP64: @ArrayRecurs = internal global
55// CHECK-LP64: @FUNC.ArrayRecurs = internal global
56// CHECK-LP64: @FUNC.ArrayRecurs3 = internal global
57// CHECK-LP64: @FUNC1.ArrayRecurs = internal global