Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -4965,6 +4965,9 @@ // 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 @@ -7296,6 +7299,7 @@ if (NeedsKPIC) addAssemblerKPIC(Args, CmdArgs); + Args.AddAllArgs(CmdArgs, options::OPT_I); Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, options::OPT_Xassembler); Index: test/Driver/integrated-as.s =================================================================== --- test/Driver/integrated-as.s +++ test/Driver/integrated-as.s @@ -29,6 +29,15 @@ // XA_INCLUDE2: cc1as // XA_INCLUDE2: "-Ifoo_dir" +// Test that -I is passed to integrated assembler. +// RUN: %clang -### -c -integrated-as %s -Ifoo_dir 2>&1 | FileCheck --check-prefix=BARE_INCLUDE1 %s +// BARE_INCLUDE1: cc1as +// BARE_INCLUDE1: "-I" "foo_dir" + +// RUN: %clang -### -c -integrated-as %s -I foo_dir 2>&1 | FileCheck --check-prefix=BARE_INCLUDE2 %s +// BARE_INCLUDE2: cc1as +// BARE_INCLUDE2: "-I" "foo_dir" + // RUN: %clang -### -c -integrated-as %s -gdwarf-2 2>&1 | FileCheck --check-prefix=DWARF2 %s // DWARF2: "-g" "-gdwarf-2"