1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -Wno-objc-root-class -fexceptions -fobjc-exceptions -o %t %s
2 // RUN: FileCheck -check-prefix=CHECK-X86_64 < %t %s
3 // RUN: FileCheck -check-prefix=CHECK-EHTYPE < %t %s
6 // We need exactly 3 of these.
7 // CHECK-EHTYPE: @"OBJC_EHTYPE_$_MySecretNamespace.EH3"
8 // CHECK-EHTYPE: @"OBJC_EHTYPE_$_MySecretNamespace.EH3"
9 // CHECK-EHTYPE: @"OBJC_EHTYPE_$_MySecretNamespace.EH3"
10 // CHECK-EHTYPE-NOT: @"OBJC_EHTYPE_$_MySecretNamespace.EH3"
12 // CHECK-X86_64: @"OBJC_CLASS_$_MySecretNamespace.A" ={{.*}} global {{.*}}, section "__DATA, __objc_data", align 8
13 // CHECK-X86_64: @"OBJC_METACLASS_$_MySecretNamespace.A" ={{.*}} global {{.*}}, section "__DATA, __objc_data", align 8
14 // CHECK-X86_64: @OBJC_CLASS_NAME_ = {{.*}}, section "__TEXT,__objc_classname,cstring_literals", align 1
15 // CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH1" = weak{{.*}} global {{.*}}, align 8
16 // CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH2" = external global
17 // CHECK-X86_64: @"OBJC_EHTYPE_$_MySecretNamespace.EH3" ={{.*}} global {{.*}}, section "__DATA,__objc_const", align 8
18 // CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
19 // CHECK-X86_64: define internal void @"\01-[A im0]"
20 // CHECK-X86_64: define internal void @"\01-[A(Cat) im1]"
22 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-objc-root-class -fobjc-exceptions -fvisibility hidden -emit-llvm -o %t %s
23 // RUN: FileCheck -check-prefix=CHECK-X86_64-HIDDEN < %t %s
25 // CHECK-X86_64-HIDDEN: @"OBJC_CLASS_$_MySecretNamespace.A" = hidden global {{.*}}, section "__DATA, __objc_data", align 8
26 // CHECK-X86_64-HIDDEN: @"OBJC_METACLASS_$_MySecretNamespace.A" = hidden global {{.*}}, section "__DATA, __objc_data", align 8
27 // CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_MySecretNamespace.EH1" = weak hidden global
28 // CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_MySecretNamespace.EH2" = external global
29 // CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_MySecretNamespace.EH3" = hidden global {{.*}}, section "__DATA,__objc_const", align 8
30 // CHECK-X86_64-HIDDEN: define internal void @"\01-[A im0]"
31 // CHECK-X86_64-HIDDEN: define internal void @"\01-[A(Cat) im1]"
33 // RUN: %clang_cc1 -triple armv6-apple-darwin10 -target-abi apcs-gnu -Wno-objc-root-class -fobjc-exceptions -emit-llvm -o %t %s
34 // RUN: FileCheck -check-prefix=CHECK-ARMV6 < %t %s
36 // CHECK-ARMV6: @"OBJC_CLASS_$_MySecretNamespace.A" ={{.*}} global {{.*}}, section "__DATA, __objc_data", align 4
37 // CHECK-ARMV6: @"OBJC_METACLASS_$_MySecretNamespace.A" ={{.*}} global {{.*}}, section "__DATA, __objc_data", align 4
38 // CHECK-ARMV6: @OBJC_CLASS_NAME_ = {{.*}}, section "__TEXT,__objc_classname,cstring_literals", align 1
39 // CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH1" = weak{{.*}} global {{.*}}, align 4
40 // CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH2" = external global
41 // CHECK-ARMV6: @"OBJC_EHTYPE_$_MySecretNamespace.EH3" ={{.*}} global {{.*}}, section "__DATA,__objc_const", align 4
42 // CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
43 // CHECK-ARMV6: define internal void @"\01-[A im0]"
44 // CHECK-ARMV6: define internal void @"\01-[A(Cat) im1]"
46 __attribute__((objc_runtime_name("MySecretNamespace.A")))
55 @implementation A (Cat)
60 __attribute__((objc_runtime_name("MySecretNamespace.EH1")))
64 __attribute__((objc_runtime_name("MySecretNamespace.EH2")))
65 __attribute__((__objc_exception__))
69 __attribute__((objc_runtime_name("MySecretNamespace.EH3")))
70 __attribute__((__objc_exception__))