From: Jim Grosbach Date: Tue, 23 Jun 2015 18:20:13 +0000 (+0000) Subject: Driver: Pass -I options to cc1as for .include search paths. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0e0967f2d092ac560a515409ce2ed04af0631cb;p=clang Driver: Pass -I options to cc1as for .include search paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240432 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2367914cc0..057e2c2d6f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -5246,6 +5246,9 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, // Ignore explicit -force_cpusubtype_ALL option. (void) Args.hasArg(options::OPT_force__cpusubtype__ALL); + // Pass along any -I options so we get proper .include search paths. + Args.AddAllArgs(CmdArgs, options::OPT_I_Group); + // Determine the original source input. const Action *SourceAction = &JA; while (SourceAction->getKind() != Action::InputClass) { diff --git a/test/Driver/integrated-as.s b/test/Driver/integrated-as.s index 9a7d2c5dfe..181f790a1f 100644 --- a/test/Driver/integrated-as.s +++ b/test/Driver/integrated-as.s @@ -43,3 +43,6 @@ // RUN: %clang -### -c -integrated-as %s -Wa,-gdwarf-2 2>&1 | FileCheck --check-prefix=DWARF2WA %s // DWARF2WA: "-gdwarf-2" + +// RUN: %clang -### -x assembler -c -integrated-as %s -I myincludedir 2>&1 | FileCheck --check-prefix=INCLUDEPATH %s +// INCLUDEPATH: "-I" "myincludedir"