summaryrefslogtreecommitdiff
path: root/test/Modules/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Modules/Inputs')
-rw-r--r--test/Modules/Inputs/DebugModule.h1
-rw-r--r--test/Modules/Inputs/ImportNameInDir.h4
-rw-r--r--test/Modules/Inputs/NameInDir.framework/Headers/NameInDir.h2
-rw-r--r--test/Modules/Inputs/NameInDir.framework/Modules/module.modulemap5
-rw-r--r--test/Modules/Inputs/NameInDir2.framework/Headers/NameInDir2.h1
-rw-r--r--test/Modules/Inputs/NameInDir2.framework/Modules/module.modulemap5
-rw-r--r--test/Modules/Inputs/NameInDirInferred.framework/Headers/NameInDirInferred.h1
-rw-r--r--test/Modules/Inputs/crash.h1
-rw-r--r--test/Modules/Inputs/explicit-build-prefer-self/a.h2
-rw-r--r--test/Modules/Inputs/explicit-build-prefer-self/b.h2
-rw-r--r--test/Modules/Inputs/explicit-build-prefer-self/map2
-rw-r--r--test/Modules/Inputs/explicit-build-prefer-self/x.h0
-rw-r--r--test/Modules/Inputs/merge-class-definition-visibility/b.h2
-rw-r--r--test/Modules/Inputs/merge-class-definition-visibility/d.h2
-rw-r--r--test/Modules/Inputs/merge-class-definition-visibility/e.h3
-rw-r--r--test/Modules/Inputs/merge-class-definition-visibility/modmap3
-rw-r--r--test/Modules/Inputs/module.map12
-rw-r--r--test/Modules/Inputs/submodule-visibility/a.h8
-rw-r--r--test/Modules/Inputs/submodule-visibility/b.h9
-rw-r--r--test/Modules/Inputs/submodule-visibility/c.h6
-rw-r--r--test/Modules/Inputs/submodule-visibility/module.modulemap1
-rw-r--r--test/Modules/Inputs/submodule-visibility/other.h1
-rw-r--r--test/Modules/Inputs/submodules-merge-defs/defs.h22
23 files changed, 92 insertions, 3 deletions
diff --git a/test/Modules/Inputs/DebugModule.h b/test/Modules/Inputs/DebugModule.h
new file mode 100644
index 0000000000000..5612b73a8cfbf
--- /dev/null
+++ b/test/Modules/Inputs/DebugModule.h
@@ -0,0 +1 @@
+@class F;
diff --git a/test/Modules/Inputs/ImportNameInDir.h b/test/Modules/Inputs/ImportNameInDir.h
new file mode 100644
index 0000000000000..ae7b1a0fb278c
--- /dev/null
+++ b/test/Modules/Inputs/ImportNameInDir.h
@@ -0,0 +1,4 @@
+#import <NameInDir/NameInDir.h>
+
+// Don't crash.
+#undef NAME_IN_DIR
diff --git a/test/Modules/Inputs/NameInDir.framework/Headers/NameInDir.h b/test/Modules/Inputs/NameInDir.framework/Headers/NameInDir.h
new file mode 100644
index 0000000000000..bea23914858b9
--- /dev/null
+++ b/test/Modules/Inputs/NameInDir.framework/Headers/NameInDir.h
@@ -0,0 +1,2 @@
+// NameInDir.h
+#define NAME_IN_DIR 1
diff --git a/test/Modules/Inputs/NameInDir.framework/Modules/module.modulemap b/test/Modules/Inputs/NameInDir.framework/Modules/module.modulemap
new file mode 100644
index 0000000000000..48e1c56749f92
--- /dev/null
+++ b/test/Modules/Inputs/NameInDir.framework/Modules/module.modulemap
@@ -0,0 +1,5 @@
+framework module NameInModMap {
+ umbrella header "NameInDir.h"
+ export *
+ module * { export * }
+}
diff --git a/test/Modules/Inputs/NameInDir2.framework/Headers/NameInDir2.h b/test/Modules/Inputs/NameInDir2.framework/Headers/NameInDir2.h
new file mode 100644
index 0000000000000..6dc3eea149e78
--- /dev/null
+++ b/test/Modules/Inputs/NameInDir2.framework/Headers/NameInDir2.h
@@ -0,0 +1 @@
+// NameInDir2.h
diff --git a/test/Modules/Inputs/NameInDir2.framework/Modules/module.modulemap b/test/Modules/Inputs/NameInDir2.framework/Modules/module.modulemap
new file mode 100644
index 0000000000000..24f15f8e846be
--- /dev/null
+++ b/test/Modules/Inputs/NameInDir2.framework/Modules/module.modulemap
@@ -0,0 +1,5 @@
+framework module NameInDir2 {
+ umbrella header "NameInDir2.h"
+ export *
+ module * { export * }
+}
diff --git a/test/Modules/Inputs/NameInDirInferred.framework/Headers/NameInDirInferred.h b/test/Modules/Inputs/NameInDirInferred.framework/Headers/NameInDirInferred.h
new file mode 100644
index 0000000000000..c0b12e6f94596
--- /dev/null
+++ b/test/Modules/Inputs/NameInDirInferred.framework/Headers/NameInDirInferred.h
@@ -0,0 +1 @@
+// NameInDirInferred.h
diff --git a/test/Modules/Inputs/crash.h b/test/Modules/Inputs/crash.h
new file mode 100644
index 0000000000000..bc878fbcb0272
--- /dev/null
+++ b/test/Modules/Inputs/crash.h
@@ -0,0 +1 @@
+#pragma clang __debug crash
diff --git a/test/Modules/Inputs/explicit-build-prefer-self/a.h b/test/Modules/Inputs/explicit-build-prefer-self/a.h
new file mode 100644
index 0000000000000..d45761275d8fc
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build-prefer-self/a.h
@@ -0,0 +1,2 @@
+// a
+#include "x.h"
diff --git a/test/Modules/Inputs/explicit-build-prefer-self/b.h b/test/Modules/Inputs/explicit-build-prefer-self/b.h
new file mode 100644
index 0000000000000..76e2042cb91c4
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build-prefer-self/b.h
@@ -0,0 +1,2 @@
+// b
+#include "x.h"
diff --git a/test/Modules/Inputs/explicit-build-prefer-self/map b/test/Modules/Inputs/explicit-build-prefer-self/map
new file mode 100644
index 0000000000000..26be8e690736e
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build-prefer-self/map
@@ -0,0 +1,2 @@
+module a { header "a.h" header "x.h" }
+module b { header "b.h" header "x.h" }
diff --git a/test/Modules/Inputs/explicit-build-prefer-self/x.h b/test/Modules/Inputs/explicit-build-prefer-self/x.h
new file mode 100644
index 0000000000000..e69de29bb2d1d
--- /dev/null
+++ b/test/Modules/Inputs/explicit-build-prefer-self/x.h
diff --git a/test/Modules/Inputs/merge-class-definition-visibility/b.h b/test/Modules/Inputs/merge-class-definition-visibility/b.h
index 2b8f5f868ed92..03c0ad98dfd8d 100644
--- a/test/Modules/Inputs/merge-class-definition-visibility/b.h
+++ b/test/Modules/Inputs/merge-class-definition-visibility/b.h
@@ -1,2 +1,4 @@
// Include definition of A into the same module as c.h
#include "a.h"
+
+struct B {};
diff --git a/test/Modules/Inputs/merge-class-definition-visibility/d.h b/test/Modules/Inputs/merge-class-definition-visibility/d.h
index 2243de1baf9a0..c51edab1416d8 100644
--- a/test/Modules/Inputs/merge-class-definition-visibility/d.h
+++ b/test/Modules/Inputs/merge-class-definition-visibility/d.h
@@ -1 +1 @@
-#include "a.h"
+struct B {};
diff --git a/test/Modules/Inputs/merge-class-definition-visibility/e.h b/test/Modules/Inputs/merge-class-definition-visibility/e.h
new file mode 100644
index 0000000000000..f126b504b9b5e
--- /dev/null
+++ b/test/Modules/Inputs/merge-class-definition-visibility/e.h
@@ -0,0 +1,3 @@
+#include "a.h"
+
+struct B {};
diff --git a/test/Modules/Inputs/merge-class-definition-visibility/modmap b/test/Modules/Inputs/merge-class-definition-visibility/modmap
index 7d988fbba0039..dcb65871886a7 100644
--- a/test/Modules/Inputs/merge-class-definition-visibility/modmap
+++ b/test/Modules/Inputs/merge-class-definition-visibility/modmap
@@ -3,5 +3,6 @@ module Def1 {
module C { header "c.h" }
}
module Def2 {
- header "d.h"
+ module D { header "d.h" }
+ module E { header "e.h" }
}
diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map
index 8ec3e21121b7e..ffaa53e18e288 100644
--- a/test/Modules/Inputs/module.map
+++ b/test/Modules/Inputs/module.map
@@ -324,3 +324,15 @@ module recursive1 {
module recursive2 {
header "recursive2.h"
}
+module crash {
+ header "crash.h"
+}
+
+module DebugModule {
+ header "DebugModule.h"
+}
+
+module ImportNameInDir {
+ header "ImportNameInDir.h"
+ export *
+}
diff --git a/test/Modules/Inputs/submodule-visibility/a.h b/test/Modules/Inputs/submodule-visibility/a.h
index d8805c92f24d9..e4965d72218ba 100644
--- a/test/Modules/Inputs/submodule-visibility/a.h
+++ b/test/Modules/Inputs/submodule-visibility/a.h
@@ -1 +1,9 @@
int n;
+
+#ifdef B
+#error B is defined
+#endif
+
+#define A
+
+#include "c.h"
diff --git a/test/Modules/Inputs/submodule-visibility/b.h b/test/Modules/Inputs/submodule-visibility/b.h
index fa419c0c5c481..67ef6529dbd81 100644
--- a/test/Modules/Inputs/submodule-visibility/b.h
+++ b/test/Modules/Inputs/submodule-visibility/b.h
@@ -1 +1,10 @@
int m = n;
+
+#include "other.h"
+#include "c.h"
+
+#if defined(A) && !defined(ALLOW_NAME_LEAKAGE)
+#error A is defined
+#endif
+
+#define B
diff --git a/test/Modules/Inputs/submodule-visibility/c.h b/test/Modules/Inputs/submodule-visibility/c.h
new file mode 100644
index 0000000000000..259b8c7c61c7b
--- /dev/null
+++ b/test/Modules/Inputs/submodule-visibility/c.h
@@ -0,0 +1,6 @@
+#ifndef C_H_INCLUDED
+#define C_H_INCLUDED
+
+struct C {};
+
+#endif
diff --git a/test/Modules/Inputs/submodule-visibility/module.modulemap b/test/Modules/Inputs/submodule-visibility/module.modulemap
index 2e13344dc635c..d2f0c7783ffa2 100644
--- a/test/Modules/Inputs/submodule-visibility/module.modulemap
+++ b/test/Modules/Inputs/submodule-visibility/module.modulemap
@@ -1,4 +1,5 @@
module x { module a { header "a.h" } module b { header "b.h" } }
+module other { header "other.h" }
module cycles {
module cycle1 { header "cycle1.h" }
diff --git a/test/Modules/Inputs/submodule-visibility/other.h b/test/Modules/Inputs/submodule-visibility/other.h
new file mode 100644
index 0000000000000..f40c757ca62ed
--- /dev/null
+++ b/test/Modules/Inputs/submodule-visibility/other.h
@@ -0,0 +1 @@
+#include "c.h"
diff --git a/test/Modules/Inputs/submodules-merge-defs/defs.h b/test/Modules/Inputs/submodules-merge-defs/defs.h
index 247b05c47082c..bda0567c93a38 100644
--- a/test/Modules/Inputs/submodules-merge-defs/defs.h
+++ b/test/Modules/Inputs/submodules-merge-defs/defs.h
@@ -10,6 +10,7 @@ public:
// Check that lookup and access checks are performed in the right context.
struct B::Inner2 : Inner1 {};
template<typename T> void B::f() {}
+template<> inline void B::f<int>() {}
// Check that base-specifiers are correctly disambiguated.
template<int N> struct C_Base { struct D { constexpr operator int() const { return 0; } }; };
@@ -31,7 +32,8 @@ template<typename T> struct F {
template<typename T> int F<T>::f() { return 0; }
template<typename T> template<typename U> int F<T>::g() { return 0; }
template<typename T> int F<T>::n = 0;
-//template<> template<typename U> int F<char>::g() { return 0; } // FIXME: Re-enable this once we support merging member specializations.
+template<> inline int F<char>::f() { return 0; }
+template<> template<typename U> int F<char>::g() { return 0; }
template<> struct F<void> { int h(); };
inline int F<void>::h() { return 0; }
template<typename T> struct F<T *> { int i(); };
@@ -74,3 +76,21 @@ namespace FriendDefArg {
template<typename, int, template<typename> class> friend struct D;
};
}
+
+namespace SeparateInline {
+ inline void f();
+ void f() {}
+ constexpr int g() { return 0; }
+}
+
+namespace TrailingAttributes {
+ template<typename T> struct X {} __attribute__((aligned(8)));
+}
+
+namespace MergeFunctionTemplateSpecializations {
+ template<typename T> T f();
+ template<typename T> struct X {
+ template<typename U> using Q = decltype(f<T>() + U());
+ };
+ using xiq = X<int>::Q<int>;
+}