[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Rewriter / objc-modern-class-init-hooks.mm
blobc294c79e2e0fc26396ba58874c20877ee8b1c889
1 // RUN: %clang_cc1 -E %s -o %t.mm
2 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s 
3 // rdar:// 11124354
5 @interface Root @end
7 @interface Super : Root
8 @end
10 @interface Sub : Super
11 @end
13 @implementation Sub @end
15 @implementation Root @end
17 @interface Root(Cat) @end
19 @interface Sub(Cat) @end
21 @implementation Root(Cat) @end
23 @implementation Sub(Cat) @end
26 // CHECK: #pragma section(".objc_inithooks$B", long, read, write)
27 // CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CLASS_SETUP[] = {
28 // CHECK:         (void *)&OBJC_CLASS_SETUP_$_Sub,
29 // CHECK:         (void *)&OBJC_CLASS_SETUP_$_Root,
30 // CHECK: };
32 // CHECK: #pragma section(".objc_inithooks$B", long, read, write)
33 // CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CATEGORY_SETUP[] = {
34 // CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Root_$_Cat,
35 // CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Sub_$_Cat,
36 // CHECK: };