[modules] If we load two declarations with typedef names for linkage purposes
on top of a local declaration of the same entity, we still need to remember
that we loaded the first one or we may fail to merge the second one properly.

llvm-svn: 226765
diff --git a/clang/test/Modules/merge-name-for-linkage.cc b/clang/test/Modules/merge-name-for-linkage.cc
new file mode 100644
index 0000000..1700b61
--- /dev/null
+++ b/clang/test/Modules/merge-name-for-linkage.cc
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/merge-name-for-linkage -verify %s
+// expected-no-diagnostics
+typedef union {} pthread_mutex_t;
+#include "a.h"
+pthread_mutex_t x;
+#include "b.h"
+pthread_mutex_t y;