From c5894c71a2da994ba66b1a8a0cb7aaa5d4317f42 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283258 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 2 +- test/Driver/cl-outputs.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 9358dc88ca..565eb092d5 100644 --- a/lib/Driver/Driver.cpp +++ b/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/test/Driver/cl-outputs.c b/test/Driver/cl-outputs.c index 437e173c22..d79a577788 100644 --- a/test/Driver/cl-outputs.c +++ b/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.40.0