[modules] If we reach a definition of a class for which we already have a
non-visible definition, skip the new definition and make the old one visible
instead of trying to parse it again and failing horribly. C++'s ODR allows
us to assume that the two definitions are identical.

llvm-svn: 233250
diff --git a/clang/test/Modules/Inputs/submodules-merge-defs/module.modulemap b/clang/test/Modules/Inputs/submodules-merge-defs/module.modulemap
new file mode 100644
index 0000000..5c7ee8a
--- /dev/null
+++ b/clang/test/Modules/Inputs/submodules-merge-defs/module.modulemap
@@ -0,0 +1,11 @@
+module "stuff" {
+  textual header "defs.h"
+  module "empty" { header "empty.h" }
+  module "use" { header "use-defs.h" }
+}
+
+module "redef" {
+  header "import-and-redefine.h"
+  // Do not re-export stuff.use
+  use "stuff"
+}