2017-06-04 00:18:13 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -Wno-objc-root-class -fexceptions -fobjc-exceptions -o %t %s
|
2010-04-26 04:39:19 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-X86_64 < %t %s
|
2013-04-11 21:24:56 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-EHTYPE < %t %s
|
|
|
|
|
|
|
|
// We need exactly 3 of these.
|
|
|
|
// CHECK-EHTYPE: @"OBJC_EHTYPE_$_EH3"
|
|
|
|
// CHECK-EHTYPE: @"OBJC_EHTYPE_$_EH3"
|
|
|
|
// CHECK-EHTYPE: @"OBJC_EHTYPE_$_EH3"
|
|
|
|
// CHECK-EHTYPE-NOT: @"OBJC_EHTYPE_$_EH3"
|
2010-04-26 04:39:19 +08:00
|
|
|
|
|
|
|
// CHECK-X86_64: @"OBJC_CLASS_$_A" = global {{.*}}, section "__DATA, __objc_data", align 8
|
|
|
|
// CHECK-X86_64: @"OBJC_METACLASS_$_A" = global {{.*}}, section "__DATA, __objc_data", align 8
|
2014-11-06 21:30:38 +08:00
|
|
|
// CHECK-X86_64: @OBJC_CLASS_NAME_ = {{.*}}, section "__TEXT,__objc_classname,cstring_literals", align 1
|
2016-02-11 14:36:35 +08:00
|
|
|
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH1" = weak global {{.*}}, align 8
|
2010-04-26 04:39:19 +08:00
|
|
|
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH2" = external global
|
|
|
|
// CHECK-X86_64: @"OBJC_EHTYPE_$_EH3" = global {{.*}}, section "__DATA,__objc_const", align 8
|
2017-06-04 00:18:09 +08:00
|
|
|
// CHECK-X86_64: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 8
|
2010-04-26 04:39:19 +08:00
|
|
|
// CHECK-X86_64: define internal void @"\01-[A im0]"
|
|
|
|
// CHECK-X86_64: define internal void @"\01-[A(Cat) im1]"
|
|
|
|
|
2017-06-04 00:18:13 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-objc-root-class -fobjc-exceptions -fvisibility hidden -emit-llvm -o %t %s
|
2010-04-26 04:39:19 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-X86_64-HIDDEN < %t %s
|
|
|
|
|
|
|
|
// CHECK-X86_64-HIDDEN: @"OBJC_CLASS_$_A" = hidden global {{.*}}, section "__DATA, __objc_data", align 8
|
|
|
|
// CHECK-X86_64-HIDDEN: @"OBJC_METACLASS_$_A" = hidden global {{.*}}, section "__DATA, __objc_data", align 8
|
2016-02-16 08:46:03 +08:00
|
|
|
// CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_EH1" = weak hidden global
|
2010-04-26 04:39:19 +08:00
|
|
|
// CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_EH2" = external global
|
|
|
|
// CHECK-X86_64-HIDDEN: @"OBJC_EHTYPE_$_EH3" = hidden global {{.*}}, section "__DATA,__objc_const", align 8
|
|
|
|
// CHECK-X86_64-HIDDEN: define internal void @"\01-[A im0]"
|
|
|
|
// CHECK-X86_64-HIDDEN: define internal void @"\01-[A(Cat) im1]"
|
2009-04-07 13:48:37 +08:00
|
|
|
|
2017-06-04 00:18:13 +08:00
|
|
|
// RUN: %clang_cc1 -triple armv6-apple-darwin10 -target-abi apcs-gnu -Wno-objc-root-class -fobjc-exceptions -emit-llvm -o %t %s
|
2010-04-26 04:39:32 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ARMV6 < %t %s
|
|
|
|
|
|
|
|
// CHECK-ARMV6: @"OBJC_CLASS_$_A" = global {{.*}}, section "__DATA, __objc_data", align 4
|
|
|
|
// CHECK-ARMV6: @"OBJC_METACLASS_$_A" = global {{.*}}, section "__DATA, __objc_data", align 4
|
2014-11-06 21:30:38 +08:00
|
|
|
// CHECK-ARMV6: @OBJC_CLASS_NAME_ = {{.*}}, section "__TEXT,__objc_classname,cstring_literals", align 1
|
2016-02-11 14:36:35 +08:00
|
|
|
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH1" = weak global {{.*}}, align 4
|
2010-04-26 04:39:32 +08:00
|
|
|
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH2" = external global
|
|
|
|
// CHECK-ARMV6: @"OBJC_EHTYPE_$_EH3" = global {{.*}}, section "__DATA,__objc_const", align 4
|
2017-06-04 00:18:09 +08:00
|
|
|
// CHECK-ARMV6: @"OBJC_LABEL_CLASS_$" = private global {{.*}}, section "__DATA,__objc_classlist,regular,no_dead_strip", align 4
|
2010-06-17 01:49:52 +08:00
|
|
|
// CHECK-ARMV6: define internal void @"\01-[A im0]"
|
|
|
|
// CHECK-ARMV6: define internal void @"\01-[A(Cat) im1]"
|
2009-04-07 13:48:37 +08:00
|
|
|
|
|
|
|
@interface A
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
|
|
|
-(void) im0 {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A (Cat)
|
|
|
|
-(void) im1 {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2009-04-07 14:43:45 +08:00
|
|
|
@interface EH1
|
|
|
|
@end
|
|
|
|
|
|
|
|
__attribute__((__objc_exception__))
|
|
|
|
@interface EH2
|
2009-04-07 13:48:37 +08:00
|
|
|
@end
|
|
|
|
|
2009-04-08 12:21:03 +08:00
|
|
|
__attribute__((__objc_exception__))
|
|
|
|
@interface EH3
|
|
|
|
@end
|
|
|
|
|
2009-04-07 13:48:37 +08:00
|
|
|
void f1();
|
|
|
|
|
|
|
|
void f0(id x) {
|
|
|
|
@try {
|
|
|
|
f1();
|
2009-04-07 14:43:45 +08:00
|
|
|
} @catch (EH1 *x) {
|
|
|
|
} @catch (EH2 *x) {
|
2009-04-08 12:21:03 +08:00
|
|
|
} @catch (EH3 *x) {
|
2009-04-07 13:48:37 +08:00
|
|
|
}
|
|
|
|
}
|
2009-04-08 12:21:03 +08:00
|
|
|
|
|
|
|
@implementation EH3
|
|
|
|
@end
|