Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
      2 // rdar://16206443
      3 
      4 @interface NSObject 
      5 - (void) finalize;
      6 + (void) class;
      7 @end
      8 
      9 __attribute__((availability(macosx,introduced=9876.5)))
     10 @interface MyClass : NSObject
     11 + (void)someClassMethod;
     12 - (void)someInstanceMethod;
     13 @end
     14 
     15 @implementation MyClass
     16 + (void)someClassMethod {
     17 }
     18 
     19 - (void)someInstanceMethod {
     20     [MyClass someClassMethod];
     21     [super finalize];
     22 }
     23 @end
     24 
     25 void kit()
     26 {
     27     MyClass *wrapper = [MyClass alloc];
     28 }
     29 
     30 // CHECK: @"OBJC_CLASS_$_MyClass" = global %struct._class_t
     31 // CHECK: @"OBJC_METACLASS_$_NSObject" = external global %struct._class_t
     32 // CHECK: @"OBJC_METACLASS_$_MyClass" = global %struct._class_t
     33 // CHECK: @"OBJC_CLASS_$_NSObject" = external global %struct._class_t
     34 
     35 // rdar://16529125
     36 __attribute__((weak_import))
     37 @interface NSURLQueryItem : NSObject
     38 @end
     39 
     40 @implementation NSURLQueryItem (hax)
     41 +(void)classmethod { [super class]; }
     42 @end
     43 
     44 // CHECK: @"OBJC_METACLASS_$_NSURLQueryItem" = extern_weak global
     45 // CHECK: @"OBJC_CLASS_$_NSURLQueryItem" = extern_weak global
     46