From 625fba88406e3ff47ceb63b7d36d5db756ec44cf Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 4 Oct 2016 21:01:04 +0000 Subject: [PATCH] clang-cl: Make /Fo apply also when using -flto llvm-svn: 283258 --- clang/lib/Driver/Driver.cpp | 2 +- clang/test/Driver/cl-outputs.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 9358dc8..565eb09 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2807,7 +2807,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA, // Determine what the derived output name should be. const char *NamedOutput; - if (JA.getType() == types::TY_Object && + if ((JA.getType() == types::TY_Object || JA.getType() == types::TY_LTO_BC) && C.getArgs().hasArg(options::OPT__SLASH_Fo, options::OPT__SLASH_o)) { // The /Fo or /o flag decides the object filename. StringRef Val = diff --git a/clang/test/Driver/cl-outputs.c b/clang/test/Driver/cl-outputs.c index 437e173..d79a577 100644 --- a/clang/test/Driver/cl-outputs.c +++ b/clang/test/Driver/cl-outputs.c @@ -9,6 +9,7 @@ // FoEMPTY: "-o" "cl-outputs.obj" // RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s +// RUN: %clang_cl /Foa -flto -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s // FoNAME: "-o" "a.obj" // RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoNAMEEXT %s -- 2.7.4