From: Artem Belevich Date: Mon, 27 Apr 2015 20:51:44 +0000 (+0000) Subject: PR21000: pass -I options to assembler X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07b604d3535e4e057eb2e131aaf6b9e06a80a51f;p=clang 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235915 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 526968cf41..a398a55724 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -5115,6 +5115,9 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, // 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(Compilation &C, const JobAction &JA, if (NeedsKPIC) addAssemblerKPIC(Args, CmdArgs); + Args.AddAllArgs(CmdArgs, options::OPT_I); Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); diff --git a/test/Driver/as-options.s b/test/Driver/as-options.s new file mode 100644 index 0000000000..eb1f9c7ffb --- /dev/null +++ b/test/Driver/as-options.s @@ -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"