File tree 2 files changed +7
-15
lines changed
2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -1692,8 +1692,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
1692
1692
assert (AtTopLevel && isa<PreprocessJobAction>(JA));
1693
1693
StringRef BaseName = llvm::sys::path::filename (BaseInput);
1694
1694
StringRef NameArg;
1695
- if (Arg *A = C.getArgs ().getLastArg (options::OPT__SLASH_Fi,
1696
- options::OPT__SLASH_o))
1695
+ if (Arg *A = C.getArgs ().getLastArg (options::OPT__SLASH_Fi))
1697
1696
NameArg = A->getValue ();
1698
1697
return C.addResultFile (MakeCLOutputFilename (C.getArgs (), NameArg, BaseName,
1699
1698
types::TY_PP_C), &JA);
Original file line number Diff line number Diff line change 249
249
// Fi2: "-E"
250
250
// Fi2: "-o" "foo.x"
251
251
252
+ // To match MSVC behavior /o should be ignored for /P output.
253
+
252
254
// RUN: %clang_cl /P /ofoo -### -- %s 2>&1 | FileCheck -check-prefix=Fio1 %s
253
255
// Fio1: "-E"
254
- // Fio1: "-o" "foo .i"
256
+ // Fio1: "-o" "cl-outputs .i"
255
257
256
- // RUN: %clang_cl /P /o foo -### -- %s 2>&1 | FileCheck -check-prefix=Fio2 %s
258
+ // RUN: %clang_cl /P /o foo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio2 %s
257
259
// Fio2: "-E"
258
- // Fio2: "-o" "foo.i"
259
-
260
- // RUN: %clang_cl /P /ofoo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio3 %s
261
- // Fio3: "-E"
262
- // Fio3: "-o" "foo.x"
263
-
264
- // RUN: %clang_cl /P /o foo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio4 %s
265
- // Fio4: "-E"
266
- // Fio4: "-o" "foo.x"
267
-
260
+ // Fio2: "-o" "cl-outputs.i"
268
261
269
262
// RUN: %clang_cl /P /obar.x /Fifoo.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE1 %s
270
263
// FioRACE1: "-E"
271
264
// FioRACE1: "-o" "foo.x"
272
265
273
266
// RUN: %clang_cl /P /Fifoo.x /obar.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE2 %s
274
267
// FioRACE2: "-E"
275
- // FioRACE2: "-o" "bar .x"
268
+ // FioRACE2: "-o" "foo .x"
276
269
277
270
// RUN: %clang_cl /c /GL -### -- %s 2>&1 | FileCheck -check-prefix=LTO-DEFAULT %s
278
271
// LTO-DEFAULT: "-emit-llvm-bc"{{.*}}"-o" "cl-outputs.obj"
You can’t perform that action at this time.
0 commit comments