blob: 89683ba3a89634feb59a8a5b3f51078a3852589f [file] [log] [blame]
Stephen Hines651f13c2014-04-23 16:59:28 -07001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-arc -std=c++11 -emit-llvm -o - %s | FileCheck %s
2// rdar://16299964
3
4@interface NSObject
5+ (id)new;
6@end
7
8@interface NSMutableDictionary : NSObject
9@end
10
11class XClipboardDataSet
12{
13 NSMutableDictionary* mClipData = [NSMutableDictionary new];
14};
15
16@interface AppDelegate @end
17
18@implementation AppDelegate
19- (void)applicationDidFinishLaunching
20{
21 XClipboardDataSet clip;
22}
23@end
24
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -070025// CHECK: [[mClipData:%.*]] = getelementptr inbounds %class.XClipboardDataSet, %class.XClipboardDataSet*
26// CHECK: [[ZERO:%.*]] = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_"
27// CHECK: [[ONE:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_
Stephen Hines651f13c2014-04-23 16:59:28 -070028// CHECK: [[TWO:%.*]] = bitcast %struct._class_t* [[ZERO]] to i8*
29// CHECK: [[CALL:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[TWO]], i8* [[ONE]])
30// CHECK: [[THREE:%.*]] = bitcast i8* [[CALL]] to [[T:%.*]]*
31// CHECK: store [[T]]* [[THREE]], [[T]]** [[mClipData]], align 8
32
Stephen Hines176edba2014-12-01 14:53:08 -080033// rdar://18950072
34struct Butt { };
35
36__attribute__((objc_root_class))
37@interface Foo {
38 Butt x;
39 Butt y;
40 Butt z;
41}
42@end
43@implementation Foo
44@end
45// CHECK-NOT: define internal i8* @"\01-[Foo .cxx_construct