Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -1697,8 +1697,7 @@ assert(AtTopLevel && isa(JA)); StringRef BaseName = llvm::sys::path::filename(BaseInput); StringRef NameArg; - if (Arg *A = C.getArgs().getLastArg(options::OPT__SLASH_Fi, - options::OPT__SLASH_o)) + if (Arg *A = C.getArgs().getLastArg(options::OPT__SLASH_Fi)) NameArg = A->getValue(); return C.addResultFile(MakeCLOutputFilename(C.getArgs(), NameArg, BaseName, types::TY_PP_C), &JA); Index: test/Driver/cl-outputs.c =================================================================== --- test/Driver/cl-outputs.c +++ test/Driver/cl-outputs.c @@ -251,19 +251,19 @@ // RUN: %clang_cl /P /ofoo -### -- %s 2>&1 | FileCheck -check-prefix=Fio1 %s // Fio1: "-E" -// Fio1: "-o" "foo.i" +// Fio1: "-o" "cl-outputs.i" // RUN: %clang_cl /P /o foo -### -- %s 2>&1 | FileCheck -check-prefix=Fio2 %s // Fio2: "-E" -// Fio2: "-o" "foo.i" +// Fio2: "-o" "cl-outputs.i" // RUN: %clang_cl /P /ofoo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio3 %s // Fio3: "-E" -// Fio3: "-o" "foo.x" +// Fio3: "-o" "cl-outputs.i" // RUN: %clang_cl /P /o foo.x -### -- %s 2>&1 | FileCheck -check-prefix=Fio4 %s // Fio4: "-E" -// Fio4: "-o" "foo.x" +// Fio4: "-o" "cl-outputs.i" // RUN: %clang_cl /P /obar.x /Fifoo.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE1 %s @@ -272,7 +272,7 @@ // RUN: %clang_cl /P /Fifoo.x /obar.x -### -- %s 2>&1 | FileCheck -check-prefix=FioRACE2 %s // FioRACE2: "-E" -// FioRACE2: "-o" "bar.x" +// FioRACE2: "-o" "foo.x" // RUN: %clang_cl /c /GL -### -- %s 2>&1 | FileCheck -check-prefix=LTO-DEFAULT %s // LTO-DEFAULT: "-emit-llvm-bc"{{.*}}"-o" "cl-outputs.obj"