r242904 - Pass -I options to integrates and external assemblers
Renato Golin
renato.golin at linaro.org
Wed Jul 22 08:32:36 PDT 2015
Author: rengolin
Date: Wed Jul 22 10:32:36 2015
New Revision: 242904
URL: http://llvm.org/viewvc/llvm-project?rev=242904&view=rev
Log:
Pass -I options to integrates and external assemblers
Fixes PR21000.
Patch by Artem Belevich.
Added:
cfe/trunk/test/Driver/as-options.s
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=242904&r1=242903&r2=242904&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jul 22 10:32:36 2015
@@ -5316,6 +5316,9 @@ void ClangAs::ConstructJob(Compilation &
// assembler on assembly source files.
CmdArgs.push_back("-dwarf-debug-producer");
CmdArgs.push_back(Args.MakeArgString(getClangFullVersion()));
+
+ // And pass along -I options
+ Args.AddAllArgs(CmdArgs, options::OPT_I);
}
// Optionally embed the -cc1as level arguments into the debug info, for build
@@ -7813,6 +7816,7 @@ void gnutools::Assembler::ConstructJob(C
if (NeedsKPIC)
addAssemblerKPIC(Args, CmdArgs);
+ Args.AddAllArgs(CmdArgs, options::OPT_I);
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler);
CmdArgs.push_back("-o");
Added: cfe/trunk/test/Driver/as-options.s
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/as-options.s?rev=242904&view=auto
==============================================================================
--- cfe/trunk/test/Driver/as-options.s (added)
+++ cfe/trunk/test/Driver/as-options.s Wed Jul 22 10:32:36 2015
@@ -0,0 +1,37 @@
+// PR21000: Test that -I is passed to both external and integrated assemblers.
+
+// RUN: %clang -target x86_64-linux-gnu -c -no-integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target x86_64-linux-gnu -c -no-integrated-as %s \
+// RUN: -I foo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target x86_64-linux-gnu -c -integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target x86_64-linux-gnu -c -integrated-as %s \
+// RUN: -I foo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// Other GNU targets
+
+// RUN: %clang -target aarch64-linux-gnu -c -no-integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target aarch64-linux-gnu -c -integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target armv7-linux-gnueabihf -c -no-integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// RUN: %clang -target armv7-linux-gnueabihf -c -integrated-as %s \
+// RUN: -Ifoo_dir -### 2>&1 \
+// RUN: | FileCheck %s
+
+// CHECK: "-I" "foo_dir"
More information about the cfe-commits
mailing list