blob: 98198f51d11ad88077feeb92e804b930aff7477c [file] [log] [blame]
NAKAMURA Takumi051b40c2014-02-25 00:30:04 +00001// REQUIRES: clang-driver
2
Eric Christopher006208c2013-04-04 06:29:47 +00003// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
Argyrios Kyrtzidis74825bc2010-10-08 00:25:19 +00004// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
Ted Kremenekeadc7c32009-12-12 00:38:18 +00005
Eric Christopher006208c2013-04-04 06:29:47 +00006// CHECK-OPTIONS1: -split-stacks
Chandler Carruthe0391482010-05-22 02:21:53 +00007// CHECK-OPTIONS1: -fgnu-keywords
Ted Kremeneke1996c22009-12-12 00:42:52 +00008// CHECK-OPTIONS1: -fblocks
9// CHECK-OPTIONS1: -fpascal-strings
10
Dan Gohmand1e76b92010-01-08 02:20:44 +000011// CHECK-OPTIONS2: -fmath-errno
Nico Riecke6a158252014-02-16 07:29:41 +000012// CHECK-OPTIONS2: -fno-gnu-keywords
Daniel Dunbar18a72952009-12-13 02:00:23 +000013// CHECK-OPTIONS2: -fno-builtin
Argyrios Kyrtzidis74825bc2010-10-08 00:25:19 +000014// CHECK-OPTIONS2: -fshort-enums
Daniel Dunbar18a72952009-12-13 02:00:23 +000015// CHECK-OPTIONS2: -fshort-wchar
16// CHECK-OPTIONS2: -fno-common
Ted Kremeneke1996c22009-12-12 00:42:52 +000017// CHECK-OPTIONS2: -fno-show-source-location
Chandler Carruthb009b142011-04-23 06:30:43 +000018
19// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s
20// WRITE-STRINGS1: -fconst-strings
21// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s
22// WRITE-STRINGS2-NOT: -fconst-strings
Argyrios Kyrtzidis25f2afde2014-02-07 08:33:28 +000023// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s
24// WRITE-STRINGS3-NOT: -fconst-strings
Chandler Carruth61fbf622011-04-23 09:27:53 +000025
Chandler Carruth30483fb2011-04-23 19:48:40 +000026// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
27// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
28// RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
29// RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
30// RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s
31// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
32// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s
33// DEPRECATED-ON-CHECK: -fdeprecated-macro
34// DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro
Lang Hamesaa53b932012-07-06 00:59:19 +000035
36// RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
37// RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s
38// RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s
39// FP-CONTRACT-FAST-CHECK: -ffp-contract=fast
40// FP-CONTRACT-OFF-CHECK: -ffp-contract=off
Chad Rosiered943242012-07-20 21:20:33 +000041
Chandler Carruth54c29102013-08-08 08:34:35 +000042// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
43// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
44// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s
45// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s
46// CHECK-UNROLL-LOOPS: "-funroll-loops"
47// CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops"
48
Hal Finkelce0697f2013-11-17 16:03:29 +000049// RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
50// RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
51// RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s
52// RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s
53// CHECK-REROLL-LOOPS: "-freroll-loops"
54// CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops"
55
Diego Novillo5c297052013-11-13 12:22:39 +000056// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
57// CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
58
Diego Novillo67fe87fc52013-12-06 17:58:19 +000059// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
60// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
61
Justin Bogner4d10c232014-08-07 03:58:32 +000062// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
63// RUN: %clang -### -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s
64// RUN: %clang -### -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
65// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s
66// CHECK-PROFILE-ARCS: "-femit-coverage-data"
67// CHECK-NO-PROFILE-ARCS-NOT: "-femit-coverage-data"
68
Diego Novillo578caf52015-07-09 17:23:53 +000069// RUN: %clang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
70// RUN: %clang -### -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s
71// RUN: %clang -### -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s
72// RUN: %clang -### -S -fprofile-instr-generate=/tmp/somefile.profraw %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s
73// RUN: %clang -### -S -fprofile-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
74// RUN: %clang -### -S -fprofile-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
75// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
76// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
77// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
78// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
79// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
80// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
81// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
82// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
83// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
84// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
85// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
86// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
87// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
88// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s
Diego Novillo758f3f52015-08-05 21:49:51 +000089// RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
90// RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
91// RUN: %clang -### -S -fprofile-generate=dir -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
92// RUN: %clang -### -S -fprofile-generate=dir -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s
93// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
94// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
95// RUN: %clang -### -S -fprofile-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
96// RUN: %clang -### -S -fprofile-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s
Diego Novilloc4b94da2015-08-05 23:27:40 +000097// RUN: %clang -### -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s
98// RUN: %clang -### -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s
99// RUN: %clang -### -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s
Diego Novillo578caf52015-07-09 17:23:53 +0000100// CHECK-PROFILE-GENERATE: "-fprofile-instr-generate"
NAKAMURA Takumiddb44b82015-07-10 13:11:08 +0000101// CHECK-PROFILE-GENERATE-DIR: "-fprofile-instr-generate=/some/dir{{/|\\\\}}default.profraw"
Diego Novillo578caf52015-07-09 17:23:53 +0000102// CHECK-PROFILE-GENERATE-FILE: "-fprofile-instr-generate=/tmp/somefile.profraw"
103// CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}'
Diego Novillo758f3f52015-08-05 21:49:51 +0000104// CHECK-DISABLE-GEN-NOT: "-fprofile-instr-generate"
105// CHECK-DISABLE-USE-NOT: "-fprofile-instr-use"
Diego Novilloc4b94da2015-08-05 23:27:40 +0000106// CHECK-COVERAGE-AND-GEN: '-fcoverage-mapping' only allowed with '-fprofile-instr-generate'
107// CHECK-DISABLE-COVERAGE-NOT: "-fcoverage-mapping"
Diego Novillo578caf52015-07-09 17:23:53 +0000108
109// RUN: %clang -### -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
110// RUN: %clang -### -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s
111// RUN: mkdir -p %t.d/some/dir
112// RUN: %clang -### -S -fprofile-use=%t.d/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s
113// RUN: %clang -### -S -fprofile-instr-use=/tmp/somefile.prof %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s
114// CHECK-PROFILE-USE: "-fprofile-instr-use=default.profdata"
NAKAMURA Takumiddb44b82015-07-10 13:11:08 +0000115// CHECK-PROFILE-USE-DIR: "-fprofile-instr-use={{.*}}.d/some/dir{{/|\\\\}}default.profdata"
Diego Novillo578caf52015-07-09 17:23:53 +0000116// CHECK-PROFILE-USE-FILE: "-fprofile-instr-use=/tmp/somefile.prof"
117
Chad Rosier0d3ed6f2012-12-11 17:12:28 +0000118// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
119// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
120// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
121// RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
Chad Rosier30797b22012-12-11 17:46:33 +0000122// RUN: %clang -### -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
Nadav Rotemb2b8d5b2012-12-18 23:08:58 +0000123// RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
124// RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
Chad Rosier30797b22012-12-11 17:46:33 +0000125// RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
Arnold Schwaighofer7f994ce2013-08-13 15:46:23 +0000126// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
127// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
128// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
129// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
Arnold Schwaighofer7f994ce2013-08-13 15:46:23 +0000130// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
131// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
132// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s
133// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
134// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
135// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
136// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s
Chad Rosier0d3ed6f2012-12-11 17:12:28 +0000137// CHECK-VECTORIZE: "-vectorize-loops"
Chad Rosier0d3ed6f2012-12-11 17:12:28 +0000138// CHECK-NO-VECTORIZE-NOT: "-vectorize-loops"
Hal Finkel061f1652012-12-11 19:59:32 +0000139
140// RUN: %clang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
141// RUN: %clang -### -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
142// RUN: %clang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
143// RUN: %clang -### -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
144// RUN: %clang -### -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
Nadav Rotemb2b8d5b2012-12-18 23:08:58 +0000145// RUN: %clang -### -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
146// RUN: %clang -### -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
Hal Finkel061f1652012-12-11 19:59:32 +0000147// RUN: %clang -### -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
Chad Rosier136d67d2014-04-28 19:30:57 +0000148// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
149// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
150// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
Chad Rosier3ba81bd2014-05-02 18:41:57 +0000151// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
Chad Rosier136d67d2014-04-28 19:30:57 +0000152// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
153// RUN: %clang -### -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
154// RUN: %clang -### -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
155// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s
156// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
157// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
158// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s
Nadav Rotem0a2604d2013-04-15 04:57:18 +0000159// CHECK-SLP-VECTORIZE: "-vectorize-slp"
160// CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp"
Jordan Rosedd770412013-02-06 18:15:40 +0000161
Nadav Rotem6a0dd6b2013-04-15 05:38:41 +0000162// RUN: %clang -### -S -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s
163// RUN: %clang -### -S -fno-slp-vectorize-aggressive -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s
164// RUN: %clang -### -S -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s
165// RUN: %clang -### -S -fslp-vectorize-aggressive -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s
166// CHECK-SLP-VECTORIZE-AGG: "-vectorize-slp-aggressive"
167// CHECK-NO-SLP-VECTORIZE-AGG-NOT: "-vectorize-slp-aggressive"
168
Jordan Rosedd770412013-02-06 18:15:40 +0000169// RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s
170// RUN: %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s
171// CHECK-EXTENDED-IDENTIFIERS: "-cc1"
172// CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
173// CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
Hans Wennborg28c96312013-07-31 23:39:13 +0000174
175// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s
176// CHECK-M-PASCAL-STRINGS: "-fpascal-strings"
177
178// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s
179// CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings"
Rafael Espindola493f0452013-08-23 21:49:00 +0000180
181// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s
Rafael Espindolaad70d962013-08-27 16:58:15 +0000182// CHECK-MAX-O: warning: -O4 is equivalent to -O3
Rafael Espindola493f0452013-08-23 21:49:00 +0000183// CHECK-MAX-O: -O3
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000184
Hans Wennborgbe5df462013-11-18 21:58:33 +0000185// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s
Alp Tokercd3acb52014-07-14 19:16:22 +0000186// CHECK-INVALID-O: warning: optimization level '-O20' is not supported; using '-O3' instead
Sylvestre Ledru5abf2ec2013-11-18 13:23:07 +0000187
Sylvestre Ledru91f380a2014-07-01 17:24:27 +0000188// RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s
189// CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'
190
Sylvestre Ledrub8198f0222014-08-11 18:09:03 +0000191// RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s
192// CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1'
193
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000194// Test that we don't error on these.
Rafael Espindola64437be2013-09-26 16:45:27 +0000195// RUN: %clang -### -S -Werror \
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000196// RUN: -falign-functions -falign-functions=2 -fno-align-functions \
197// RUN: -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables \
198// RUN: -fbuiltin -fno-builtin \
Chandler Carruth685dca52013-10-24 09:17:35 +0000199// RUN: -fdiagnostics-show-location=once \
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000200// RUN: -ffloat-store -fno-float-store \
201// RUN: -feliminate-unused-debug-types -fno-eliminate-unused-debug-types \
202// RUN: -fgcse -fno-gcse \
203// RUN: -fident -fno-ident \
Chandler Carruth5998ee62013-10-24 09:21:37 +0000204// RUN: -fimplicit-templates -fno-implicit-templates \
Sylvestre Ledru91f380a2014-07-01 17:24:27 +0000205// RUN: -finput-charset=UTF-8 \
Sylvestre Ledrub8198f0222014-08-11 18:09:03 +0000206// RUN: -fexec-charset=UTF-8 \
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000207// RUN: -fivopts -fno-ivopts \
208// RUN: -fnon-call-exceptions -fno-non-call-exceptions \
209// RUN: -fpermissive -fno-permissive \
Sylvestre Ledru0ccfb3a2014-07-04 08:59:41 +0000210// RUN: -fdefer-pop -fno-defer-pop \
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000211// RUN: -fprefetch-loop-arrays -fno-prefetch-loop-arrays \
212// RUN: -fprofile-correction -fno-profile-correction \
213// RUN: -fprofile-dir=bar \
Rafael Espindolafa74eee2013-09-26 13:10:14 +0000214// RUN: -fprofile-values -fno-profile-values \
215// RUN: -frounding-math -fno-rounding-math \
216// RUN: -fsee -fno-see \
217// RUN: -ftracer -fno-tracer \
218// RUN: -funroll-all-loops -fno-unroll-all-loops \
Nico Weberbc5ae6d2013-10-03 19:45:55 +0000219// RUN: -fuse-ld=gold \
Rafael Espindola07bed132013-09-26 16:15:40 +0000220// RUN: -fno-builtin-foobar \
Rafael Espindola64437be2013-09-26 16:45:27 +0000221// RUN: -fno-builtin-strcat -fno-builtin-strcpy \
Jordan Rose3d083402013-09-26 17:03:34 +0000222// RUN: -fno-var-tracking \
Nick Lewyckyacfcd0d2013-09-27 05:06:31 +0000223// RUN: -fno-unsigned-char \
224// RUN: -fno-signed-char \
Rafael Espindola2a1c07a2013-10-21 18:49:56 +0000225// RUN: -fstrength-reduce -fno-strength-reduce \
Sylvestre Ledru2fe501e2014-07-11 11:43:57 +0000226// RUN: -finline-limit=1000 \
227// RUN: -finline-limit \
Arthur Marble731f6d32014-08-05 18:13:48 +0000228// RUN: -flto=1 \
229// RUN: -falign-labels \
230// RUN: -falign-labels=100 \
231// RUN: -falign-loops \
232// RUN: -falign-loops=100 \
233// RUN: -falign-jumps \
234// RUN: -falign-jumps=100 \
235// RUN: -fexcess-precision=100 \
Rui Ueyamacfea1602014-08-05 23:43:21 +0000236// RUN: -fbranch-count-reg \
Arthur Marble731f6d32014-08-05 18:13:48 +0000237// RUN: -fcaller-saves \
238// RUN: -fno-default-inline -fdefault-inline \
239// RUN: -fgcse-after-reload \
240// RUN: -fgcse-las \
241// RUN: -fgcse-sm \
242// RUN: -fipa-cp \
243// RUN: -finline-functions-called-once \
244// RUN: -fmodulo-sched \
245// RUN: -fmodulo-sched-allow-regmoves \
246// RUN: -fpeel-loops \
247// RUN: -frename-registers \
248// RUN: -fschedule-insns2 \
249// RUN: -fsingle-precision-constant \
250// RUN: -ftree_loop_im \
251// RUN: -ftree_loop_ivcanon \
252// RUN: -ftree_loop_linear \
253// RUN: -funsafe-loop-optimizations \
254// RUN: -fuse-linker-plugin \
255// RUN: -fvect-cost-model \
256// RUN: -fvariable-expansion-in-unroller \
257// RUN: -fweb \
258// RUN: -fwhole-program \
259// RUN: -fno-tree-dce -ftree-dce \
260// RUN: -fno-tree-ter -ftree-ter \
261// RUN: -fno-tree-vrp -ftree-vrp \
262// RUN: -fno-delete-null-pointer-checks -fdelete-null-pointer-checks \
263// RUN: -fno-inline-small-functions -finline-small-functions \
264// RUN: -fno-fat-lto-objects -ffat-lto-objects \
265// RUN: -fno-merge-constants -fmerge-constants \
266// RUN: -fno-caller-saves -fcaller-saves \
267// RUN: -fno-reorder-blocks -freorder-blocks \
268// RUN: -fno-schedule-insns2 -fschedule-insns2 \
Arthur Marble05b07982014-08-05 18:21:20 +0000269// RUN: -fno-stack-check \
270// RUN: -fno-check-new -fcheck-new \
271// RUN: -ffriend-injection \
272// RUN: -fno-implement-inlines -fimplement-inlines \
273// RUN: -fstack-check \
Rui Ueyamacfea1602014-08-05 23:43:21 +0000274// RUN: -fforce-addr \
Arthur Marble05b07982014-08-05 18:21:20 +0000275// RUN: -malign-functions=100 \
276// RUN: -malign-loops=100 \
277// RUN: -malign-jumps=100 \
Rafael Espindola945f7e22013-10-03 19:34:34 +0000278// RUN: %s 2>&1 | FileCheck --check-prefix=IGNORE %s
279// IGNORE-NOT: error: unknown argument
Richard Bartonc9b5f352014-02-24 18:43:28 +0000280
Sylvestre Ledru2fe501e2014-07-11 11:43:57 +0000281// Test that the warning is displayed on these.
Arthur Marblec0d06032014-07-18 11:38:58 +0000282// RUN: %clang -### \
283// RUN: -finline-limit=1000 \
284// RUN: -finline-limit \
285// RUN: -fexpensive-optimizations \
286// RUN: -fno-expensive-optimizations \
287// RUN: -fno-defer-pop \
288// RUN: -finline-functions \
Justin Bognerce46adb2014-08-27 05:12:35 +0000289// RUN: -fkeep-inline-functions \
Arthur Marblec0d06032014-07-18 11:38:58 +0000290// RUN: -fno-keep-inline-functions \
291// RUN: -freorder-blocks \
292// RUN: -fprofile-dir=/rand/dir \
Arthur Marblec0d06032014-07-18 11:38:58 +0000293// RUN: -falign-functions \
294// RUN: -falign-functions=1 \
295// RUN: -ffloat-store \
296// RUN: -fgcse \
297// RUN: -fivopts \
298// RUN: -fprefetch-loop-arrays \
299// RUN: -fprofile-correction \
300// RUN: -fprofile-values \
301// RUN: -frounding-math \
302// RUN: -fschedule-insns \
303// RUN: -fsignaling-nans \
304// RUN: -fstrength-reduce \
305// RUN: -ftracer \
306// RUN: -funroll-all-loops \
307// RUN: -funswitch-loops \
Arthur Marble731f6d32014-08-05 18:13:48 +0000308// RUN: -flto=1 \
309// RUN: -falign-labels \
310// RUN: -falign-labels=100 \
311// RUN: -falign-loops \
312// RUN: -falign-loops=100 \
313// RUN: -falign-jumps \
314// RUN: -falign-jumps=100 \
315// RUN: -fexcess-precision=100 \
Rui Ueyamacfea1602014-08-05 23:43:21 +0000316// RUN: -fbranch-count-reg \
Arthur Marble731f6d32014-08-05 18:13:48 +0000317// RUN: -fcaller-saves \
318// RUN: -fno-default-inline \
319// RUN: -fgcse-after-reload \
320// RUN: -fgcse-las \
321// RUN: -fgcse-sm \
322// RUN: -fipa-cp \
323// RUN: -finline-functions-called-once \
324// RUN: -fmodulo-sched \
325// RUN: -fmodulo-sched-allow-regmoves \
326// RUN: -fpeel-loops \
327// RUN: -frename-registers \
328// RUN: -fschedule-insns2 \
329// RUN: -fsingle-precision-constant \
330// RUN: -ftree_loop_im \
331// RUN: -ftree_loop_ivcanon \
332// RUN: -ftree_loop_linear \
333// RUN: -funsafe-loop-optimizations \
334// RUN: -fuse-linker-plugin \
335// RUN: -fvect-cost-model \
336// RUN: -fvariable-expansion-in-unroller \
337// RUN: -fweb \
338// RUN: -fwhole-program \
339// RUN: -fcaller-saves \
340// RUN: -freorder-blocks \
341// RUN: -fdelete-null-pointer-checks \
342// RUN: -ffat-lto-objects \
343// RUN: -fmerge-constants \
344// RUN: -finline-small-functions \
345// RUN: -ftree-dce \
346// RUN: -ftree-ter \
347// RUN: -ftree-vrp \
Reid Kleckner64ecbe22014-08-26 19:57:01 +0000348// RUN: -fno-devirtualize \
349// RUN: -fno-devirtualize-speculatively \
Arthur Marblec0d06032014-07-18 11:38:58 +0000350// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
351// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
352// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
353// CHECK-WARNING-DAG: optimization flag '-fexpensive-optimizations' is not supported
354// CHECK-WARNING-DAG: optimization flag '-fno-expensive-optimizations' is not supported
355// CHECK-WARNING-DAG: optimization flag '-fno-defer-pop' is not supported
356// CHECK-WARNING-DAG: optimization flag '-finline-functions' is not supported
Justin Bognerce46adb2014-08-27 05:12:35 +0000357// CHECK-WARNING-DAG: optimization flag '-fkeep-inline-functions' is not supported
Arthur Marblec0d06032014-07-18 11:38:58 +0000358// CHECK-WARNING-DAG: optimization flag '-fno-keep-inline-functions' is not supported
359// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
360// CHECK-WARNING-DAG: optimization flag '-fprofile-dir=/rand/dir' is not supported
Arthur Marblec0d06032014-07-18 11:38:58 +0000361// CHECK-WARNING-DAG: optimization flag '-falign-functions' is not supported
362// CHECK-WARNING-DAG: optimization flag '-falign-functions=1' is not supported
363// CHECK-WARNING-DAG: optimization flag '-ffloat-store' is not supported
364// CHECK-WARNING-DAG: optimization flag '-fgcse' is not supported
365// CHECK-WARNING-DAG: optimization flag '-fivopts' is not supported
366// CHECK-WARNING-DAG: optimization flag '-fprefetch-loop-arrays' is not supported
367// CHECK-WARNING-DAG: optimization flag '-fprofile-correction' is not supported
368// CHECK-WARNING-DAG: optimization flag '-fprofile-values' is not supported
369// CHECK-WARNING-DAG: optimization flag '-frounding-math' is not supported
370// CHECK-WARNING-DAG: optimization flag '-fschedule-insns' is not supported
371// CHECK-WARNING-DAG: optimization flag '-fsignaling-nans' is not supported
372// CHECK-WARNING-DAG: optimization flag '-fstrength-reduce' is not supported
373// CHECK-WARNING-DAG: optimization flag '-ftracer' is not supported
374// CHECK-WARNING-DAG: optimization flag '-funroll-all-loops' is not supported
375// CHECK-WARNING-DAG: optimization flag '-funswitch-loops' is not supported
Arthur Marble731f6d32014-08-05 18:13:48 +0000376// CHECK-WARNING-DAG: optimization flag '-flto=1' is not supported
377// CHECK-WARNING-DAG: optimization flag '-falign-labels' is not supported
378// CHECK-WARNING-DAG: optimization flag '-falign-labels=100' is not supported
379// CHECK-WARNING-DAG: optimization flag '-falign-loops' is not supported
380// CHECK-WARNING-DAG: optimization flag '-falign-loops=100' is not supported
381// CHECK-WARNING-DAG: optimization flag '-falign-jumps' is not supported
382// CHECK-WARNING-DAG: optimization flag '-falign-jumps=100' is not supported
383// CHECK-WARNING-DAG: optimization flag '-fexcess-precision=100' is not supported
384// CHECK-WARNING-DAG: optimization flag '-fbranch-count-reg' is not supported
385// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
386// CHECK-WARNING-DAG: optimization flag '-fno-default-inline' is not supported
387// CHECK-WARNING-DAG: optimization flag '-fgcse-after-reload' is not supported
388// CHECK-WARNING-DAG: optimization flag '-fgcse-las' is not supported
389// CHECK-WARNING-DAG: optimization flag '-fgcse-sm' is not supported
390// CHECK-WARNING-DAG: optimization flag '-fipa-cp' is not supported
391// CHECK-WARNING-DAG: optimization flag '-finline-functions-called-once' is not supported
392// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched' is not supported
393// CHECK-WARNING-DAG: optimization flag '-fmodulo-sched-allow-regmoves' is not supported
394// CHECK-WARNING-DAG: optimization flag '-fpeel-loops' is not supported
395// CHECK-WARNING-DAG: optimization flag '-frename-registers' is not supported
396// CHECK-WARNING-DAG: optimization flag '-fschedule-insns2' is not supported
397// CHECK-WARNING-DAG: optimization flag '-fsingle-precision-constant' is not supported
398// CHECK-WARNING-DAG: optimization flag '-ftree_loop_im' is not supported
399// CHECK-WARNING-DAG: optimization flag '-ftree_loop_ivcanon' is not supported
400// CHECK-WARNING-DAG: optimization flag '-ftree_loop_linear' is not supported
401// CHECK-WARNING-DAG: optimization flag '-funsafe-loop-optimizations' is not supported
402// CHECK-WARNING-DAG: optimization flag '-fuse-linker-plugin' is not supported
403// CHECK-WARNING-DAG: optimization flag '-fvect-cost-model' is not supported
404// CHECK-WARNING-DAG: optimization flag '-fvariable-expansion-in-unroller' is not supported
405// CHECK-WARNING-DAG: optimization flag '-fweb' is not supported
406// CHECK-WARNING-DAG: optimization flag '-fwhole-program' is not supported
407// CHECK-WARNING-DAG: optimization flag '-fcaller-saves' is not supported
408// CHECK-WARNING-DAG: optimization flag '-freorder-blocks' is not supported
409// CHECK-WARNING-DAG: optimization flag '-fdelete-null-pointer-checks' is not supported
410// CHECK-WARNING-DAG: optimization flag '-ffat-lto-objects' is not supported
411// CHECK-WARNING-DAG: optimization flag '-fmerge-constants' is not supported
412// CHECK-WARNING-DAG: optimization flag '-finline-small-functions' is not supported
413// CHECK-WARNING-DAG: optimization flag '-ftree-dce' is not supported
414// CHECK-WARNING-DAG: optimization flag '-ftree-ter' is not supported
415// CHECK-WARNING-DAG: optimization flag '-ftree-vrp' is not supported
Reid Kleckner64ecbe22014-08-26 19:57:01 +0000416// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize' is not supported
417// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
Sylvestre Ledru2fe501e2014-07-11 11:43:57 +0000418
Sylvestre Ledru79e3da92014-07-11 17:23:13 +0000419// Test that we mute the warning on these
Alp Toker86f69342014-07-14 18:11:38 +0000420// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \
Sylvestre Ledru79e3da92014-07-11 17:23:13 +0000421// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s
Alp Toker86f69342014-07-14 18:11:38 +0000422// RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument \
Sylvestre Ledru79e3da92014-07-11 17:23:13 +0000423// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
Reid Kleckner491e1ac2014-07-23 23:29:01 +0000424// RUN: %clang -### -finline-limit \
425// RUN: -Winvalid-command-line-argument -Wno-ignored-optimization-argument \
426// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
Alp Toker86f69342014-07-14 18:11:38 +0000427// CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported
428// CHECK-NO-WARNING2-NOT: optimization flag '-finline-limit' is not supported
Sylvestre Ledru79e3da92014-07-11 17:23:13 +0000429
Douglas Katzman8b50e012015-08-05 18:03:47 +0000430// Test that an ignored optimization argument only prints 1 warning,
431// not both a warning about not claiming the arg, *and* about not supporting
432// the arg; and that adding -Wno-ignored-optimization silences the warning.
433//
434// RUN: %clang -### -fprofile-correction %s 2>&1 \
435// RUN: | FileCheck --check-prefix=CHECK-NO-WARNING3 %s
436// CHECK-NO-WARNING3: optimization flag '-fprofile-correction' is not supported
437// CHECK-NO-WARNING3-NOT: argument unused
438// RUN: %clang -### -fprofile-correction -Wno-ignored-optimization-argument %s 2>&1 \
439// RUN: | FileCheck --check-prefix=CHECK-NO-WARNING4 %s
440// CHECK-NO-WARNING4-NOT: not supported
441// CHECK-NO-WARNING4-NOT: argument unused
442
David Majnemerc3658d22015-05-23 18:48:37 +0000443// RUN: %clang -### -S -fsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN1 %s
444// CHAR-SIGN1-NOT: -fno-signed-char
445
446// RUN: %clang -### -S -funsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN2 %s
447// CHAR-SIGN2: -fno-signed-char
448
449// RUN: %clang -### -S -fno-signed-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN3 %s
450// CHAR-SIGN3: -fno-signed-char
451
452// RUN: %clang -### -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s
453// CHAR-SIGN4-NOT: -fno-signed-char
Sylvestre Ledru79e3da92014-07-11 17:23:13 +0000454
Filipe Cabecinhasd0c64682015-02-12 03:37:55 +0000455// RUN: %clang -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s
456// RUN: %clang -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s
457// Make sure we don't match the -NOT lines with the linker invocation.
458// Delimiters match the start of the cc1 and the start of the linker lines
459// DELIMITERS: {{^ *"}}
Richard Bartonc9b5f352014-02-24 18:43:28 +0000460// CHECK-WCHAR1: -fno-short-wchar
461// CHECK-WCHAR1-NOT: -fshort-wchar
462// CHECK-WCHAR2: -fshort-wchar
463// CHECK-WCHAR2-NOT: -fno-short-wchar
Filipe Cabecinhasd0c64682015-02-12 03:37:55 +0000464// DELIMITERS: {{^ *"}}