Index: include/clang/Driver/CLCompatOptions.td =================================================================== --- include/clang/Driver/CLCompatOptions.td +++ include/clang/Driver/CLCompatOptions.td @@ -164,6 +164,9 @@ AliasArgs<["no-deprecated-declarations"]>; def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">, Alias; +def _SLASH_X : CLFlag<"X">, + HelpText<"Don't add %INCLUDE% to the include search path">, + Alias; def _SLASH_Zc_sizedDealloc : CLFlag<"Zc:sizedDealloc">, HelpText<"Enable C++14 sized global deallocation functions">, Alias; @@ -386,7 +389,6 @@ def _SLASH_V : CLFlag<"V">; def _SLASH_WL : CLFlag<"WL">; def _SLASH_Wp64 : CLFlag<"Wp64">; -def _SLASH_X : CLFlag<"X">; def _SLASH_Yd : CLFlag<"Yd">; def _SLASH_Yl : CLJoined<"Yl">; def _SLASH_Za : CLFlag<"Za">; Index: test/Driver/cl-include.c =================================================================== --- test/Driver/cl-include.c +++ test/Driver/cl-include.c @@ -10,5 +10,16 @@ // RUN: env INCLUDE=/my/system/inc %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=STDINC // STDINC: "-internal-isystem" "/my/system/inc" -// RUN: env INCLUDE=/my/system/inc %clang_cl -nostdinc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOSTDINC +// -nostdinc suppresses all of %INCLUDE%, clang resource dirs, and -imsvc dirs. +// RUN: env INCLUDE=/my/system/inc %clang_cl -nostdinc -imsvc /my/other/inc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOSTDINC +// NOSTDINC: argument unused{{.*}}-imsvc // NOSTDINC-NOT: "-internal-isystem" "/my/system/inc" +// NOSTDINC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{.*}}/include" +// NOSTDINC-NOT: "-internal-isystem" "/my/other/inc" + +// /X suppresses %INCLUDE% but not clang resource dirs or -imsvc dirs. +// RUN: env INCLUDE=/my/system/inc %clang_cl /X -imsvc /my/other/inc -### -- %s 2>&1 | FileCheck %s --check-prefix=SLASHX +// SLASHX-NOT: "argument unused{{.*}}-imsvc" +// SLASHX-NOT: "-internal-isystem" "/my/system/inc" +// SLASHX: "-internal-isystem" "{{.*}}/lib/clang/{{.*}}/include" +// SLASHX: "-internal-isystem" "/my/other/inc"