From 13ad07aca317dfb5c261bb67d3be36111857df42 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 28 Aug 2014 20:14:15 +0000 Subject: [PATCH] [modules] PR20786: add (already passing) regression test from the bug report. llvm-svn: 216683 --- clang/test/Modules/Inputs/PR20786/TBranchProxy.h | 2 ++ clang/test/Modules/Inputs/PR20786/TFormula.h | 1 + clang/test/Modules/Inputs/PR20786/TMath.h | 1 + clang/test/Modules/Inputs/PR20786/module.modulemap | 3 +++ clang/test/Modules/Inputs/PR20786/random.h | 12 ++++++++++++ clang/test/Modules/pr20786.cpp | 2 ++ 6 files changed, 21 insertions(+) create mode 100644 clang/test/Modules/Inputs/PR20786/TBranchProxy.h create mode 100644 clang/test/Modules/Inputs/PR20786/TFormula.h create mode 100644 clang/test/Modules/Inputs/PR20786/TMath.h create mode 100644 clang/test/Modules/Inputs/PR20786/module.modulemap create mode 100644 clang/test/Modules/Inputs/PR20786/random.h create mode 100644 clang/test/Modules/pr20786.cpp diff --git a/clang/test/Modules/Inputs/PR20786/TBranchProxy.h b/clang/test/Modules/Inputs/PR20786/TBranchProxy.h new file mode 100644 index 000000000000..91f3730c3b88 --- /dev/null +++ b/clang/test/Modules/Inputs/PR20786/TBranchProxy.h @@ -0,0 +1,2 @@ +#include "random.h" +#include "TFormula.h" diff --git a/clang/test/Modules/Inputs/PR20786/TFormula.h b/clang/test/Modules/Inputs/PR20786/TFormula.h new file mode 100644 index 000000000000..316e3ad7222b --- /dev/null +++ b/clang/test/Modules/Inputs/PR20786/TFormula.h @@ -0,0 +1 @@ +#include "TMath.h" diff --git a/clang/test/Modules/Inputs/PR20786/TMath.h b/clang/test/Modules/Inputs/PR20786/TMath.h new file mode 100644 index 000000000000..b7dba620f7d1 --- /dev/null +++ b/clang/test/Modules/Inputs/PR20786/TMath.h @@ -0,0 +1 @@ +#include "random.h" diff --git a/clang/test/Modules/Inputs/PR20786/module.modulemap b/clang/test/Modules/Inputs/PR20786/module.modulemap new file mode 100644 index 000000000000..daf78cd0cd3f --- /dev/null +++ b/clang/test/Modules/Inputs/PR20786/module.modulemap @@ -0,0 +1,3 @@ +module TMath { header "TMath.h" } +module TFormula { header "TFormula.h" } +module TBranchProxy { header "TBranchProxy.h" } diff --git a/clang/test/Modules/Inputs/PR20786/random.h b/clang/test/Modules/Inputs/PR20786/random.h new file mode 100644 index 000000000000..86a7d83c19c0 --- /dev/null +++ b/clang/test/Modules/Inputs/PR20786/random.h @@ -0,0 +1,12 @@ +namespace std { + template struct mersenne_twister_engine { + friend bool operator==(const mersenne_twister_engine &, + const mersenne_twister_engine &) { + return false; + } + }; + struct random_device { + mersenne_twister_engine mt; // require complete type + }; +} + diff --git a/clang/test/Modules/pr20786.cpp b/clang/test/Modules/pr20786.cpp new file mode 100644 index 000000000000..35d62df91cc9 --- /dev/null +++ b/clang/test/Modules/pr20786.cpp @@ -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