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