summaryrefslogtreecommitdiff
path: root/test/Modules/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Modules/Inputs')
-rw-r--r--test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h1
-rw-r--r--test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h1
-rw-r--r--test/Modules/Inputs/lsv-debuginfo/A/ADT.h45
-rw-r--r--test/Modules/Inputs/lsv-debuginfo/B/B.h14
-rw-r--r--test/Modules/Inputs/lsv-debuginfo/C/C.h13
-rw-r--r--test/Modules/Inputs/lsv-debuginfo/module.modulemap9
-rw-r--r--test/Modules/Inputs/no-module-map/a.h4
-rw-r--r--test/Modules/Inputs/no-module-map/b.h5
-rw-r--r--test/Modules/Inputs/odr_hash-Unresolved/class.h1
-rw-r--r--test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h1
-rw-r--r--test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map5
-rw-r--r--test/Modules/Inputs/unavailable-local-visibility/a.h4
-rw-r--r--test/Modules/Inputs/unavailable-local-visibility/b.h13
-rw-r--r--test/Modules/Inputs/unavailable-local-visibility/module.modulemap9
-rw-r--r--test/Modules/Inputs/unavailable-local-visibility/x.h4
15 files changed, 129 insertions, 0 deletions
diff --git a/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h b/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
new file mode 100644
index 000000000000..96212a03a113
--- /dev/null
+++ b/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing1.h
@@ -0,0 +1 @@
+#include "Thing2.h"
diff --git a/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h b/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
new file mode 100644
index 000000000000..7d1fe26edb09
--- /dev/null
+++ b/test/Modules/Inputs/double-quotes/NotAFramework/Headers/Headers/Thing2.h
@@ -0,0 +1 @@
+// Empty file!
diff --git a/test/Modules/Inputs/lsv-debuginfo/A/ADT.h b/test/Modules/Inputs/lsv-debuginfo/A/ADT.h
new file mode 100644
index 000000000000..f48d4f7820a8
--- /dev/null
+++ b/test/Modules/Inputs/lsv-debuginfo/A/ADT.h
@@ -0,0 +1,45 @@
+#ifndef ADT
+#define ADT
+
+#ifdef WITH_NAMESPACE
+namespace llvm {
+#endif
+template <unsigned Alignment, unsigned Size>
+struct AlignedCharArray {
+ alignas(Alignment) char buffer[Size];
+};
+
+template <typename T1>
+class AlignerImpl {
+ T1 t1;
+};
+
+template <typename T1>
+union SizerImpl {
+ char arr1[sizeof(T1)];
+};
+
+template <typename T1>
+struct AlignedCharArrayUnion
+ : AlignedCharArray<alignof(AlignerImpl<T1>), sizeof(SizerImpl<T1>)> {};
+
+template <typename T, unsigned N>
+struct SmallVectorStorage {
+ AlignedCharArrayUnion<T> InlineElts[N];
+};
+template <typename T, unsigned N>
+class SmallVector : SmallVectorStorage<T, N> {};
+
+template <typename T>
+struct OptionalStorage {
+ AlignedCharArrayUnion<T> storage;
+};
+template <typename T>
+class Optional {
+ OptionalStorage<T> Storage;
+};
+
+#ifdef WITH_NAMESPACE
+} // namespace llvm
+#endif
+#endif
diff --git a/test/Modules/Inputs/lsv-debuginfo/B/B.h b/test/Modules/Inputs/lsv-debuginfo/B/B.h
new file mode 100644
index 000000000000..c00bc3cddbf5
--- /dev/null
+++ b/test/Modules/Inputs/lsv-debuginfo/B/B.h
@@ -0,0 +1,14 @@
+#ifndef B_H
+#define B_H
+#include <A/ADT.h>
+#include <C/C.h>
+
+namespace llvm {
+struct S {
+ unsigned a, b, c, d;
+};
+class C {
+ Optional<S> S;
+};
+}
+#endif
diff --git a/test/Modules/Inputs/lsv-debuginfo/C/C.h b/test/Modules/Inputs/lsv-debuginfo/C/C.h
new file mode 100644
index 000000000000..52c6e4dbac94
--- /dev/null
+++ b/test/Modules/Inputs/lsv-debuginfo/C/C.h
@@ -0,0 +1,13 @@
+#ifndef C_H
+#define C_H
+#include <A/ADT.h>
+
+namespace llvm {
+class D {
+ struct Q {
+ unsigned a, b, c, d;
+ };
+ SmallVector<Q, 4> q;
+};
+} // namespace llvm
+#endif
diff --git a/test/Modules/Inputs/lsv-debuginfo/module.modulemap b/test/Modules/Inputs/lsv-debuginfo/module.modulemap
new file mode 100644
index 000000000000..5bb044908dc7
--- /dev/null
+++ b/test/Modules/Inputs/lsv-debuginfo/module.modulemap
@@ -0,0 +1,9 @@
+module A {
+ umbrella "A" module * { export * }
+}
+module B {
+ umbrella "B" module * { export * }
+}
+module C {
+ umbrella "C" module * { export * }
+}
diff --git a/test/Modules/Inputs/no-module-map/a.h b/test/Modules/Inputs/no-module-map/a.h
new file mode 100644
index 000000000000..546714f4ca3e
--- /dev/null
+++ b/test/Modules/Inputs/no-module-map/a.h
@@ -0,0 +1,4 @@
+#ifndef A_H
+#define A_H
+void a();
+#endif
diff --git a/test/Modules/Inputs/no-module-map/b.h b/test/Modules/Inputs/no-module-map/b.h
new file mode 100644
index 000000000000..d3fbc8b3ad59
--- /dev/null
+++ b/test/Modules/Inputs/no-module-map/b.h
@@ -0,0 +1,5 @@
+#ifndef B_H
+#define B_H
+#include "a.h"
+void b();
+#endif
diff --git a/test/Modules/Inputs/odr_hash-Unresolved/class.h b/test/Modules/Inputs/odr_hash-Unresolved/class.h
index fe3a7116f9bf..8a3c9f941f7e 100644
--- a/test/Modules/Inputs/odr_hash-Unresolved/class.h
+++ b/test/Modules/Inputs/odr_hash-Unresolved/class.h
@@ -6,6 +6,7 @@ class S {
void run() {
int x;
A::Check(&Field, 1);
+ A::Check(&Field, 1);
}
};
#endif
diff --git a/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h b/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
new file mode 100644
index 000000000000..c362dd03f048
--- /dev/null
+++ b/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
@@ -0,0 +1 @@
+int bar();
diff --git a/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map b/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
new file mode 100644
index 000000000000..dc51f5d03aca
--- /dev/null
+++ b/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
@@ -0,0 +1,5 @@
+module ModuleInSubdir {
+header "h1.h"
+ export *
+}
+
diff --git a/test/Modules/Inputs/unavailable-local-visibility/a.h b/test/Modules/Inputs/unavailable-local-visibility/a.h
new file mode 100644
index 000000000000..865bb65f4d28
--- /dev/null
+++ b/test/Modules/Inputs/unavailable-local-visibility/a.h
@@ -0,0 +1,4 @@
+#ifndef A_H
+#define A_H
+#include "x.h"
+#endif
diff --git a/test/Modules/Inputs/unavailable-local-visibility/b.h b/test/Modules/Inputs/unavailable-local-visibility/b.h
new file mode 100644
index 000000000000..71360e38b7b1
--- /dev/null
+++ b/test/Modules/Inputs/unavailable-local-visibility/b.h
@@ -0,0 +1,13 @@
+#ifndef B_H
+#define B_H
+#include "a.h"
+
+#ifndef A_H
+#error where is a?
+#endif
+
+#ifndef X_H
+#error where is x?
+#endif
+X f();
+#endif
diff --git a/test/Modules/Inputs/unavailable-local-visibility/module.modulemap b/test/Modules/Inputs/unavailable-local-visibility/module.modulemap
new file mode 100644
index 000000000000..8da3d3c1ab0e
--- /dev/null
+++ b/test/Modules/Inputs/unavailable-local-visibility/module.modulemap
@@ -0,0 +1,9 @@
+module M {
+ module a { header "a.h" export * }
+ module b { header "b.h" export * }
+ module doesnotexist { header "doesnotexist.h" }
+}
+module X {
+ header "x.h"
+ export *
+}
diff --git a/test/Modules/Inputs/unavailable-local-visibility/x.h b/test/Modules/Inputs/unavailable-local-visibility/x.h
new file mode 100644
index 000000000000..0498c5d2aabc
--- /dev/null
+++ b/test/Modules/Inputs/unavailable-local-visibility/x.h
@@ -0,0 +1,4 @@
+#ifndef X_H
+#define X_H
+struct X {};
+#endif