Index: lib/Headers/module.modulemap =================================================================== --- lib/Headers/module.modulemap +++ lib/Headers/module.modulemap @@ -119,6 +119,7 @@ } explicit module mm3dnow { + export mmx header "mm3dnow.h" } @@ -129,6 +130,7 @@ } explicit module aes { + export sse2 header "__wmmintrin_aes.h" } Index: test/Modules/compiler_builtins_x86_submodules.c =================================================================== --- test/Modules/compiler_builtins_x86_submodules.c +++ test/Modules/compiler_builtins_x86_submodules.c @@ -0,0 +1,15 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -triple i686-unknown-unknown -target-feature +3dnowa -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -verify -ffreestanding + +// expected-no-diagnostics + +#include + +__m64 x; // Verify that types which are used by mm3dnow.h + // but declared in the mmx submodule get imported + +#include + +__m128i y; // Verify that types which are used by wmmintrin.h + // but declared in the sse2 submodule get imported +