1 // Check to make sure clang is somewhat picky about -g options.
2 // rdar://10383444
3 
4 // Linux.
5 // RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
6 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
7 // RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \
8 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
9 // RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
10 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
11 // RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
12 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
13 // RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \
14 // RUN:             | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_GDB %s
15 // RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \
16 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s
17 // RUN: %clang -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \
18 // RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_LLDB %s
19 // RUN: %clang -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \
20 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_SCE %s
21 
22 // Android.
23 // Android should always generate DWARF4.
24 // RUN: %clang -### -c -g %s -target arm-linux-androideabi 2>&1 \
25 // RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DWARF4 %s
26 
27 // Darwin.
28 // RUN: %clang -### -c -g %s -target x86_64-apple-darwin14 2>&1 \
29 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
30 // RUN:                         -check-prefix=G_DWARF2 \
31 // RUN:                         -check-prefix=G_LLDB %s
32 // RUN: %clang -### -c -g %s -target x86_64-apple-darwin16 2>&1 \
33 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
34 // RUN:                         -check-prefix=G_DWARF4 \
35 // RUN:                         -check-prefix=G_LLDB %s
36 // RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \
37 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
38 // RUN:                         -check-prefix=G_DWARF4 %s
39 // RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \
40 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
41 // RUN:                         -check-prefix=G_DWARF4 %s
42 // RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \
43 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
44 // RUN:                         -check-prefix=G_DWARF4 \
45 // RUN:                         -check-prefix=G_GDB %s
46 // RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \
47 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
48 // RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \
49 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
50 // RUN:                         -check-prefix=G_DWARF4 %s
51 // RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \
52 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
53 // RUN:                         -check-prefix=G_DWARF4 %s
54 // RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \
55 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
56 // RUN: %clang -### -c -g %s -target armv7-apple-ios9.0 2>&1 \
57 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
58 // RUN:                         -check-prefix=G_DWARF4 %s
59 // RUN: %clang -### -c -g %s -target armv7-apple-ios8.0 2>&1 \
60 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
61 // RUN: %clang -### -c -g %s -target armv7k-apple-watchos 2>&1 \
62 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
63 // RUN:                         -check-prefix=G_DWARF4 %s
64 // RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \
65 // RUN:             | FileCheck -check-prefix=G_STANDALONE \
66 // RUN:                         -check-prefix=G_DWARF4 %s
67 // RUN: %clang -### -c -fsave-optimization-record %s \
68 // RUN:        -target x86_64-apple-darwin 2>&1 \
69 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
70 // RUN: %clang -### -c -g -fsave-optimization-record %s \
71 // RUN:        -target x86_64-apple-darwin 2>&1 \
72 // RUN:             | FileCheck -check-prefix=G_STANDALONE %s
73 
74 // FreeBSD.
75 // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \
76 // RUN:             | FileCheck -check-prefix=G_GDB \
77 // RUN:                         -check-prefix=G_DWARF2 %s
78 // RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \
79 // RUN:             | FileCheck -check-prefix=G_GDB \
80 // RUN:                         -check-prefix=G_DWARF4 %s
81 
82 // Windows.
83 // RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \
84 // RUN:             | FileCheck -check-prefix=G_GDB %s
85 // RUN: %clang -### -c -g %s -target x86_64-windows-msvc 2>&1 \
86 // RUN:             | FileCheck -check-prefix=G_NOTUNING %s
87 // RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \
88 // RUN:             | FileCheck -check-prefix=G_NOTUNING %s
89 
90 // On the PS4, -g defaults to -gno-column-info, and we always generate the
91 // arange section.
92 // RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \
93 // RUN:             | FileCheck -check-prefix=NOG_PS4 %s
94 // RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
95 // RUN:             | FileCheck -check-prefix=G_PS4 %s
96 // RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
97 // RUN:             | FileCheck -check-prefix=G_SCE %s
98 // RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \
99 // RUN:             | FileCheck -check-prefix=NOCI %s
100 // RUN: %clang -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \
101 // RUN:             | FileCheck -check-prefix=CI %s
102 // RUN: %clang -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \
103 // RUN:             | FileCheck -check-prefix=NOCI %s
104 
105 // RUN: %clang -### -c -gdwarf-2 %s 2>&1 \
106 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
107 //
108 // RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s
109 // RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
110 // RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
111 // RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
112 // RUN: %clang -### -c -glldb -g1 %s 2>&1 \
113 // RUN:             | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s
114 //
115 // PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info,
116 // then -g turns it back on without affecting tuning.
117 // RUN: %clang -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \
118 // RUN:             | FileCheck -check-prefix=G_GDB %s
119 //
120 // RUN: %clang -### -c -g1 %s 2>&1 \
121 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
122 // RUN: %clang -### -c -gmlt %s 2>&1 \
123 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
124 // RUN: %clang -### -c -gline-tables-only %s 2>&1 \
125 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
126 // RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \
127 // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
128 // RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \
129 // RUN:             | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
130 // RUN: %clang -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \
131 // RUN:             | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
132 // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
133 // RUN:             | FileCheck -check-prefix=G_ONLY %s
134 // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \
135 // RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s
136 // RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \
137 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
138 // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
139 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
140 // RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \
141 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
142 // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
143 // RUN:             | FileCheck -check-prefix=GLTO_NO %s
144 //
145 // RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \
146 // RUN:             | FileCheck -check-prefix=GLIO_ONLY %s
147 // RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \
148 // RUN:             | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s
149 // RUN: %clang -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \
150 // RUN:             | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s
151 // RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \
152 // RUN:             | FileCheck -check-prefix=G_ONLY %s
153 // RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \
154 // RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s
155 // RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \
156 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
157 // RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
158 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
159 // RUN: %clang -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \
160 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
161 // RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \
162 // RUN:             | FileCheck -check-prefix=GLIO_NO %s
163 //
164 // RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \
165 //             | FileCheck -check-prefix=GRECORD %s
166 // RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \
167 //             | FileCheck -check-prefix=GNO_RECORD %s
168 // RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches %s 2>&1 \
169 //             | FileCheck -check-prefix=GNO_RECORD %s/
170 // RUN: %clang -### -c -grecord-gcc-switches -o - %s 2>&1 \
171 //             | FileCheck -check-prefix=GRECORD_O %s
172 // RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \
173 //             | FileCheck -check-prefix=GRECORD_OPT %s
174 //
175 // RUN: %clang -### -c -grecord-command-line %s 2>&1 \
176 //             | FileCheck -check-prefix=GRECORD %s
177 // RUN: %clang -### -c -gno-record-command-line %s 2>&1 \
178 //             | FileCheck -check-prefix=GNO_RECORD %s
179 // RUN: %clang -### -c -grecord-command-line -gno-record-command-line %s 2>&1 \
180 //             | FileCheck -check-prefix=GNO_RECORD %s/
181 // RUN: %clang -### -c -grecord-command-line -o - %s 2>&1 \
182 //             | FileCheck -check-prefix=GRECORD_O %s
183 // RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \
184 //             | FileCheck -check-prefix=GRECORD_OPT %s
185 //
186 // RUN: %clang -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
187 // RUN:        | FileCheck -check-prefix=GIGNORE %s
188 //
189 // RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s
190 // RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
191 // RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
192 // RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
193 //
194 // RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s
195 // RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
196 // RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
197 // RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
198 //
199 // RUN: %clang -### -c -gsplit-dwarf -g -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
200 //
201 // RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s
202 // RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
203 // RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
204 //
205 // RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
206 // RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
207 //
208 // RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
209 //
210 // RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \
211 // RUN:        | FileCheck -check-prefix=FDTS %s
212 //
213 // RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \
214 // RUN:        | FileCheck -check-prefix=NOFDTS %s
215 //
216 // RUN: %clang -### -fdebug-types-section -target wasm32-unknown-unknown %s 2>&1 \
217 // RUN:        | FileCheck -check-prefix=FDTS %s
218 //
219 // RUN: %clang -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \
220 // RUN:        | FileCheck -check-prefix=FDTSE %s
221 //
222 // RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \
223 // RUN:        | FileCheck -check-prefix=NOFDTSE %s
224 //
225 // RUN: %clang -### -g -gno-column-info %s 2>&1 \
226 // RUN:        | FileCheck -check-prefix=NOCI %s
227 //
228 // RUN: %clang -### -g -target x86_64-unknown-unknown %s 2>&1 \
229 //             | FileCheck -check-prefix=CI %s
230 //
231 // RUN: %clang -### -gmodules %s 2>&1 \
232 // RUN:        | FileCheck -check-prefix=GEXTREFS %s
233 //
234 // RUN: %clang -### -gmodules -g %s 2>&1 \
235 // RUN:        | FileCheck -check-prefix=GEXTREFS %s
236 //
237 // RUN: %clang -### -gline-tables-only -gmodules %s 2>&1 \
238 // RUN:        | FileCheck -check-prefix=GEXTREFS %s
239 //
240 // RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \
241 // RUN:        | FileCheck -check-prefix=GLTO_ONLY %s
242 //
243 // RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \
244 // RUN:        | FileCheck -check-prefix=GLIO_ONLY %s
245 //
246 // NOG_PS4: "-cc1"
247 // NOG_PS4-NOT: "-dwarf-version=
248 // NOG_PS4: "-generate-arange-section"
249 // NOG_PS4-NOT: "-dwarf-version=
250 //
251 // G_PS4: "-cc1"
252 // G_PS4: "-dwarf-version=
253 // G_PS4: "-generate-arange-section"
254 //
255 // G_ERR: error: unknown argument:
256 //
257 // G_NO: "-cc1"
258 // G_NO-NOT: -debug-info-kind=
259 //
260 // GLTO_ONLY: "-cc1"
261 // GLTO_ONLY-NOT: "-dwarf-ext-refs"
262 // GLTO_ONLY: "-debug-info-kind=line-tables-only"
263 // GLTO_ONLY-NOT: "-dwarf-ext-refs"
264 //
265 // GLTO_ONLY_DWARF2: "-cc1"
266 // GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only"
267 // GLTO_ONLY_DWARF2: "-dwarf-version=2"
268 //
269 // GLIO_ONLY: "-cc1"
270 // GLIO_ONLY-NOT: "-dwarf-ext-refs"
271 // GLIO_ONLY: "-debug-info-kind=line-directives-only"
272 // GLIO_ONLY-NOT: "-dwarf-ext-refs"
273 //
274 // GLIO_ONLY_DWARF2: "-cc1"
275 // GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only"
276 // GLIO_ONLY_DWARF2: "-dwarf-version=2"
277 //
278 // G_ONLY: "-cc1"
279 // G_ONLY: "-debug-info-kind=limited"
280 //
281 // These tests assert that "-gline-tables-only" "-g" uses the latter,
282 // but otherwise not caring about the DebugInfoKind.
283 // G_ONLY_DWARF2: "-cc1"
284 // G_ONLY_DWARF2: "-debug-info-kind={{standalone|limited}}"
285 // G_ONLY_DWARF2: "-dwarf-version=2"
286 //
287 // G_STANDALONE: "-cc1"
288 // G_STANDALONE: "-debug-info-kind=standalone"
289 // G_LIMITED: "-cc1"
290 // G_LIMITED: "-debug-info-kind=limited"
291 // G_DWARF2: "-dwarf-version=2"
292 // G_DWARF4: "-dwarf-version=4"
293 //
294 // G_GDB:  "-debugger-tuning=gdb"
295 // G_LLDB: "-debugger-tuning=lldb"
296 // G_SCE:  "-debugger-tuning=sce"
297 //
298 // G_NOTUNING: "-cc1"
299 // G_NOTUNING-NOT: "-debugger-tuning="
300 //
301 // This tests asserts that "-gline-tables-only" "-g0" disables debug info.
302 // GLTO_NO: "-cc1"
303 // GLTO_NO-NOT: -debug-info-kind=
304 //
305 // This tests asserts that "-gline-directives-only" "-g0" disables debug info.
306 // GLIO_NO: "-cc1"
307 // GLIO_NO-NOT: -debug-info-kind=
308 //
309 // GRECORD: "-dwarf-debug-flags"
310 // GRECORD: -### -c -grecord-gcc-switches
311 //
312 // GNO_RECORD-NOT: "-dwarf-debug-flags"
313 // GNO_RECORD-NOT: -### -c -grecord-gcc-switches
314 //
315 // GRECORD_O: "-dwarf-debug-flags"
316 // GRECORD_O: -### -c -grecord-gcc-switches -o -
317 //
318 // GRECORD_OPT: -### -c -O3 -ffunction-sections -grecord-gcc-switches
319 //
320 // GIGNORE-NOT: "argument unused during compilation"
321 //
322 // GPUB: -ggnu-pubnames
323 // NOPUB-NOT: -ggnu-pubnames
324 // NOPUB-NOT: -gpubnames
325 //
326 // PUB: -gpubnames
327 //
328 // RNGBSE: -fdebug-ranges-base-address
329 // NORNGBSE-NOT: -fdebug-ranges-base-address
330 //
331 // GARANGE: -generate-arange-section
332 //
333 // FDTS: "-mllvm" "-generate-type-units"
334 // FDTSE: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'
335 //
336 // NOFDTS-NOT: "-mllvm" "-generate-type-units"
337 // NOFDTSE-NOT: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'
338 //
339 // CI-NOT: "-gno-column-info"
340 //
341 // NOCI: "-gno-column-info"
342 //
343 // GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"
344 // GEXTREFS: "-debug-info-kind={{standalone|limited}}"
345 
346 // RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s
347 // BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind'
348 // RUN: not %clang -cc1 -debugger-tuning=gmodal 2>&1 | FileCheck -check-prefix=BADSTRING2 %s
349 // BADSTRING2: error: invalid value 'gmodal' in '-debugger-tuning=gmodal'
350 
351 // RUN: %clang -### -fdebug-macro    %s 2>&1 | FileCheck -check-prefix=MACRO %s
352 // RUN: %clang -### -fno-debug-macro %s 2>&1 | FileCheck -check-prefix=NOMACRO %s
353 // RUN: %clang -###                  %s 2>&1 | FileCheck -check-prefix=NOMACRO %s
354 // MACRO: "-debug-info-macro"
355 // NOMACRO-NOT: "-debug-info-macro"
356 //
357 // RUN: %clang -### -gdwarf-5 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_5 %s
358 // RUN: %clang -### -gdwarf-2 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_2 %s
359 // RUN: %clang -### -gdwarf-5 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_5 %s
360 // RUN: %clang -### -gdwarf-2 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_2 %s
361 //
362 // GEMBED_5:  "-gembed-source"
363 // GEMBED_2:  error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'
364 // NOGEMBED_5-NOT:  "-gembed-source"
365 // NOGEMBED_2-NOT:  error: invalid argument '-gembed-source' only allowed with '-gdwarf-5'
366 //
367 // RUN: %clang -### -g -fno-eliminate-unused-debug-types -c %s 2>&1 \
368 // RUN:        | FileCheck -check-prefix=DEBUG_UNUSED_TYPES %s
369 // DEBUG_UNUSED_TYPES: "-debug-info-kind=unused-types"
370 // DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=limited"
371 // RUN: %clang -### -g -feliminate-unused-debug-types -c %s 2>&1 \
372 // RUN:        | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s
373 // RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \
374 // RUN:        | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s
375 // NO_DEBUG_UNUSED_TYPES: "-debug-info-kind={{limited|line-tables-only|standalone}}"
376 // NO_DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=unused-types"
377