blob: 324740c8aefc412491e628b6eef3cd18ca52de56 [file] [log] [blame]
Daniel Dunbar58a29122009-03-09 22:18:41 +00001// 32-bit
2
3// RUNX: llvm-gcc -m32 -emit-llvm -S -o %t %s &&
John McCall260611a2012-06-20 06:18:46 +00004// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: grep '@"\\01L_OBJC_CATEGORY_A_Cat" = internal global .*, section "__OBJC,__category,regular,no_dead_strip", align 4' %t
6// RUN: grep '@"\\01L_OBJC_CLASS_A" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
7// RUN: grep '@"\\01L_OBJC_CLASS_C" = internal global .*, section "__OBJC,__class,regular,no_dead_strip", align 4' %t
8// RUN: grep '@"\\01L_OBJC_CLASS_PROTOCOLS_C" = internal global .*, section "__OBJC,__cat_cls_meth,regular,no_dead_strip", align 4' %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00009// RUN: grep '@"\\01L_OBJC_METACLASS_A" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
10// RUN: grep '@"\\01L_OBJC_METACLASS_C" = internal global .*, section "__OBJC,__meta_class,regular,no_dead_strip", align 4' %t
11// RUN: grep '@"\\01L_OBJC_MODULES" = internal global .*, section "__OBJC,__module_info,regular,no_dead_strip", align 4' %t
12// RUN: grep '@"\\01L_OBJC_PROTOCOL_P" = internal global .*, section "__OBJC,__protocol,regular,no_dead_strip", align 4' %t
Daniel Dunbar58a29122009-03-09 22:18:41 +000013
14// 64-bit
15
Daniel Dunbara5728872009-12-15 20:14:24 +000016// RUNX: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o %t %s &&
Daniel Dunbar58a29122009-03-09 22:18:41 +000017// RUNX: grep '@"OBJC_CLASS_$_A" = global' %t &&
18// RUNX: grep '@"OBJC_CLASS_$_C" = global' %t &&
19// RUNX: grep '@"OBJC_METACLASS_$_A" = global' %t &&
20// RUNX: grep '@"OBJC_METACLASS_$_C" = global' %t &&
21// RUNX: grep '@"\\01L_OBJC_CLASSLIST_REFERENCES_$_0" = internal global .*, section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8' %t &&
Daniel Dunbar58a29122009-03-09 22:18:41 +000022// RUNX: grep '@"\\01L_OBJC_LABEL_CATEGORY_$" = internal global .*, section "__DATA, __objc_catlist, regular, no_dead_strip", align 8' %t &&
23// RUNX: grep '@"\\01L_OBJC_LABEL_CLASS_$" = internal global .*, section "__DATA, __objc_classlist, regular, no_dead_strip", align 8' %t &&
24// RUNX: grep '@"\\01l_OBJC_$_CATEGORY_A_$_Cat" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
25// RUNX: grep '@"\\01l_OBJC_CLASS_PROTOCOLS_$_C" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
26// RUNX: grep '@"\\01l_OBJC_CLASS_RO_$_A" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
27// RUNX: grep '@"\\01l_OBJC_CLASS_RO_$_C" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
28// RUNX: grep '@"\\01l_OBJC_LABEL_PROTOCOL_$_P" = weak hidden global .*, section "__DATA, __objc_protolist, coalesced, no_dead_strip", align 8' %t &&
29// RUNX: grep '@"\\01l_OBJC_METACLASS_RO_$_A" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
30// RUNX: grep '@"\\01l_OBJC_METACLASS_RO_$_C" = internal global .*, section "__DATA, __objc_const", align 8' %t &&
31// RUNX: grep '@"\\01l_OBJC_PROTOCOL_$_P" = weak hidden global .*, section "__DATA,__datacoal_nt,coalesced", align 8' %t &&
32
Daniel Dunbar58a29122009-03-09 22:18:41 +000033
34@interface A @end
35@implementation A
36@end
37@implementation A (Cat)
38@end
39@protocol P
40@end
41@interface C <P>
42@end
43@implementation C
44@end