Index: clang/lib/Lex/ModuleMap.cpp =================================================================== --- clang/lib/Lex/ModuleMap.cpp +++ clang/lib/Lex/ModuleMap.cpp @@ -379,6 +379,7 @@ bool ModuleMap::isBuiltinHeader(StringRef FileName) { return llvm::StringSwitch(FileName) .Case("float.h", true) + .Case("inttypes.h", true) .Case("iso646.h", true) .Case("limits.h", true) .Case("stdalign.h", true) Index: clang/test/Modules/Inputs/System/usr/include/module.map =================================================================== --- clang/test/Modules/Inputs/System/usr/include/module.map +++ clang/test/Modules/Inputs/System/usr/include/module.map @@ -4,6 +4,11 @@ header "float.h" } + // In both directories (compiler support version wins, forwards) + module inttypes { + header "inttypes.h" + } + // Only in system headers directory module stdio { header "stdio.h" Index: clang/test/Modules/Werror-Wsystem-headers.m =================================================================== --- clang/test/Modules/Werror-Wsystem-headers.m +++ clang/test/Modules/Werror-Wsystem-headers.m @@ -4,17 +4,17 @@ // Initial module build // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ -// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify +// RUN: -internal-isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify // RUN: cp %t/cstd.pcm %t-saved/cstd.pcm // Even with -Werror don't rebuild a system module // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ -// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify -Werror +// RUN: -internal-isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify -Werror // RUN: diff %t/cstd.pcm %t-saved/cstd.pcm // Unless -Wsystem-headers is on // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ -// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify \ +// RUN: -internal-isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify \ // RUN: -Werror=unused -Wsystem-headers // RUN: not diff %t/cstd.pcm %t-saved/cstd.pcm Index: clang/test/Modules/crash-vfs-include-pch.m =================================================================== --- clang/test/Modules/crash-vfs-include-pch.m +++ clang/test/Modules/crash-vfs-include-pch.m @@ -6,12 +6,12 @@ // RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h \ // RUN: -o %t/out/pch-used.h.pch -fmodules -fimplicit-module-maps \ // RUN: -fmodules-cache-path=%t/cache -O0 \ -// RUN: -isystem %S/Inputs/System/usr/include +// RUN: -internal-isystem %S/Inputs/System/usr/include // RUN: env FORCE_CLANG_DIAGNOSTICS_CRASH= TMPDIR=%t TEMP=%t TMP=%t \ // RUN: not %clang %s -E -include-pch %t/out/pch-used.h.pch -fmodules -nostdlibinc \ // RUN: -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 \ -// RUN: -Xclang -fno-validate-pch -isystem %S/Inputs/System/usr/include \ +// RUN: -Xclang -fno-validate-pch -Xclang -internal-isystem -Xclang %S/Inputs/System/usr/include \ // RUN: -o %t/output.E 2>&1 | FileCheck %s // RUN: FileCheck --check-prefix=CHECKSH %s -input-file %t/crash-vfs-*.sh Index: clang/test/Modules/cstd.m =================================================================== --- clang/test/Modules/cstd.m +++ clang/test/Modules/cstd.m @@ -28,3 +28,11 @@ # error "bool was not defined!" #endif +// Supplied by compiler, which forwards to the "/usr/include" version. +@import cstd.inttypes; +#ifndef __CLANG_INTTYPES_H +#error "__CLANG_INTTYPES_H was not defined!" +#endif +#ifndef MY_PRIi32 +#error "MY_PRIi32 was not defined!" +#endif Index: clang/test/Modules/pch-used.m =================================================================== --- clang/test/Modules/pch-used.m +++ clang/test/Modules/pch-used.m @@ -1,8 +1,8 @@ // UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}} // RUN: rm -rf %t // RUN: mkdir %t -// RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h -o %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include -// RUN: %clang_cc1 %s -include-pch %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h -o %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -internal-isystem %S/Inputs/System/usr/include +// RUN: %clang_cc1 %s -include-pch %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -internal-isystem %S/Inputs/System/usr/include -emit-llvm -o - | FileCheck %s void f(void) { SPXTrace(); } void g(void) { double x = DBL_MAX; }