blob: 6c243195f6266aa20ce1b8c401415288655c9835 [file] [log] [blame]
Stephen Hines651f13c2014-04-23 16:59:28 -07001// Test handling of -f(no-)function-sections and -f(no-)data-sections
2//
3// CHECK-FS: -ffunction-sections
4// CHECK-NOFS-NOT: -ffunction-sections
5// CHECK-DS: -fdata-sections
6// CHECK-NODS-NOT: -fdata-sections
Stephen Hines0e2c34f2015-03-23 12:09:02 -07007// CHECK-US-NOT: -fno-unique-section-names
8// CHECK-NOUS: -fno-unique-section-names
Stephen Hines651f13c2014-04-23 16:59:28 -07009
10// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
11// RUN: -target i386-unknown-linux \
12// RUN: | FileCheck --check-prefix=CHECK-NOFS --check-prefix=CHECK-NODS %s
13
14// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
15// RUN: -target i386-unknown-linux \
16// RUN: -ffunction-sections \
17// RUN: | FileCheck --check-prefix=CHECK-FS %s
18
19// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
20// RUN: -target i386-unknown-linux \
21// RUN: -fno-function-sections \
22// RUN: | FileCheck --check-prefix=CHECK-NOFS %s
23
24// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
25// RUN: -target i386-unknown-linux \
26// RUN: -ffunction-sections -fno-function-sections \
27// RUN: | FileCheck --check-prefix=CHECK-NOFS %s
28
29// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
30// RUN: -target i386-unknown-linux \
31// RUN: -fno-function-sections -ffunction-sections \
32// RUN: | FileCheck --check-prefix=CHECK-FS %s
33
34// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
35// RUN: -target i386-unknown-linux \
36// RUN: -ffunction-sections -fno-function-sections -ffunction-sections \
37// RUN: | FileCheck --check-prefix=CHECK-FS %s
38
39
40// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
41// RUN: -target i386-unknown-linux \
42// RUN: -fdata-sections \
43// RUN: | FileCheck --check-prefix=CHECK-DS %s
44
45// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
46// RUN: -target i386-unknown-linux \
47// RUN: -fno-data-sections \
48// RUN: | FileCheck --check-prefix=CHECK-NODS %s
49
50// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
51// RUN: -target i386-unknown-linux \
52// RUN: -fdata-sections -fno-data-sections \
53// RUN: | FileCheck --check-prefix=CHECK-NODS %s
54
55// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
56// RUN: -target i386-unknown-linux \
57// RUN: -fno-data-sections -fdata-sections \
58// RUN: | FileCheck --check-prefix=CHECK-DS %s
59
60// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
61// RUN: -target i386-unknown-linux \
62// RUN: -fdata-sections -fno-data-sections -fdata-sections \
63// RUN: | FileCheck --check-prefix=CHECK-DS %s
64
Stephen Hines0e2c34f2015-03-23 12:09:02 -070065
66// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
67// RUN: -target i386-unknown-linux \
68// RUN: -funique-section-names \
69// RUN: | FileCheck --check-prefix=CHECK-US %s
70
71// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
72// RUN: -target i386-unknown-linux \
73// RUN: -fno-unique-section-names \
74// RUN: | FileCheck --check-prefix=CHECK-NOUS %s
Pirama Arumuga Nainar33337ca2015-05-06 11:48:57 -070075
76// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
77// RUN: -target i386-unknown-linux \
78// RUN: -fno-integrated-as \
79// RUN: | FileCheck --check-prefix=CHECK-US %s
80
81// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
82// RUN: -target i386-unknown-linux \
83// RUN: -fintegrated-as \
84// RUN: | FileCheck --check-prefix=CHECK-NOUS %s