xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/function-sections.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // REQUIRES: x86-registered-target
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -fno-function-sections -o - < %s | FileCheck %s --check-prefix=PLAIN
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-function-sections -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
8*0a6a1f1dSLionel Sambuc 
9*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
10*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-data-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc const int hello = 123;
world()13*0a6a1f1dSLionel Sambuc void world() {}
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc // PLAIN-NOT: section
16*0a6a1f1dSLionel Sambuc // PLAIN: world:
17*0a6a1f1dSLionel Sambuc // PLAIN: section .rodata,
18*0a6a1f1dSLionel Sambuc // PLAIN: hello:
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc // FUNC_SECT: section .text.world,
21*0a6a1f1dSLionel Sambuc // FUNC_SECT: world:
22*0a6a1f1dSLionel Sambuc // FUNC_SECT: section .rodata,
23*0a6a1f1dSLionel Sambuc // FUNC_SECT: hello:
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc // DATA_SECT-NOT: section
26*0a6a1f1dSLionel Sambuc // DATA_SECT: world:
27*0a6a1f1dSLionel Sambuc // DATA_SECT: .section .rodata.hello,
28*0a6a1f1dSLionel Sambuc // DATA_SECT: hello:
29