28 lines · plain
1// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s2@interface NSObject 3-(id)copy;4+(id)copy;5@end6 7@interface Sub1 : NSObject @end8 9@implementation Sub110-(id)copy { return [super copy]; } // ok: instance method in class11+(id)copy { return [super copy]; } // ok: class method in class12@end13 14@interface Sub2 : NSObject @end15 16@interface Sub2 (Category) @end17 18@implementation Sub2 (Category)19-(id)copy { return [super copy]; } // ok: instance method in category20+(id)copy { return [super copy]; } // BAD: class method in category21@end22 23// CHECK: define internal ptr @"\01+[Sub2(Category) copy]24// CHECK: [[ONE:%.*]] = load ptr, ptr @"OBJC_CLASSLIST_SUP_REFS_$_.3"25// CHECK: [[THREE:%.*]] = getelementptr inbounds nuw %struct._objc_super, ptr [[OBJC_SUPER:%.*]], i32 0, i32 126// CHECK: store ptr [[ONE]], ptr [[THREE]]27// CHECK: [[FOUR:%.*]] = load ptr, ptr @OBJC_SELECTOR_REFERENCES_28