blob: c03391f50aae046432e5f38757ceaa06c2c865c7 [file] [log] [blame]
Nick Lewycky3a410fe2013-10-11 03:35:10 +00001// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN
2// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -fno-function-sections -o - < %s | FileCheck %s --check-prefix=PLAIN
3
4// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
5// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-function-sections -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT
6
7// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
8// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fno-data-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT
9
10const int hello = 123;
11void world() {}
12
13// PLAIN-NOT: section
14// PLAIN: world:
15// PLAIN: section .rodata,
16// PLAIN: hello:
17
18// FUNC_SECT: section .text.world,
19// FUNC_SECT: world:
20// FUNC_SECT: section .rodata,
21// FUNC_SECT: hello:
22
23// DATA_SECT-NOT: section
24// DATA_SECT: world:
25// DATA_SECT: .section .rodata.hello,
26// DATA_SECT: hello: