Record.clear();
for (unsigned I = 0, N = Mod->Exports.size(); I != N; ++I) {
if (Module *Exported = Mod->Exports[I].getPointer()) {
- unsigned ExportedID = SubmoduleIDs[Exported];
- assert(ExportedID > 0 && "Unknown submodule ID?");
+ unsigned ExportedID = getSubmoduleID(Exported);
Record.push_back(ExportedID);
} else {
Record.push_back(0);
}
Stream.ExitBlock();
-
- assert((NextSubmoduleID - FirstSubmoduleID
- == getNumberOfModules(WritingModule)) && "Wrong # of submodules");
+
+ // FIXME: This can easily happen, if we have a reference to a submodule that
+ // did not result in us loading a module file for that submodule. For
+ // instance, a cross-top-level-module 'conflict' declaration will hit this.
+ assert((NextSubmoduleID - FirstSubmoduleID ==
+ getNumberOfModules(WritingModule)) &&
+ "Wrong # of submodules; found a reference to a non-local, "
+ "non-imported submodule?");
}
serialization::SubmoduleID
// RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - | FileCheck %s
+//
+// RUN: rm -rf %t
+// RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - \
+// RUN: -fmodules -fmodules-cache-path=%t -isystem %S/Inputs/include \
+// RUN: | FileCheck %s
#include <xmmintrin.h>
__m64 test_mm_cvtps_pi16(__m128 a) {
return _mm_cvtps_pi16(a);
}
+
+// Make sure that including <xmmintrin.h> also makes <emmintrin.h>'s content available.
+// This is an ugly hack for GCC compatibility.
+__m128 test_xmmintrin_provides_emmintrin(__m128d __a, __m128d __b) {
+ return _mm_add_sd(__a, __b);
+}
+