1 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin10 -O0 -emit-llvm %s -o - | FileCheck %s
7 @interface SampleClass : MyNSObject {
14 @interface AppDelegate : MyNSObject
19 @implementation AppDelegate
22 // Create set of objects in loop
23 for(int i = 0; i < 2; i++) {
24 SampleClass *sample = [SampleClass new];
29 // CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8
30 // CHECK: [[THREE:%.*]] = bitcast [[ONE:%.*]]* [[CALL:%.*]] to i8*
31 // CHECK: [[ADDPTR:%.*]] = getelementptr inbounds i8, i8* [[THREE]], i64 [[IVAR]]
32 // CHECK: [[FOUR:%.*]] = bitcast i8* [[ADDPTR]] to i32*
33 // CHECK: [[FIVE:%.*]] = load i32, i32* [[FOUR]], align 4
34 // CHECK: call void @foo(i32 noundef [[FIVE]])
36 @implementation SampleClass
37 + (SampleClass*) new { return 0; }
38 - (void) SampleClassApplication
40 // Create set of objects in loop
41 for(int i = 0; i < 2; i++) {
42 SampleClass *sample = [SampleClass new];
47 // CHECK: [[ZERO:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load
48 // CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load
50 @interface Sample : SampleClass @end
52 @implementation Sample
53 - (void) SampleApplication
55 // Create set of objects in loop
56 for(int i = 0; i < 2; i++) {
57 SampleClass *sample = [SampleClass new];
62 // CHECK: [[ZERO:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load
63 // CHECK: [[IVAR:%.*]] = load i64, i64* @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load