1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
2// RUN: %clang_cc1 -triple armv7-apple-darwin10 -emit-llvm  -o - %s | FileCheck %s
3// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s
4// rdar://16206443
5
6@interface NSObject
7- (void) finalize;
8+ (void) class;
9@end
10
11__attribute__((availability(macosx,introduced=9876.5)))
12@interface MyClass : NSObject
13+ (void)someClassMethod;
14- (void)someInstanceMethod;
15@end
16
17@implementation MyClass
18+ (void)someClassMethod {
19}
20
21- (void)someInstanceMethod {
22    [MyClass someClassMethod];
23    [super finalize];
24}
25@end
26
27void kit()
28{
29    MyClass *wrapper = [MyClass alloc];
30}
31
32// CHECK: @"OBJC_CLASS_$_MyClass" = global %struct._class_t
33// CHECK: @"OBJC_METACLASS_$_NSObject" = external global %struct._class_t
34// CHECK: @"OBJC_METACLASS_$_MyClass" = global %struct._class_t
35// CHECK: @"OBJC_CLASS_$_NSObject" = external global %struct._class_t
36
37// rdar://16529125
38__attribute__((weak_import))
39@interface NSURLQueryItem : NSObject
40@end
41
42@implementation NSURLQueryItem (hax)
43+(void)classmethod { [super class]; }
44@end
45
46// CHECK: @"OBJC_METACLASS_$_NSURLQueryItem" = extern_weak global
47// CHECK: @"OBJC_CLASS_$_NSURLQueryItem" = extern_weak global
48
49// rdar://17633301
50__attribute__((visibility("default"))) __attribute__((availability(ios,introduced=9876.5)))
51@interface AVScheduledAudioParameters @end
52
53@interface XXXX : AVScheduledAudioParameters
54@end
55
56@implementation AVScheduledAudioParameters @end
57@implementation XXXX @end
58
59// CHECK: @"OBJC_CLASS_$_AVScheduledAudioParameters" = global %struct._class_t
60// CHECK: @"OBJC_METACLASS_$_AVScheduledAudioParameters" = global %struct._class_t
61