xref: /minix3/external/bsd/llvm/dist/clang/test/Rewriter/objc-modern-class-init-hooks.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -E %s -o %t.mm
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
3*f4a2713aSLionel Sambuc// rdar:// 11124354
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface Root @end
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface Super : Root
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@interface Sub : Super
11*f4a2713aSLionel Sambuc@end
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc@implementation Sub @end
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc@implementation Root @end
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc@interface Root(Cat) @end
18*f4a2713aSLionel Sambuc
19*f4a2713aSLionel Sambuc@interface Sub(Cat) @end
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc@implementation Root(Cat) @end
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc@implementation Sub(Cat) @end
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc
26*f4a2713aSLionel Sambuc// CHECK: #pragma section(".objc_inithooks$B", long, read, write)
27*f4a2713aSLionel Sambuc// CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CLASS_SETUP[] = {
28*f4a2713aSLionel Sambuc// CHECK:         (void *)&OBJC_CLASS_SETUP_$_Sub,
29*f4a2713aSLionel Sambuc// CHECK:         (void *)&OBJC_CLASS_SETUP_$_Root,
30*f4a2713aSLionel Sambuc// CHECK: };
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc// CHECK: #pragma section(".objc_inithooks$B", long, read, write)
33*f4a2713aSLionel Sambuc// CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CATEGORY_SETUP[] = {
34*f4a2713aSLionel Sambuc// CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Root_$_Cat,
35*f4a2713aSLionel Sambuc// CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Sub_$_Cat,
36*f4a2713aSLionel Sambuc// CHECK: };
37