xref: /llvm-project/clang/test/CodeGenCXX/apple-kext-no-staticinit-section.cpp (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fapple-kext -fno-rtti -disable-O0-optnone -emit-llvm -o - %s | FileCheck %s
2 /**
3 1) Normally, global object construction code ends up in __StaticInit segment of text section
4    .section __TEXT,__StaticInit,regular,pure_instructions
5    In kext mode, they end up in the __text segment.
6 */
7 
8 class foo {
9 public:
10   foo();
11   virtual ~foo();
12 };
13 
14 foo a;
15 foo b;
16 foo c;
~foo()17 foo::~foo() {}
18 
19 // CHECK-NOT: __TEXT,__StaticInit,regular,pure_instructions
20