]> granicus.if.org Git - clang/commitdiff
[modules] PR20786: add (already passing) regression test from the bug report.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 28 Aug 2014 20:14:15 +0000 (20:14 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 28 Aug 2014 20:14:15 +0000 (20:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216683 91177308-0d34-0410-b5e6-96231b3b80d8

test/Modules/Inputs/PR20786/TBranchProxy.h [new file with mode: 0644]
test/Modules/Inputs/PR20786/TFormula.h [new file with mode: 0644]
test/Modules/Inputs/PR20786/TMath.h [new file with mode: 0644]
test/Modules/Inputs/PR20786/module.modulemap [new file with mode: 0644]
test/Modules/Inputs/PR20786/random.h [new file with mode: 0644]
test/Modules/pr20786.cpp [new file with mode: 0644]

diff --git a/test/Modules/Inputs/PR20786/TBranchProxy.h b/test/Modules/Inputs/PR20786/TBranchProxy.h
new file mode 100644 (file)
index 0000000..91f3730
--- /dev/null
@@ -0,0 +1,2 @@
+#include "random.h"
+#include "TFormula.h"
diff --git a/test/Modules/Inputs/PR20786/TFormula.h b/test/Modules/Inputs/PR20786/TFormula.h
new file mode 100644 (file)
index 0000000..316e3ad
--- /dev/null
@@ -0,0 +1 @@
+#include "TMath.h"
diff --git a/test/Modules/Inputs/PR20786/TMath.h b/test/Modules/Inputs/PR20786/TMath.h
new file mode 100644 (file)
index 0000000..b7dba62
--- /dev/null
@@ -0,0 +1 @@
+#include "random.h"
diff --git a/test/Modules/Inputs/PR20786/module.modulemap b/test/Modules/Inputs/PR20786/module.modulemap
new file mode 100644 (file)
index 0000000..daf78cd
--- /dev/null
@@ -0,0 +1,3 @@
+module TMath { header "TMath.h" }
+module TFormula { header "TFormula.h" }
+module TBranchProxy { header "TBranchProxy.h" }
diff --git a/test/Modules/Inputs/PR20786/random.h b/test/Modules/Inputs/PR20786/random.h
new file mode 100644 (file)
index 0000000..86a7d83
--- /dev/null
@@ -0,0 +1,12 @@
+namespace std {
+  template<typename> struct mersenne_twister_engine {
+    friend bool operator==(const mersenne_twister_engine &,
+                           const mersenne_twister_engine &) {
+      return false;
+    }
+  };
+  struct random_device {
+    mersenne_twister_engine<int> mt; // require complete type
+  };
+}
+
diff --git a/test/Modules/pr20786.cpp b/test/Modules/pr20786.cpp
new file mode 100644 (file)
index 0000000..35d62df
--- /dev/null
@@ -0,0 +1,2 @@
+// RUN: rm -rf %T
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%T -fmodule-name=TBranchProxy -emit-module -x c++ %S/Inputs/PR20786/module.modulemap