r235915 - PR21000: pass -I options to assembler
Artem Belevich
tra at google.com
Mon Apr 27 13:51:44 PDT 2015
Author: tra
Date: Mon Apr 27 15:51:44 2015
New Revision: 235915
URL: http://llvm.org/viewvc/llvm-project?rev=235915&view=rev
Log:
PR21000: pass -I options to assembler
Pass -I options to assembly so it can find files included with
.include.
Differential Revision: http://reviews.llvm.org/D7472
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=235915&r1=235914&r2=235915&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Apr 27 15:51:44 2015
@@ -5115,6 +5115,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
@@ -7584,6 +7587,7 @@ void gnutools::Assemble::ConstructJob(Co
if (NeedsKPIC)
addAssemblerKPIC(Args, CmdArgs);
+ Args.AddAllArgs(CmdArgs, options::OPT_I);
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
options::OPT_Xassembler);
Added: cfe/trunk/test/Driver/as-options.s
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/as-options.s?rev=235915&view=auto
==============================================================================
--- cfe/trunk/test/Driver/as-options.s (added)
+++ cfe/trunk/test/Driver/as-options.s Mon Apr 27 15:51:44 2015
@@ -0,0 +1,12 @@
+// PR21000: Test that -I is passed to assembler.
+// RUN: %clang -### -c -no-integrated-as %s -Ifoo_dir 2>&1 | FileCheck --check-prefix=BARE_INCLUDE1 %s
+// BARE_INCLUDE1: "-I" "foo_dir"
+
+// RUN: %clang -### -c -no-integrated-as %s -I foo_dir 2>&1 | FileCheck --check-prefix=BARE_INCLUDE2 %s
+// BARE_INCLUDE2: "-I" "foo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -Ifoo_dir 2>&1 | FileCheck --check-prefix=BARE_INT_INCLUDE1 %s
+// BARE_INT_INCLUDE1: "-I" "foo_dir"
+
+// RUN: %clang -### -c -integrated-as %s -I foo_dir 2>&1 | FileCheck --check-prefix=BARE_INT_INCLUDE2 %s
+// BARE_INT_INCLUDE2: "-I" "foo_dir"
More information about the cfe-commits
mailing list