From: Artem Belevich Date: Mon, 27 Apr 2015 20:51:44 +0000 (+0000) Subject: PR21000: pass -I options to assembler X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8fe8ed56ee15b5add7373d02bdffb9465cd8732d;p=platform%2Fupstream%2Fllvm.git 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 llvm-svn: 235915 --- diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 526968c..a398a55 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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/clang/test/Driver/as-options.s b/clang/test/Driver/as-options.s new file mode 100644 index 0000000..eb1f9c7 --- /dev/null +++ b/clang/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"