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