summaryrefslogtreecommitdiff
path: root/test/Modules/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Modules/Inputs')
-rw-r--r--test/Modules/Inputs/AddRemovePrivate.framework/Headers/AddRemovePrivate.h1
-rw-r--r--test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.modulemap1
-rw-r--r--test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap1
-rw-r--r--test/Modules/Inputs/PR20399/FirstHeader.h14
-rw-r--r--test/Modules/Inputs/PR20399/SecondHeader.h13
-rw-r--r--test/Modules/Inputs/PR20399/module.modulemap18
-rw-r--r--test/Modules/Inputs/PR20399/stl_map.h13
-rw-r--r--test/Modules/Inputs/PR20399/vector17
-rw-r--r--test/Modules/Inputs/PR20786/TBranchProxy.h2
-rw-r--r--test/Modules/Inputs/PR20786/TFormula.h1
-rw-r--r--test/Modules/Inputs/PR20786/TMath.h1
-rw-r--r--test/Modules/Inputs/PR20786/module.modulemap3
-rw-r--r--test/Modules/Inputs/PR20786/random.h12
-rw-r--r--test/Modules/Inputs/StdDef/include_again.h2
-rw-r--r--test/Modules/Inputs/StdDef/module.map10
-rw-r--r--test/Modules/Inputs/StdDef/ptrdiff_t.h2
-rw-r--r--test/Modules/Inputs/attr-unavailable/module.modulemap4
-rw-r--r--test/Modules/Inputs/attr-unavailable/oneA.h4
-rw-r--r--test/Modules/Inputs/attr-unavailable/oneB.h5
-rw-r--r--test/Modules/Inputs/attr-unavailable/oneC.h3
-rw-r--r--test/Modules/Inputs/attr-unavailable/two.h6
-rw-r--r--test/Modules/Inputs/cxx-decls-imported.h24
-rw-r--r--test/Modules/Inputs/cxx-decls-merged.h26
-rw-r--r--test/Modules/Inputs/cxx-decls-premerged.h3
-rw-r--r--test/Modules/Inputs/cxx-irgen-left.h15
-rw-r--r--test/Modules/Inputs/cxx-irgen-right.h10
-rw-r--r--test/Modules/Inputs/cxx-irgen-top.h35
-rw-r--r--test/Modules/Inputs/cxx-lookup/a.h2
-rw-r--r--test/Modules/Inputs/cxx-lookup/b.h3
-rw-r--r--test/Modules/Inputs/cxx-lookup/c1.h3
-rw-r--r--test/Modules/Inputs/cxx-lookup/c2.h2
-rw-r--r--test/Modules/Inputs/cxx-lookup/module.modulemap8
-rw-r--r--test/Modules/Inputs/cxx-lookup/x.h2
-rw-r--r--test/Modules/Inputs/cxx-lookup/y.h5
-rw-r--r--test/Modules/Inputs/cxx-templates-a.h31
-rw-r--r--test/Modules/Inputs/cxx-templates-b.h21
-rw-r--r--test/Modules/Inputs/cxx-templates-c.h15
-rw-r--r--test/Modules/Inputs/cxx-templates-common.h18
-rw-r--r--test/Modules/Inputs/cxx-templates-d.h9
-rw-r--r--test/Modules/Inputs/cxx-templates-textual.h2
-rw-r--r--test/Modules/Inputs/declare-use/k.h8
-rw-r--r--test/Modules/Inputs/declare-use/l.h8
-rw-r--r--test/Modules/Inputs/declare-use/m.h8
-rw-r--r--test/Modules/Inputs/declare-use/m2.h1
-rw-r--r--test/Modules/Inputs/declare-use/module.map14
-rw-r--r--test/Modules/Inputs/dependency-gen-base.modulemap6
-rw-r--r--test/Modules/Inputs/dependency-gen-base2.modulemap4
-rw-r--r--test/Modules/Inputs/dependency-gen-included.h9
-rw-r--r--test/Modules/Inputs/dependency-gen-included2.h7
-rw-r--r--test/Modules/Inputs/dependency-gen.h11
-rw-r--r--test/Modules/Inputs/diamond_left.h2
-rw-r--r--test/Modules/Inputs/diamond_top.h1
-rw-r--r--test/Modules/Inputs/explicit-build/a.h5
-rw-r--r--test/Modules/Inputs/explicit-build/b.h7
-rw-r--r--test/Modules/Inputs/explicit-build/c.h7
-rw-r--r--test/Modules/Inputs/explicit-build/module.modulemap3
-rw-r--r--test/Modules/Inputs/filename/a.h1
-rw-r--r--test/Modules/Inputs/filename/module.map3
-rw-r--r--test/Modules/Inputs/include_next/x/a.h2
-rw-r--r--test/Modules/Inputs/include_next/x/module.modulemap2
-rw-r--r--test/Modules/Inputs/include_next/x/subdir/b.h2
-rw-r--r--test/Modules/Inputs/include_next/y/a.h1
-rw-r--r--test/Modules/Inputs/include_next/y/b.h1
-rw-r--r--test/Modules/Inputs/include_next/y/module.modulemap2
-rw-r--r--test/Modules/Inputs/inferred-attr/InferredExternC.framework/Headers/InferredExternC.h1
-rw-r--r--test/Modules/Inputs/inferred-attr/module.modulemap1
-rw-r--r--test/Modules/Inputs/macros_bottom.h3
-rw-r--r--test/Modules/Inputs/macros_right_undef.h1
-rw-r--r--test/Modules/Inputs/macros_top.h1
-rw-r--r--test/Modules/Inputs/malformed/c.h1
-rw-r--r--test/Modules/Inputs/malformed/module.map1
-rw-r--r--test/Modules/Inputs/merge-typedefs/a1.h11
-rw-r--r--test/Modules/Inputs/merge-typedefs/a2.h3
-rw-r--r--test/Modules/Inputs/merge-typedefs/b1.h11
-rw-r--r--test/Modules/Inputs/merge-typedefs/b2.h3
-rw-r--r--test/Modules/Inputs/merge-typedefs/module.modulemap9
-rw-r--r--test/Modules/Inputs/merge-using-decls/a.h43
-rw-r--r--test/Modules/Inputs/merge-using-decls/b.h50
-rw-r--r--test/Modules/Inputs/merge-using-decls/module.modulemap2
-rw-r--r--test/Modules/Inputs/modular_maps-moduleb-cwd.map4
-rw-r--r--test/Modules/Inputs/modular_maps/c.h4
-rw-r--r--test/Modules/Inputs/modular_maps/common.h2
-rw-r--r--test/Modules/Inputs/modular_maps/modulea-cwd.map7
-rw-r--r--test/Modules/Inputs/modular_maps/modulec-cwd.map3
-rw-r--r--test/Modules/Inputs/modular_maps/modulec.map3
-rw-r--r--test/Modules/Inputs/module.map16
-rw-r--r--test/Modules/Inputs/odr/a.h6
-rw-r--r--test/Modules/Inputs/odr/b.h8
-rw-r--r--test/Modules/Inputs/pch-used.h1
-rw-r--r--test/Modules/Inputs/pr19692/AIX.h2
-rw-r--r--test/Modules/Inputs/pr19692/Blah.h2
-rw-r--r--test/Modules/Inputs/pr19692/TBlah.h3
-rw-r--r--test/Modules/Inputs/pr19692/TFoo.h1
-rw-r--r--test/Modules/Inputs/pr19692/module.map3
-rw-r--r--test/Modules/Inputs/pr19692/stdint.h2
-rw-r--r--test/Modules/Inputs/preprocess-prefix.h2
-rw-r--r--test/Modules/Inputs/relative-dep-gen-1.h1
-rw-r--r--test/Modules/Inputs/relative-dep-gen-2.h1
-rw-r--r--test/Modules/Inputs/relative-dep-gen-cwd.modulemap4
-rw-r--r--test/Modules/Inputs/relative-dep-gen.modulemap4
-rw-r--r--test/Modules/Inputs/templates-left.h10
-rw-r--r--test/Modules/Inputs/templates-right.h4
-rw-r--r--test/Modules/Inputs/templates-top.h17
-rw-r--r--test/Modules/Inputs/va_list/module.modulemap2
-rw-r--r--test/Modules/Inputs/va_list/va_list_a.h1
-rw-r--r--test/Modules/Inputs/va_list/va_list_b.h2
-rw-r--r--test/Modules/Inputs/warn-unused-local-typedef.h1
107 files changed, 737 insertions, 2 deletions
diff --git a/test/Modules/Inputs/AddRemovePrivate.framework/Headers/AddRemovePrivate.h b/test/Modules/Inputs/AddRemovePrivate.framework/Headers/AddRemovePrivate.h
new file mode 100644
index 000000000000..3ab77431aa2c
--- /dev/null
+++ b/test/Modules/Inputs/AddRemovePrivate.framework/Headers/AddRemovePrivate.h
@@ -0,0 +1 @@
+// AddRemovePrivate.h
diff --git a/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.modulemap b/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.modulemap
new file mode 100644
index 000000000000..7d84297a970f
--- /dev/null
+++ b/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.modulemap
@@ -0,0 +1 @@
+framework module AddRemovePrivate { umbrella header "AddRemovePrivate.h" }
diff --git a/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap b/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap
new file mode 100644
index 000000000000..69b67c2cee7a
--- /dev/null
+++ b/test/Modules/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap
@@ -0,0 +1 @@
+explicit module AddRemovePrivate.Private { }
diff --git a/test/Modules/Inputs/PR20399/FirstHeader.h b/test/Modules/Inputs/PR20399/FirstHeader.h
new file mode 100644
index 000000000000..43adf3d847ed
--- /dev/null
+++ b/test/Modules/Inputs/PR20399/FirstHeader.h
@@ -0,0 +1,14 @@
+#ifndef FIRSTHEADER
+#define FIRSTHEADER
+
+#include "SecondHeader.h" // Just a class which gets in the lazy deserialization chain
+
+#include "stl_map.h"
+#include "vector"
+typedef std::map<int>::iterator el;
+
+inline void func() {
+ std::vector<int>::func();
+}
+
+#endif
diff --git a/test/Modules/Inputs/PR20399/SecondHeader.h b/test/Modules/Inputs/PR20399/SecondHeader.h
new file mode 100644
index 000000000000..92815e996482
--- /dev/null
+++ b/test/Modules/Inputs/PR20399/SecondHeader.h
@@ -0,0 +1,13 @@
+#ifndef SECONDHEADER
+#define SECONDHEADER
+
+#include "vector"
+
+template <class T>
+struct Address {};
+
+template <>
+struct Address<std::vector<bool>>
+ : Address<std::vector<bool>::iterator> {};
+
+#endif
diff --git a/test/Modules/Inputs/PR20399/module.modulemap b/test/Modules/Inputs/PR20399/module.modulemap
new file mode 100644
index 000000000000..223434adba19
--- /dev/null
+++ b/test/Modules/Inputs/PR20399/module.modulemap
@@ -0,0 +1,18 @@
+module stdlib [system] {
+ header "stl_map.h"
+ header "vector"
+ }
+
+module libCore {
+ header "SecondHeader.h"
+ use stdlib
+ export *
+}
+
+module libGdml {
+ header "FirstHeader.h"
+ use libCore
+ use stdlib
+ export *
+}
+
diff --git a/test/Modules/Inputs/PR20399/stl_map.h b/test/Modules/Inputs/PR20399/stl_map.h
new file mode 100644
index 000000000000..334f8b308f40
--- /dev/null
+++ b/test/Modules/Inputs/PR20399/stl_map.h
@@ -0,0 +1,13 @@
+namespace std {
+struct reverse_iterator {};
+
+inline void
+operator-(int __x, reverse_iterator __y) {}
+
+template <typename _Key>
+struct map {
+ typedef int iterator;
+
+ friend bool operator<(const map &, const map &);
+};
+} // namespace std
diff --git a/test/Modules/Inputs/PR20399/vector b/test/Modules/Inputs/PR20399/vector
new file mode 100644
index 000000000000..1e1b6705f51b
--- /dev/null
+++ b/test/Modules/Inputs/PR20399/vector
@@ -0,0 +1,17 @@
+namespace std {
+template <typename _Tp, typename _Alloc = int>
+struct vector {
+ static void func() { vector *i, *j; i - j; }
+};
+
+struct bit_iterator { ~bit_iterator() {} };
+
+inline void operator-(int __x, const bit_iterator &__y) {
+}
+
+template <typename _Alloc>
+struct vector<bool, _Alloc> : bit_iterator {
+ typedef bit_iterator iterator;
+};
+
+} // namespace std
diff --git a/test/Modules/Inputs/PR20786/TBranchProxy.h b/test/Modules/Inputs/PR20786/TBranchProxy.h
new file mode 100644
index 000000000000..91f3730c3b88
--- /dev/null
+++ b/test/Modules/Inputs/PR20786/TBranchProxy.h
@@ -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
index 000000000000..316e3ad7222b
--- /dev/null
+++ b/test/Modules/Inputs/PR20786/TFormula.h
@@ -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
index 000000000000..b7dba620f7d1
--- /dev/null
+++ b/test/Modules/Inputs/PR20786/TMath.h
@@ -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
index 000000000000..daf78cd0cd3f
--- /dev/null
+++ b/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/test/Modules/Inputs/PR20786/random.h b/test/Modules/Inputs/PR20786/random.h
new file mode 100644
index 000000000000..86a7d83c19c0
--- /dev/null
+++ b/test/Modules/Inputs/PR20786/random.h
@@ -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/Inputs/StdDef/include_again.h b/test/Modules/Inputs/StdDef/include_again.h
new file mode 100644
index 000000000000..f29f6366cc69
--- /dev/null
+++ b/test/Modules/Inputs/StdDef/include_again.h
@@ -0,0 +1,2 @@
+#include <stddef.h>
+
diff --git a/test/Modules/Inputs/StdDef/module.map b/test/Modules/Inputs/StdDef/module.map
index 69c69eac35b5..5c4e0dae7ba6 100644
--- a/test/Modules/Inputs/StdDef/module.map
+++ b/test/Modules/Inputs/StdDef/module.map
@@ -8,4 +8,14 @@ module StdDef {
header "other.h"
export *
}
+
+ module PtrDiffT {
+ header "ptrdiff_t.h"
+ export *
+ }
+
+ module IncludeAgain {
+ header "include_again.h"
+ export *
+ }
}
diff --git a/test/Modules/Inputs/StdDef/ptrdiff_t.h b/test/Modules/Inputs/StdDef/ptrdiff_t.h
new file mode 100644
index 000000000000..acb0ab81ffc7
--- /dev/null
+++ b/test/Modules/Inputs/StdDef/ptrdiff_t.h
@@ -0,0 +1,2 @@
+#define __need_ptrdiff_t
+#include <stddef.h>
diff --git a/test/Modules/Inputs/attr-unavailable/module.modulemap b/test/Modules/Inputs/attr-unavailable/module.modulemap
new file mode 100644
index 000000000000..a5159420c22c
--- /dev/null
+++ b/test/Modules/Inputs/attr-unavailable/module.modulemap
@@ -0,0 +1,4 @@
+module two { header "two.h" }
+module oneA { header "oneA.h" }
+module oneB { header "oneB.h" export oneA }
+module oneC { header "oneC.h" }
diff --git a/test/Modules/Inputs/attr-unavailable/oneA.h b/test/Modules/Inputs/attr-unavailable/oneA.h
new file mode 100644
index 000000000000..a4e572ffacd9
--- /dev/null
+++ b/test/Modules/Inputs/attr-unavailable/oneA.h
@@ -0,0 +1,4 @@
+@interface C
+-(void)method2 __attribute__((unavailable));
+-(void)method3 __attribute__((unavailable));
+@end
diff --git a/test/Modules/Inputs/attr-unavailable/oneB.h b/test/Modules/Inputs/attr-unavailable/oneB.h
new file mode 100644
index 000000000000..b9536ad15ba7
--- /dev/null
+++ b/test/Modules/Inputs/attr-unavailable/oneB.h
@@ -0,0 +1,5 @@
+@import oneA;
+
+@interface D
+-(void)method2;
+@end
diff --git a/test/Modules/Inputs/attr-unavailable/oneC.h b/test/Modules/Inputs/attr-unavailable/oneC.h
new file mode 100644
index 000000000000..9dc305e70fb4
--- /dev/null
+++ b/test/Modules/Inputs/attr-unavailable/oneC.h
@@ -0,0 +1,3 @@
+@interface E
+-(void)method3;
+@end
diff --git a/test/Modules/Inputs/attr-unavailable/two.h b/test/Modules/Inputs/attr-unavailable/two.h
new file mode 100644
index 000000000000..0423f610108d
--- /dev/null
+++ b/test/Modules/Inputs/attr-unavailable/two.h
@@ -0,0 +1,6 @@
+@interface A
+-(void)method1;
+@end
+@interface B
+-(void)method1 __attribute__((unavailable));
+@end
diff --git a/test/Modules/Inputs/cxx-decls-imported.h b/test/Modules/Inputs/cxx-decls-imported.h
index 38cc00d863f2..8c1e74f17c3c 100644
--- a/test/Modules/Inputs/cxx-decls-imported.h
+++ b/test/Modules/Inputs/cxx-decls-imported.h
@@ -23,3 +23,27 @@ void *operator new[](__SIZE_TYPE__);
extern int mergeUsedFlag;
inline int getMergeUsedFlag() { return mergeUsedFlag; }
+
+typedef struct {
+ int n;
+ int m;
+} NameForLinkage;
+
+struct HasVirtualFunctions {
+ virtual void f();
+};
+struct OverridesVirtualFunctions : HasVirtualFunctions {
+ void f();
+};
+extern "C" void ExternCFunction();
+
+typedef struct {
+ struct Inner {
+ int n;
+ };
+} NameForLinkage2;
+auto name_for_linkage2_inner_a = NameForLinkage2::Inner();
+typedef decltype(name_for_linkage2_inner_a) NameForLinkage2Inner;
+
+namespace Aliased { extern int a; }
+namespace Alias = Aliased;
diff --git a/test/Modules/Inputs/cxx-decls-merged.h b/test/Modules/Inputs/cxx-decls-merged.h
index ccc3b0154872..86e81a9bb681 100644
--- a/test/Modules/Inputs/cxx-decls-merged.h
+++ b/test/Modules/Inputs/cxx-decls-merged.h
@@ -1 +1,27 @@
extern int mergeUsedFlag;
+
+typedef struct {
+ int n;
+ int m;
+} NameForLinkage;
+extern NameForLinkage name_for_linkage;
+
+struct HasVirtualFunctions {
+ virtual void f();
+};
+struct OverridesVirtualFunctions : HasVirtualFunctions {
+ void f();
+};
+extern OverridesVirtualFunctions overrides_virtual_functions;
+extern "C" void ExternCFunction();
+
+typedef struct {
+ struct Inner {
+ int n;
+ };
+} NameForLinkage2;
+auto name_for_linkage2_inner_b = NameForLinkage2::Inner();
+typedef decltype(name_for_linkage2_inner_b) NameForLinkage2Inner;
+
+namespace Aliased { extern int b; }
+namespace Alias = Aliased;
diff --git a/test/Modules/Inputs/cxx-decls-premerged.h b/test/Modules/Inputs/cxx-decls-premerged.h
new file mode 100644
index 000000000000..064fb9ea67bb
--- /dev/null
+++ b/test/Modules/Inputs/cxx-decls-premerged.h
@@ -0,0 +1,3 @@
+extern "C" void ExternCFunction();
+
+#include "cxx-decls-imported.h"
diff --git a/test/Modules/Inputs/cxx-irgen-left.h b/test/Modules/Inputs/cxx-irgen-left.h
index ceb50846bbf4..31ae805c9a19 100644
--- a/test/Modules/Inputs/cxx-irgen-left.h
+++ b/test/Modules/Inputs/cxx-irgen-left.h
@@ -9,3 +9,18 @@ inline int instantiate_min() {
inline int instantiate_CtorInit(CtorInit<int> i = CtorInit<int>()) {
return i.a;
}
+
+namespace ImplicitSpecialMembers {
+ inline void create_left() {
+ // Trigger declaration, but not definition, of special members.
+ B b(0); C c(0); D d(0);
+ // Trigger definition of copy constructor.
+ C c2(c); D d2(d);
+ }
+}
+
+namespace OperatorDeleteLookup {
+ // Trigger definition of A::~A() and lookup of operator delete.
+ // Likewise for B<int>::~B().
+ inline void f() { A a; B<int> b; }
+}
diff --git a/test/Modules/Inputs/cxx-irgen-right.h b/test/Modules/Inputs/cxx-irgen-right.h
index 4400c760f07a..30686a12479a 100644
--- a/test/Modules/Inputs/cxx-irgen-right.h
+++ b/test/Modules/Inputs/cxx-irgen-right.h
@@ -1,3 +1,13 @@
#include "cxx-irgen-top.h"
inline int h() { return S<int>::f(); }
+
+namespace ImplicitSpecialMembers {
+ inline void create_right() {
+ // Trigger declaration, but not definition, of special members.
+ B b(0); C c(0); D d(0);
+ // Trigger definition of move constructor.
+ B b2(static_cast<B&&>(b));
+ D d2(static_cast<D&&>(d));
+ }
+}
diff --git a/test/Modules/Inputs/cxx-irgen-top.h b/test/Modules/Inputs/cxx-irgen-top.h
index 8753d8daa3dc..f1a0bee21250 100644
--- a/test/Modules/Inputs/cxx-irgen-top.h
+++ b/test/Modules/Inputs/cxx-irgen-top.h
@@ -14,3 +14,38 @@ template<typename T> struct CtorInit {
int a;
CtorInit() : a(f()) {}
};
+
+namespace ImplicitSpecialMembers {
+ struct A {
+ A(const A&);
+ };
+ struct B {
+ A a;
+ B(int);
+ };
+ struct C {
+ A a;
+ C(int);
+ };
+ struct D {
+ A a;
+ D(int);
+ };
+}
+
+namespace OperatorDeleteLookup {
+ struct A { void operator delete(void*); virtual ~A() = default; };
+ template<typename T> struct B { void operator delete(void*); virtual ~B() {} typedef int t; };
+ typedef B<int>::t b_int_instantated;
+}
+
+namespace EmitInlineMethods {
+ struct A {
+ void f() {}
+ void g();
+ };
+ struct B {
+ void f();
+ void g() {}
+ };
+}
diff --git a/test/Modules/Inputs/cxx-lookup/a.h b/test/Modules/Inputs/cxx-lookup/a.h
new file mode 100644
index 000000000000..25f614fe50b9
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/a.h
@@ -0,0 +1,2 @@
+// a
+namespace llvm { class GlobalValue; }
diff --git a/test/Modules/Inputs/cxx-lookup/b.h b/test/Modules/Inputs/cxx-lookup/b.h
new file mode 100644
index 000000000000..c2ede9f28dc2
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/b.h
@@ -0,0 +1,3 @@
+// b
+namespace llvm { class GlobalValue; }
+#include "y.h"
diff --git a/test/Modules/Inputs/cxx-lookup/c1.h b/test/Modules/Inputs/cxx-lookup/c1.h
new file mode 100644
index 000000000000..dba4a4c0a00e
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/c1.h
@@ -0,0 +1,3 @@
+// c1
+#include "a.h"
+#include "b.h"
diff --git a/test/Modules/Inputs/cxx-lookup/c2.h b/test/Modules/Inputs/cxx-lookup/c2.h
new file mode 100644
index 000000000000..463e270e267a
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/c2.h
@@ -0,0 +1,2 @@
+// c2
+namespace llvm { class GlobalValue; }
diff --git a/test/Modules/Inputs/cxx-lookup/module.modulemap b/test/Modules/Inputs/cxx-lookup/module.modulemap
new file mode 100644
index 000000000000..6d397af250c8
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/module.modulemap
@@ -0,0 +1,8 @@
+module A { header "a.h" export * }
+module B { header "b.h" export * }
+module C {
+ module C2 { header "c2.h" export * }
+ module C1 { header "c1.h" export * }
+}
+module X { header "x.h" export * }
+module Y { header "y.h" export * }
diff --git a/test/Modules/Inputs/cxx-lookup/x.h b/test/Modules/Inputs/cxx-lookup/x.h
new file mode 100644
index 000000000000..a8826e005817
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/x.h
@@ -0,0 +1,2 @@
+template <class T> class allocator;
+struct X { virtual allocator<char> f(); };
diff --git a/test/Modules/Inputs/cxx-lookup/y.h b/test/Modules/Inputs/cxx-lookup/y.h
new file mode 100644
index 000000000000..8867e8a8becd
--- /dev/null
+++ b/test/Modules/Inputs/cxx-lookup/y.h
@@ -0,0 +1,5 @@
+#include "x.h"
+namespace llvm {
+ struct ulittle32_t;
+ extern allocator<ulittle32_t> *x;
+}
diff --git a/test/Modules/Inputs/cxx-templates-a.h b/test/Modules/Inputs/cxx-templates-a.h
index c95dc6325e49..4340910d1e2a 100644
--- a/test/Modules/Inputs/cxx-templates-a.h
+++ b/test/Modules/Inputs/cxx-templates-a.h
@@ -29,6 +29,8 @@ void use_some_template_a() {
SomeTemplate<char[2]> a;
SomeTemplate<char[1]> b, c;
b = c;
+
+ (void)&WithImplicitSpecialMembers<int>::n;
}
template<int> struct MergeTemplates;
@@ -56,6 +58,7 @@ template<typename T> struct WithPartialSpecialization<T*> {
T &f() { static T t; return t; }
};
typedef WithPartialSpecializationUse::type WithPartialSpecializationInstantiate;
+typedef WithPartialSpecialization<void(int)>::type WithPartialSpecializationInstantiate2;
template<> struct WithExplicitSpecialization<int> {
int n;
@@ -73,3 +76,31 @@ template<typename T> struct MergeTemplateDefinitions {
static constexpr int g();
};
template<typename T> constexpr int MergeTemplateDefinitions<T>::f() { return 1; }
+
+template<typename T> using AliasTemplate = T;
+
+template<typename T> struct PartiallyInstantiatePartialSpec {};
+template<typename T> struct PartiallyInstantiatePartialSpec<T*> {
+ static T *foo() { return reinterpret_cast<T*>(0); }
+ static T *bar() { return reinterpret_cast<T*>(0); }
+};
+typedef PartiallyInstantiatePartialSpec<int*> PartiallyInstantiatePartialSpecHelper;
+
+void InstantiateWithAliasTemplate(WithAliasTemplate<int>::X<char>);
+inline int InstantiateWithAnonymousDeclsA(WithAnonymousDecls<int> x) { return (x.k ? x.a : x.b) + (x.k ? x.s.c : x.s.d) + x.e; }
+inline int InstantiateWithAnonymousDeclsB2(WithAnonymousDecls<char> x);
+
+
+template<typename T1 = int>
+struct MergeAnonUnionMember {
+ MergeAnonUnionMember() { (void)values.t1; }
+ union { int t1; } values;
+};
+inline MergeAnonUnionMember<> maum_a() { return {}; }
+
+template<typename T> struct DontWalkPreviousDeclAfterMerging { struct Inner { typedef T type; }; };
+
+namespace TestInjectedClassName {
+ template<typename T> struct X { X(); };
+ typedef X<char[1]> A;
+}
diff --git a/test/Modules/Inputs/cxx-templates-b.h b/test/Modules/Inputs/cxx-templates-b.h
index efd07c617e52..d763c8040ba3 100644
--- a/test/Modules/Inputs/cxx-templates-b.h
+++ b/test/Modules/Inputs/cxx-templates-b.h
@@ -24,6 +24,11 @@ template<typename T> template<typename U>
constexpr int Outer<T>::Inner<U>::g() { return 2; }
static_assert(Outer<int>::Inner<int>::g() == 2, "");
+namespace TestInjectedClassName {
+ template<typename T> struct X { X(); };
+ typedef X<char[2]> B;
+}
+
@import cxx_templates_b_impl;
template<typename T, typename> struct Identity { typedef T type; };
@@ -46,6 +51,8 @@ void use_some_template_b() {
SomeTemplate<char[1]> a;
SomeTemplate<char[2]> b, c;
b = c;
+
+ WithImplicitSpecialMembers<int> wism1, wism2(wism1);
}
auto enum_b_from_b = CommonTemplate<int>::b;
@@ -55,6 +62,8 @@ template<int> struct UseInt;
template<typename T> void UseRedeclaredEnum(UseInt<T() + CommonTemplate<char>::a>);
constexpr void (*UseRedeclaredEnumB)(UseInt<1>) = UseRedeclaredEnum<int>;
+typedef WithPartialSpecialization<void(int)>::type WithPartialSpecializationInstantiate3;
+
template<typename> struct MergeSpecializations;
template<typename T> struct MergeSpecializations<T&> {
typedef int partially_specialized_in_b;
@@ -63,6 +72,16 @@ template<> struct MergeSpecializations<double> {
typedef int explicitly_specialized_in_b;
};
+template<typename U> using AliasTemplate = U;
+
+void InstantiateWithAliasTemplate(WithAliasTemplate<int>::X<char>);
+inline int InstantiateWithAnonymousDeclsB(WithAnonymousDecls<int> x) {
+ return (x.k ? x.a : x.b) + (x.k ? x.s.c : x.s.d) + x.e;
+}
+inline int InstantiateWithAnonymousDeclsB2(WithAnonymousDecls<char> x) {
+ return (x.k ? x.a : x.b) + (x.k ? x.s.c : x.s.d) + x.e;
+}
+
@import cxx_templates_a;
template<typename T> void UseDefinedInBImplIndirectly(T &v) {
PerformDelayedLookup(v);
@@ -71,4 +90,6 @@ template<typename T> void UseDefinedInBImplIndirectly(T &v) {
void TriggerInstantiation() {
UseDefinedInBImpl<void>();
Std::f<int>();
+ PartiallyInstantiatePartialSpec<int*>::foo();
+ WithPartialSpecialization<void(int)>::type x;
}
diff --git a/test/Modules/Inputs/cxx-templates-c.h b/test/Modules/Inputs/cxx-templates-c.h
index 6daffadc6ced..e5395b6c7ed8 100644
--- a/test/Modules/Inputs/cxx-templates-c.h
+++ b/test/Modules/Inputs/cxx-templates-c.h
@@ -11,3 +11,18 @@ template<typename T> struct MergeTemplateDefinitions {
static constexpr int g();
};
template<typename T> constexpr int MergeTemplateDefinitions<T>::g() { return 2; }
+
+template<typename T1 = int>
+struct MergeAnonUnionMember {
+ MergeAnonUnionMember() { (void)values.t1; }
+ union { int t1; } values;
+};
+inline MergeAnonUnionMember<> maum_c() { return {}; }
+
+template<typename T> struct DontWalkPreviousDeclAfterMerging { struct Inner { typedef T type; }; };
+typedef DontWalkPreviousDeclAfterMerging<char>::Inner dwpdam_typedef;
+
+namespace TestInjectedClassName {
+ template<typename T> struct X { X(); };
+ typedef X<char[3]> C;
+}
diff --git a/test/Modules/Inputs/cxx-templates-common.h b/test/Modules/Inputs/cxx-templates-common.h
index 682ef939cec0..a9ca62448671 100644
--- a/test/Modules/Inputs/cxx-templates-common.h
+++ b/test/Modules/Inputs/cxx-templates-common.h
@@ -32,7 +32,25 @@ template<typename T> struct Outer {
};
template<typename T> struct WithPartialSpecialization {};
+template<typename T> struct WithPartialSpecialization<void(T)> { typedef int type; };
typedef WithPartialSpecialization<int*> WithPartialSpecializationUse;
+typedef WithPartialSpecialization<void(int)> WithPartialSpecializationUse2;
template<typename T> struct WithExplicitSpecialization;
typedef WithExplicitSpecialization<int> WithExplicitSpecializationUse;
+
+template<typename T> struct WithImplicitSpecialMembers { int n; };
+
+template<typename T> struct WithAliasTemplate {
+ template<typename> using X = T;
+};
+
+template<typename T> struct WithAnonymousDecls {
+ struct { bool k; };
+ union { int a, b; };
+ struct { int c, d; } s;
+ enum { e = 123 };
+ typedef int X;
+};
+
+#include "cxx-templates-textual.h"
diff --git a/test/Modules/Inputs/cxx-templates-d.h b/test/Modules/Inputs/cxx-templates-d.h
new file mode 100644
index 000000000000..1fb1a2282b96
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-d.h
@@ -0,0 +1,9 @@
+@import cxx_templates_common;
+
+inline int InstantiateWithAnonymousDeclsD(WithAnonymousDecls<char> x) { return (x.k ? x.a : x.b) + (x.k ? x.s.c : x.s.d) + x.e; }
+
+namespace TestInjectedClassName {
+ template<typename T> struct X { X(); };
+ typedef X<int> D;
+ inline D UseD() { return D(); }
+}
diff --git a/test/Modules/Inputs/cxx-templates-textual.h b/test/Modules/Inputs/cxx-templates-textual.h
new file mode 100644
index 000000000000..8bffb8eddc28
--- /dev/null
+++ b/test/Modules/Inputs/cxx-templates-textual.h
@@ -0,0 +1,2 @@
+template<typename T> struct MergeClassTemplateSpecializations_basic_string {};
+typedef MergeClassTemplateSpecializations_basic_string<char> MergeClassTemplateSpecializations_string;
diff --git a/test/Modules/Inputs/declare-use/k.h b/test/Modules/Inputs/declare-use/k.h
new file mode 100644
index 000000000000..338178e86cb3
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/k.h
@@ -0,0 +1,8 @@
+#ifdef GIMME_A_K
+
+#ifndef K_H
+#define K_H
+const int k = 42;
+#endif
+
+#endif
diff --git a/test/Modules/Inputs/declare-use/l.h b/test/Modules/Inputs/declare-use/l.h
new file mode 100644
index 000000000000..a43fd1a3d063
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/l.h
@@ -0,0 +1,8 @@
+#ifdef GIMME_AN_L
+
+#ifndef L_H
+#define L_H
+const int l = 42;
+#endif
+
+#endif
diff --git a/test/Modules/Inputs/declare-use/m.h b/test/Modules/Inputs/declare-use/m.h
new file mode 100644
index 000000000000..e9089ab725d5
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/m.h
@@ -0,0 +1,8 @@
+#ifdef GIMME_AN_M
+
+#ifndef M_H
+#define M_H
+const int m = 42;
+#endif
+
+#endif
diff --git a/test/Modules/Inputs/declare-use/m2.h b/test/Modules/Inputs/declare-use/m2.h
new file mode 100644
index 000000000000..9e72835c3bce
--- /dev/null
+++ b/test/Modules/Inputs/declare-use/m2.h
@@ -0,0 +1 @@
+#include "m.h"
diff --git a/test/Modules/Inputs/declare-use/module.map b/test/Modules/Inputs/declare-use/module.map
index a176fb3a141f..ae8615278aca 100644
--- a/test/Modules/Inputs/declare-use/module.map
+++ b/test/Modules/Inputs/declare-use/module.map
@@ -38,6 +38,7 @@ module XG {
use XC
use XE
use XJ
+ use XK
}
module XH {
@@ -52,5 +53,18 @@ module XJ {
header "j.h"
}
+module XK {
+ textual header "k.h"
+}
+
+module XL {
+ textual header "l.h"
+}
+
+module XM {
+ private textual header "m.h"
+ textual header "m2.h"
+}
+
module XS {
}
diff --git a/test/Modules/Inputs/dependency-gen-base.modulemap b/test/Modules/Inputs/dependency-gen-base.modulemap
new file mode 100644
index 000000000000..8b30ffa67455
--- /dev/null
+++ b/test/Modules/Inputs/dependency-gen-base.modulemap
@@ -0,0 +1,6 @@
+module "test-base" {
+ export *
+ header "Inputs/dependency-gen-included.h"
+ use "test-base2"
+}
+extern module "test-base2" "Inputs/dependency-gen-base2.modulemap"
diff --git a/test/Modules/Inputs/dependency-gen-base2.modulemap b/test/Modules/Inputs/dependency-gen-base2.modulemap
new file mode 100644
index 000000000000..7808c8041aec
--- /dev/null
+++ b/test/Modules/Inputs/dependency-gen-base2.modulemap
@@ -0,0 +1,4 @@
+module "test-base2" {
+ export *
+ textual header "Inputs/dependency-gen-included2.h"
+}
diff --git a/test/Modules/Inputs/dependency-gen-included.h b/test/Modules/Inputs/dependency-gen-included.h
new file mode 100644
index 000000000000..0e1cdfcd1e18
--- /dev/null
+++ b/test/Modules/Inputs/dependency-gen-included.h
@@ -0,0 +1,9 @@
+//#ifndef DEPENDENCY_GEN_INCLUDED_H
+//#define DEPENDENCY_GEN_INCLUDED_H
+
+#include "Inputs/dependency-gen-included2.h"
+
+void g() {
+}
+
+//#endif
diff --git a/test/Modules/Inputs/dependency-gen-included2.h b/test/Modules/Inputs/dependency-gen-included2.h
new file mode 100644
index 000000000000..fcd8f12ba5ad
--- /dev/null
+++ b/test/Modules/Inputs/dependency-gen-included2.h
@@ -0,0 +1,7 @@
+#ifndef DEPENDENCY_GEN_INCLUDED2_H
+#define DEPENDENCY_GEN_INCLUDED2_H
+
+void h() {
+}
+
+#endif
diff --git a/test/Modules/Inputs/dependency-gen.h b/test/Modules/Inputs/dependency-gen.h
new file mode 100644
index 000000000000..2671e262c6ac
--- /dev/null
+++ b/test/Modules/Inputs/dependency-gen.h
@@ -0,0 +1,11 @@
+//#ifndef DEPENDENCY_GEN_H
+//#define DEPENDENCY_GEN_H
+
+#include "dependency-gen-included.h"
+
+void f() {
+ g();
+ h();
+}
+
+//#endif
diff --git a/test/Modules/Inputs/diamond_left.h b/test/Modules/Inputs/diamond_left.h
index fce2e48882f8..6494551e4bfa 100644
--- a/test/Modules/Inputs/diamond_left.h
+++ b/test/Modules/Inputs/diamond_left.h
@@ -1,3 +1,5 @@
+int top_left_before(void *);
+
@import diamond_top;
float left(float *);
diff --git a/test/Modules/Inputs/diamond_top.h b/test/Modules/Inputs/diamond_top.h
index 34998cd4324b..30da14f6449b 100644
--- a/test/Modules/Inputs/diamond_top.h
+++ b/test/Modules/Inputs/diamond_top.h
@@ -2,3 +2,4 @@ int top(int *);
int top_left(char *c);
+int top_left_before(void *);
diff --git a/test/Modules/Inputs/explicit-build/a.h b/test/Modules/Inputs/explicit-build/a.h
new file mode 100644
index 000000000000..5e3602f58ffe
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build/a.h
@@ -0,0 +1,5 @@
+#if !__building_module(a)
+#error "should only get here when building module a"
+#endif
+
+const int a = 1;
diff --git a/test/Modules/Inputs/explicit-build/b.h b/test/Modules/Inputs/explicit-build/b.h
new file mode 100644
index 000000000000..449b3859ab45
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build/b.h
@@ -0,0 +1,7 @@
+#include "a.h"
+
+#if !__building_module(b)
+#error "should only get here when building module b"
+#endif
+
+const int b = 2;
diff --git a/test/Modules/Inputs/explicit-build/c.h b/test/Modules/Inputs/explicit-build/c.h
new file mode 100644
index 000000000000..2c66a23e8927
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build/c.h
@@ -0,0 +1,7 @@
+#include "b.h"
+
+#if !__building_module(c)
+#error "should only get here when building module c"
+#endif
+
+const int c = 3;
diff --git a/test/Modules/Inputs/explicit-build/module.modulemap b/test/Modules/Inputs/explicit-build/module.modulemap
new file mode 100644
index 000000000000..bd6ea830c2d4
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build/module.modulemap
@@ -0,0 +1,3 @@
+module a { header "a.h" }
+module b { header "b.h" export * }
+module c { header "c.h" export * }
diff --git a/test/Modules/Inputs/filename/a.h b/test/Modules/Inputs/filename/a.h
new file mode 100644
index 000000000000..8f896a9ba8f4
--- /dev/null
+++ b/test/Modules/Inputs/filename/a.h
@@ -0,0 +1 @@
+const char *p = __FILE__;
diff --git a/test/Modules/Inputs/filename/module.map b/test/Modules/Inputs/filename/module.map
new file mode 100644
index 000000000000..ff164ad7bac8
--- /dev/null
+++ b/test/Modules/Inputs/filename/module.map
@@ -0,0 +1,3 @@
+module "A" {
+ header "a.h"
+}
diff --git a/test/Modules/Inputs/include_next/x/a.h b/test/Modules/Inputs/include_next/x/a.h
new file mode 100644
index 000000000000..71822876313a
--- /dev/null
+++ b/test/Modules/Inputs/include_next/x/a.h
@@ -0,0 +1,2 @@
+#include_next "a.h"
+enum { ax = 1 };
diff --git a/test/Modules/Inputs/include_next/x/module.modulemap b/test/Modules/Inputs/include_next/x/module.modulemap
new file mode 100644
index 000000000000..d0956d98ab84
--- /dev/null
+++ b/test/Modules/Inputs/include_next/x/module.modulemap
@@ -0,0 +1,2 @@
+module xa { header "a.h" export * }
+module xb { header "subdir/b.h" export * }
diff --git a/test/Modules/Inputs/include_next/x/subdir/b.h b/test/Modules/Inputs/include_next/x/subdir/b.h
new file mode 100644
index 000000000000..d9449e11a32f
--- /dev/null
+++ b/test/Modules/Inputs/include_next/x/subdir/b.h
@@ -0,0 +1,2 @@
+#include_next <b.h>
+enum { bx = 3 };
diff --git a/test/Modules/Inputs/include_next/y/a.h b/test/Modules/Inputs/include_next/y/a.h
new file mode 100644
index 000000000000..703ec958785d
--- /dev/null
+++ b/test/Modules/Inputs/include_next/y/a.h
@@ -0,0 +1 @@
+enum { ay = 2 };
diff --git a/test/Modules/Inputs/include_next/y/b.h b/test/Modules/Inputs/include_next/y/b.h
new file mode 100644
index 000000000000..629e7fde1fe2
--- /dev/null
+++ b/test/Modules/Inputs/include_next/y/b.h
@@ -0,0 +1 @@
+enum { by = 4 };
diff --git a/test/Modules/Inputs/include_next/y/module.modulemap b/test/Modules/Inputs/include_next/y/module.modulemap
new file mode 100644
index 000000000000..5dc3c535cefc
--- /dev/null
+++ b/test/Modules/Inputs/include_next/y/module.modulemap
@@ -0,0 +1,2 @@
+module ya { header "a.h" export * }
+module yb { header "b.h" export * }
diff --git a/test/Modules/Inputs/inferred-attr/InferredExternC.framework/Headers/InferredExternC.h b/test/Modules/Inputs/inferred-attr/InferredExternC.framework/Headers/InferredExternC.h
new file mode 100644
index 000000000000..63242fae9a11
--- /dev/null
+++ b/test/Modules/Inputs/inferred-attr/InferredExternC.framework/Headers/InferredExternC.h
@@ -0,0 +1 @@
+// InferredExternC.h
diff --git a/test/Modules/Inputs/inferred-attr/module.modulemap b/test/Modules/Inputs/inferred-attr/module.modulemap
new file mode 100644
index 000000000000..beb6ea159de3
--- /dev/null
+++ b/test/Modules/Inputs/inferred-attr/module.modulemap
@@ -0,0 +1 @@
+framework module * [extern_c] { }
diff --git a/test/Modules/Inputs/macros_bottom.h b/test/Modules/Inputs/macros_bottom.h
new file mode 100644
index 000000000000..fc0a78e46207
--- /dev/null
+++ b/test/Modules/Inputs/macros_bottom.h
@@ -0,0 +1,3 @@
+@import macros_right;
+
+extern TOP_DEF_RIGHT_UNDEF *TDRUp;
diff --git a/test/Modules/Inputs/macros_right_undef.h b/test/Modules/Inputs/macros_right_undef.h
index 15a83666a136..5084561e108b 100644
--- a/test/Modules/Inputs/macros_right_undef.h
+++ b/test/Modules/Inputs/macros_right_undef.h
@@ -2,3 +2,4 @@
@import macros_top;
#undef TOP_OTHER_DEF_RIGHT_UNDEF
+#undef TOP_DEF_RIGHT_UNDEF
diff --git a/test/Modules/Inputs/macros_top.h b/test/Modules/Inputs/macros_top.h
index 10935043e2a1..e063133a172d 100644
--- a/test/Modules/Inputs/macros_top.h
+++ b/test/Modules/Inputs/macros_top.h
@@ -22,3 +22,4 @@
#define TOP_OTHER_DEF_RIGHT_UNDEF void
#define TOP_REDEF_IN_SUBMODULES 0
+#define TOP_DEF_RIGHT_UNDEF void
diff --git a/test/Modules/Inputs/malformed/c.h b/test/Modules/Inputs/malformed/c.h
new file mode 100644
index 000000000000..2cce2ca9caa2
--- /dev/null
+++ b/test/Modules/Inputs/malformed/c.h
@@ -0,0 +1 @@
+template<typename T> void f() { T::error; }
diff --git a/test/Modules/Inputs/malformed/module.map b/test/Modules/Inputs/malformed/module.map
index 5277ffa41edd..3f088d1431d9 100644
--- a/test/Modules/Inputs/malformed/module.map
+++ b/test/Modules/Inputs/malformed/module.map
@@ -6,3 +6,4 @@ module malformed_b {
module b1 { header "b1.h" }
module b2 { header "b2.h" }
}
+module c { header "c.h" }
diff --git a/test/Modules/Inputs/merge-typedefs/a1.h b/test/Modules/Inputs/merge-typedefs/a1.h
new file mode 100644
index 000000000000..cacc530c3d0a
--- /dev/null
+++ b/test/Modules/Inputs/merge-typedefs/a1.h
@@ -0,0 +1,11 @@
+#ifndef A1_H
+#define A1_H
+namespace llvm {
+class MachineBasicBlock;
+template <class NodeT> class DomTreeNodeBase;
+typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
+}
+
+typedef struct {} foo_t;
+typedef foo_t foo2_t;
+#endif
diff --git a/test/Modules/Inputs/merge-typedefs/a2.h b/test/Modules/Inputs/merge-typedefs/a2.h
new file mode 100644
index 000000000000..ba306663e3b5
--- /dev/null
+++ b/test/Modules/Inputs/merge-typedefs/a2.h
@@ -0,0 +1,3 @@
+#ifndef A2_H
+#define A2_H
+#endif
diff --git a/test/Modules/Inputs/merge-typedefs/b1.h b/test/Modules/Inputs/merge-typedefs/b1.h
new file mode 100644
index 000000000000..8dde5f6fbadd
--- /dev/null
+++ b/test/Modules/Inputs/merge-typedefs/b1.h
@@ -0,0 +1,11 @@
+#ifndef B1_H
+#define B1_H
+typedef struct {} foo_t;
+typedef foo_t foo2_t;
+#include "a2.h"
+namespace llvm {
+class MachineBasicBlock;
+template <class NodeT> class DomTreeNodeBase;
+typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
+}
+#endif
diff --git a/test/Modules/Inputs/merge-typedefs/b2.h b/test/Modules/Inputs/merge-typedefs/b2.h
new file mode 100644
index 000000000000..75bd63affb16
--- /dev/null
+++ b/test/Modules/Inputs/merge-typedefs/b2.h
@@ -0,0 +1,3 @@
+#ifndef B2_H
+#define B2_H
+#endif
diff --git a/test/Modules/Inputs/merge-typedefs/module.modulemap b/test/Modules/Inputs/merge-typedefs/module.modulemap
new file mode 100644
index 000000000000..4858f1be63ac
--- /dev/null
+++ b/test/Modules/Inputs/merge-typedefs/module.modulemap
@@ -0,0 +1,9 @@
+module A {
+ module A1 { header "a1.h" export * }
+ module A2 { header "a2.h" export * }
+}
+
+module B {
+ module B1 { header "b1.h" export * }
+ module B2 { header "b2.h" export * }
+}
diff --git a/test/Modules/Inputs/merge-using-decls/a.h b/test/Modules/Inputs/merge-using-decls/a.h
new file mode 100644
index 000000000000..0fe0067bf23c
--- /dev/null
+++ b/test/Modules/Inputs/merge-using-decls/a.h
@@ -0,0 +1,43 @@
+struct X {
+ int v;
+ typedef int t;
+};
+
+struct YA {
+ int value;
+ typedef int type;
+};
+
+template<typename T> struct C : X, T {
+ using T::value;
+ using typename T::type;
+ using X::v;
+ using typename X::t;
+};
+
+template<typename T> struct D : X, T {
+ using T::value;
+ using typename T::type;
+ using X::v;
+ using typename X::t;
+};
+
+template<typename T> struct E : X, T {
+ using T::value;
+ using typename T::type;
+ using X::v;
+ using typename X::t;
+};
+
+template<typename T> struct F : X, T {
+ using T::value;
+ using typename T::type;
+ using X::v;
+ using typename X::t;
+};
+
+// Force instantiation.
+typedef C<YA>::type I;
+typedef D<YA>::type I;
+typedef E<YA>::type I;
+typedef F<YA>::type I;
diff --git a/test/Modules/Inputs/merge-using-decls/b.h b/test/Modules/Inputs/merge-using-decls/b.h
new file mode 100644
index 000000000000..359555570a43
--- /dev/null
+++ b/test/Modules/Inputs/merge-using-decls/b.h
@@ -0,0 +1,50 @@
+struct X {
+ int v;
+ typedef int t;
+};
+
+struct YB {
+ typedef YB Y;
+ int value;
+ typedef int type;
+};
+
+struct YBRev {
+ typedef int value;
+ int type;
+};
+
+template<typename T> struct C : X, T {
+ using T::value;
+ using typename T::type;
+ using X::v;
+ using typename X::t;
+};
+
+template<typename T> struct D : X, T {
+ // Mismatch in type/non-type-ness.
+ using typename T::value;
+ using T::type;
+ using X::v;
+ using typename X::t;
+};
+
+template<typename T> struct E : X, T {
+ // Mismatch in using/access-declaration-ness.
+ T::value;
+ X::v;
+};
+
+template<typename T> struct F : X, T {
+ // Mismatch in nested-name-specifier.
+ using T::Y::value;
+ using typename T::Y::type;
+ using ::X::v;
+ using typename ::X::t;
+};
+
+// Force instantiation.
+typedef C<YB>::type I;
+typedef D<YBRev>::t I;
+typedef E<YB>::type I;
+typedef F<YB>::type I;
diff --git a/test/Modules/Inputs/merge-using-decls/module.modulemap b/test/Modules/Inputs/merge-using-decls/module.modulemap
new file mode 100644
index 000000000000..a415527813c7
--- /dev/null
+++ b/test/Modules/Inputs/merge-using-decls/module.modulemap
@@ -0,0 +1,2 @@
+module A { header "a.h" }
+module B { header "b.h" }
diff --git a/test/Modules/Inputs/modular_maps-moduleb-cwd.map b/test/Modules/Inputs/modular_maps-moduleb-cwd.map
new file mode 100644
index 000000000000..1ff307f4b3df
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps-moduleb-cwd.map
@@ -0,0 +1,4 @@
+module B {
+ header "Inputs/modular_maps/common.h"
+ private header "Inputs/modular_maps/b.h"
+}
diff --git a/test/Modules/Inputs/modular_maps/c.h b/test/Modules/Inputs/modular_maps/c.h
new file mode 100644
index 000000000000..6e3468e72602
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/c.h
@@ -0,0 +1,4 @@
+#ifndef C_H
+#define C_H
+const int c = 5;
+#endif
diff --git a/test/Modules/Inputs/modular_maps/common.h b/test/Modules/Inputs/modular_maps/common.h
index f690bcbd399b..349bf5f7c473 100644
--- a/test/Modules/Inputs/modular_maps/common.h
+++ b/test/Modules/Inputs/modular_maps/common.h
@@ -1,4 +1,4 @@
#ifndef COMMON_H
#define COMMON_H
-const int c = 2;
+const int x = 2;
#endif
diff --git a/test/Modules/Inputs/modular_maps/modulea-cwd.map b/test/Modules/Inputs/modular_maps/modulea-cwd.map
new file mode 100644
index 000000000000..10be5237fc7a
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/modulea-cwd.map
@@ -0,0 +1,7 @@
+module A {
+ header "Inputs/modular_maps/common.h"
+ header "Inputs/modular_maps/a.h"
+}
+
+extern module B "Inputs/modular_maps-moduleb-cwd.map"
+
diff --git a/test/Modules/Inputs/modular_maps/modulec-cwd.map b/test/Modules/Inputs/modular_maps/modulec-cwd.map
new file mode 100644
index 000000000000..ca38b542df4a
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/modulec-cwd.map
@@ -0,0 +1,3 @@
+module C {
+ header "Inputs/modular_maps/c.h"
+}
diff --git a/test/Modules/Inputs/modular_maps/modulec.map b/test/Modules/Inputs/modular_maps/modulec.map
new file mode 100644
index 000000000000..c5a1ffe4577c
--- /dev/null
+++ b/test/Modules/Inputs/modular_maps/modulec.map
@@ -0,0 +1,3 @@
+module C {
+ header "c.h"
+}
diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map
index fea12015233b..7040ee7e5ab6 100644
--- a/test/Modules/Inputs/module.map
+++ b/test/Modules/Inputs/module.map
@@ -40,6 +40,10 @@ module macros_right {
header "macros_right_undef.h"
}
}
+module macros_bottom {
+ header "macros_bottom.h"
+ export *
+}
module macros { header "macros.h" }
module macros_other { header "macros_other.h" }
module category_top { header "category_top.h" }
@@ -229,6 +233,10 @@ module cxx_templates_c {
header "cxx-templates-c.h"
}
+module cxx_templates_d {
+ header "cxx-templates-d.h"
+}
+
module cxx_decls {
module unimported {
header "cxx-decls-unimported.h"
@@ -238,6 +246,10 @@ module cxx_decls {
}
}
+module cxx_decls_premerged {
+ header "cxx-decls-premerged.h"
+}
+
module cxx_decls_merged {
header "cxx-decls-merged.h"
}
@@ -280,6 +292,10 @@ module warning {
header "warning.h"
}
+module warn_unused_local_typedef {
+ header "warn-unused-local-typedef.h"
+}
+
module initializer_list {
header "initializer_list"
}
diff --git a/test/Modules/Inputs/odr/a.h b/test/Modules/Inputs/odr/a.h
index 26144b86e8d1..5a3f52409486 100644
--- a/test/Modules/Inputs/odr/a.h
+++ b/test/Modules/Inputs/odr/a.h
@@ -8,6 +8,12 @@ struct X {
int n;
} x1;
+template<typename T>
+struct F {
+ int n;
+ friend bool operator==(const F &a, const F &b) { return a.n == b.n; }
+};
+
int f() {
return y1.n + e1 + y1.f + x1.n;
}
diff --git a/test/Modules/Inputs/odr/b.h b/test/Modules/Inputs/odr/b.h
index b4063979474f..a4a693df2bf1 100644
--- a/test/Modules/Inputs/odr/b.h
+++ b/test/Modules/Inputs/odr/b.h
@@ -4,6 +4,12 @@ struct Y {
} y2;
enum E { e2 };
+template<typename T>
+struct F {
+ int n;
+ friend bool operator==(const F &a, const F &b) { return a.n == b.n; }
+};
+
int g() {
- return y2.m + e2 + y2.f;
+ return y2.m + e2 + y2.f + (F<int>{0} == F<int>{1});
}
diff --git a/test/Modules/Inputs/pch-used.h b/test/Modules/Inputs/pch-used.h
index 60e0097ea909..bc53bb37a9df 100644
--- a/test/Modules/Inputs/pch-used.h
+++ b/test/Modules/Inputs/pch-used.h
@@ -1,2 +1,3 @@
@import cstd.stdio;
+@import other_constants.dbl_max;
static inline void SPXTrace() { fprintf(__stderrp, ""); }
diff --git a/test/Modules/Inputs/pr19692/AIX.h b/test/Modules/Inputs/pr19692/AIX.h
new file mode 100644
index 000000000000..710871e21f21
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/AIX.h
@@ -0,0 +1,2 @@
+ #undef INT64_MAX
+
diff --git a/test/Modules/Inputs/pr19692/Blah.h b/test/Modules/Inputs/pr19692/Blah.h
new file mode 100644
index 000000000000..bdaa83a5a363
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/Blah.h
@@ -0,0 +1,2 @@
+ #include "stdint.h"
+
diff --git a/test/Modules/Inputs/pr19692/TBlah.h b/test/Modules/Inputs/pr19692/TBlah.h
new file mode 100644
index 000000000000..a045a8bd7377
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/TBlah.h
@@ -0,0 +1,3 @@
+#include "Blah.h"
+ int use = INT64_MAX;
+
diff --git a/test/Modules/Inputs/pr19692/TFoo.h b/test/Modules/Inputs/pr19692/TFoo.h
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/TFoo.h
@@ -0,0 +1 @@
+
diff --git a/test/Modules/Inputs/pr19692/module.map b/test/Modules/Inputs/pr19692/module.map
new file mode 100644
index 000000000000..f4120dce6f8c
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/module.map
@@ -0,0 +1,3 @@
+module cstd { module stdint { header "stdint.h" } }
+module LLVMSupport { module Blah { header "Blah.h" export * } module AIX { header "AIX.h" } }
+module LLVMTarget { module Blah { header "TBlah.h" export * } module Foo { header "TFoo.h" } }
diff --git a/test/Modules/Inputs/pr19692/stdint.h b/test/Modules/Inputs/pr19692/stdint.h
new file mode 100644
index 000000000000..7615e832495d
--- /dev/null
+++ b/test/Modules/Inputs/pr19692/stdint.h
@@ -0,0 +1,2 @@
+ #define INT64_MAX 42
+
diff --git a/test/Modules/Inputs/preprocess-prefix.h b/test/Modules/Inputs/preprocess-prefix.h
new file mode 100644
index 000000000000..04d01758320b
--- /dev/null
+++ b/test/Modules/Inputs/preprocess-prefix.h
@@ -0,0 +1,2 @@
+int left_and_right(int *);
+#import "diamond_left.h"
diff --git a/test/Modules/Inputs/relative-dep-gen-1.h b/test/Modules/Inputs/relative-dep-gen-1.h
new file mode 100644
index 000000000000..deb56982bb82
--- /dev/null
+++ b/test/Modules/Inputs/relative-dep-gen-1.h
@@ -0,0 +1 @@
+// empty 1
diff --git a/test/Modules/Inputs/relative-dep-gen-2.h b/test/Modules/Inputs/relative-dep-gen-2.h
new file mode 100644
index 000000000000..2b9517d9787d
--- /dev/null
+++ b/test/Modules/Inputs/relative-dep-gen-2.h
@@ -0,0 +1 @@
+// empty 2
diff --git a/test/Modules/Inputs/relative-dep-gen-cwd.modulemap b/test/Modules/Inputs/relative-dep-gen-cwd.modulemap
new file mode 100644
index 000000000000..b8678d309d6b
--- /dev/null
+++ b/test/Modules/Inputs/relative-dep-gen-cwd.modulemap
@@ -0,0 +1,4 @@
+module "relative-dep-gen" {
+ header "Inputs/relative-dep-gen-1.h"
+ header "Inputs/relative-dep-gen-2.h"
+}
diff --git a/test/Modules/Inputs/relative-dep-gen.modulemap b/test/Modules/Inputs/relative-dep-gen.modulemap
new file mode 100644
index 000000000000..4c821e19ae55
--- /dev/null
+++ b/test/Modules/Inputs/relative-dep-gen.modulemap
@@ -0,0 +1,4 @@
+module "relative-dep-gen" {
+ header "relative-dep-gen-1.h"
+ header "relative-dep-gen-2.h"
+}
diff --git a/test/Modules/Inputs/templates-left.h b/test/Modules/Inputs/templates-left.h
index 2bd79be94584..cbe89434f9f3 100644
--- a/test/Modules/Inputs/templates-left.h
+++ b/test/Modules/Inputs/templates-left.h
@@ -60,3 +60,13 @@ template<typename T> void testDelayUpdates(DelayUpdates<T> *p = 0) {}
void outOfLineInlineUseLeftF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f);
void outOfLineInlineUseLeftG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g);
void outOfLineInlineUseLeftH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h);
+
+namespace EmitDefaultedSpecialMembers {
+ inline void f() {
+ SmallString<256> SS;
+ };
+}
+
+inline int *getStaticDataMemberLeft() {
+ return WithUndefinedStaticDataMember<int[]>::undefined;
+}
diff --git a/test/Modules/Inputs/templates-right.h b/test/Modules/Inputs/templates-right.h
index 5907cbca73ee..daea97b86b88 100644
--- a/test/Modules/Inputs/templates-right.h
+++ b/test/Modules/Inputs/templates-right.h
@@ -43,3 +43,7 @@ template<typename T> struct MergePatternDecl;
void outOfLineInlineUseRightF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f);
void outOfLineInlineUseRightG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g);
void outOfLineInlineUseRightH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h);
+
+inline int *getStaticDataMemberRight() {
+ return WithUndefinedStaticDataMember<int[]>::undefined;
+}
diff --git a/test/Modules/Inputs/templates-top.h b/test/Modules/Inputs/templates-top.h
index 1216266f34fb..31f5e4199281 100644
--- a/test/Modules/Inputs/templates-top.h
+++ b/test/Modules/Inputs/templates-top.h
@@ -40,3 +40,20 @@ template<typename T> struct OutOfLineInline {
template<typename T> inline void OutOfLineInline<T>::f() {}
template<typename T> inline void OutOfLineInline<T>::g() {}
template<typename T> inline void OutOfLineInline<T>::h() {}
+
+namespace EmitDefaultedSpecialMembers {
+ template<typename T> struct SmallVectorImpl {
+ SmallVectorImpl() {}
+ ~SmallVectorImpl() {} // non-trivial dtor
+ };
+ template<typename T, unsigned N> struct SmallVector : SmallVectorImpl<T> {
+ // trivial dtor
+ };
+ template<unsigned N> struct SmallString : SmallVector<char, N> {
+ // trivial dtor
+ };
+}
+
+template<typename T> struct WithUndefinedStaticDataMember {
+ static T undefined;
+};
diff --git a/test/Modules/Inputs/va_list/module.modulemap b/test/Modules/Inputs/va_list/module.modulemap
new file mode 100644
index 000000000000..870f38bb0ecd
--- /dev/null
+++ b/test/Modules/Inputs/va_list/module.modulemap
@@ -0,0 +1,2 @@
+module va_list_a { header "va_list_a.h" }
+module va_list_b { header "va_list_b.h" }
diff --git a/test/Modules/Inputs/va_list/va_list_a.h b/test/Modules/Inputs/va_list/va_list_a.h
new file mode 100644
index 000000000000..7193ca2ec340
--- /dev/null
+++ b/test/Modules/Inputs/va_list/va_list_a.h
@@ -0,0 +1 @@
+int vprintf(const char * __restrict, va_list);
diff --git a/test/Modules/Inputs/va_list/va_list_b.h b/test/Modules/Inputs/va_list/va_list_b.h
new file mode 100644
index 000000000000..b7f9b3d367c5
--- /dev/null
+++ b/test/Modules/Inputs/va_list/va_list_b.h
@@ -0,0 +1,2 @@
+@import va_list_a;
+void NSLogv(id, va_list);
diff --git a/test/Modules/Inputs/warn-unused-local-typedef.h b/test/Modules/Inputs/warn-unused-local-typedef.h
new file mode 100644
index 000000000000..6006de0cc8cc
--- /dev/null
+++ b/test/Modules/Inputs/warn-unused-local-typedef.h
@@ -0,0 +1 @@
+inline void myfun() { typedef int a; }