Driver: Pass -I options to cc1as for .include search paths.
authorJim Grosbach <grosbach@apple.com>
Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)
llvm-svn: 240432

clang/lib/Driver/Tools.cpp
clang/test/Driver/integrated-as.s

index 2367914cc0b42eedf47da0042936c141c4d398bf..057e2c2d6f79c8f96ecfe561d6f51a11cc880081 100644 (file)
@@ -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) {
index 9a7d2c5dfef4fd3521a99db9d82276655ebf0c08..181f790a1f9966b3222f86a1530eedb039e0c05e 100644 (file)
@@ -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"