1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O0 -emit-llvm %s -o - | FileCheck %s
6 @interface SampleClass : MyNSObject {
13 @interface AppDelegate : MyNSObject
18 @implementation AppDelegate
21 // Create set of objects in loop
22 for(int i = 0; i < 2; i++) {
23 SampleClass *sample = [SampleClass new];
28 // CHECK: [[IVAR:%.*]] = load i64, ptr @"OBJC_IVAR_$_SampleClass._value", align 8
29 // CHECK: [[ADDPTR:%.*]] = getelementptr inbounds i8, ptr [[CALL:%.*]], i64 [[IVAR]]
30 // CHECK: [[FIVE:%.*]] = load i32, ptr [[ADDPTR]], align 4
31 // CHECK: call void @foo(i32 noundef [[FIVE]])
33 @implementation SampleClass
34 + (SampleClass*) new { return 0; }
35 - (void) SampleClassApplication
37 // Create set of objects in loop
38 for(int i = 0; i < 2; i++) {
39 SampleClass *sample = [SampleClass new];
44 // CHECK: [[ZERO:%.*]] = load ptr, ptr @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load
45 // CHECK: [[IVAR:%.*]] = load i64, ptr @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load
47 @interface Sample : SampleClass @end
49 @implementation Sample
50 - (void) SampleApplication
52 // Create set of objects in loop
53 for(int i = 0; i < 2; i++) {
54 SampleClass *sample = [SampleClass new];
59 // CHECK: [[ZERO:%.*]] = load ptr, ptr @OBJC_SELECTOR_REFERENCES_, align 8, !invariant.load
60 // CHECK: [[IVAR:%.*]] = load i64, ptr @"OBJC_IVAR_$_SampleClass._value", align 8, !invariant.load