Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Rewriter / objc-modern-class-init-hooks.mm
blob0e19268b7f0b4852f3a7a0bdc82947063a2c510d
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 
4 @interface Root @end
6 @interface Super : Root
7 @end
9 @interface Sub : Super
10 @end
12 @implementation Sub @end
14 @implementation Root @end
16 @interface Root(Cat) @end
18 @interface Sub(Cat) @end
20 @implementation Root(Cat) @end
22 @implementation Sub(Cat) @end
25 // CHECK: #pragma section(".objc_inithooks$B", long, read, write)
26 // CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CLASS_SETUP[] = {
27 // CHECK:         (void *)&OBJC_CLASS_SETUP_$_Sub,
28 // CHECK:         (void *)&OBJC_CLASS_SETUP_$_Root,
29 // CHECK: };
31 // CHECK: #pragma section(".objc_inithooks$B", long, read, write)
32 // CHECK: __declspec(allocate(".objc_inithooks$B")) static void *OBJC_CATEGORY_SETUP[] = {
33 // CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Root_$_Cat,
34 // CHECK:         (void *)&OBJC_CATEGORY_SETUP_$_Sub_$_Cat,
35 // CHECK: };