summaryrefslogtreecommitdiffstats
path: root/test/PCH/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCH/Inputs')
-rw-r--r--test/PCH/Inputs/chain-cxx1.h19
-rw-r--r--test/PCH/Inputs/chain-cxx2.h32
-rw-r--r--test/PCH/Inputs/chain-decls1.h11
-rw-r--r--test/PCH/Inputs/chain-decls2.h12
-rw-r--r--test/PCH/Inputs/chain-ext_vector1.h3
-rw-r--r--test/PCH/Inputs/chain-ext_vector2.h3
-rw-r--r--test/PCH/Inputs/chain-external-defs1.h13
-rw-r--r--test/PCH/Inputs/chain-external-defs2.h11
-rw-r--r--test/PCH/Inputs/chain-macro-override1.h4
-rw-r--r--test/PCH/Inputs/chain-macro-override2.h4
-rw-r--r--test/PCH/Inputs/chain-macro1.h1
-rw-r--r--test/PCH/Inputs/chain-macro2.h1
-rw-r--r--test/PCH/Inputs/chain-selectors1.h12
-rw-r--r--test/PCH/Inputs/chain-selectors2.h11
-rw-r--r--test/PCH/Inputs/chain-trivial1.h0
-rw-r--r--test/PCH/Inputs/chain-trivial2.h0
-rw-r--r--test/PCH/Inputs/preamble.h1
17 files changed, 138 insertions, 0 deletions
diff --git a/test/PCH/Inputs/chain-cxx1.h b/test/PCH/Inputs/chain-cxx1.h
new file mode 100644
index 0000000..7ea3ffb
--- /dev/null
+++ b/test/PCH/Inputs/chain-cxx1.h
@@ -0,0 +1,19 @@
+// Primary header for C++ chained PCH test
+
+void f();
+
+// Name not appearing in dependent
+void pf();
+
+namespace ns {
+ void g();
+
+ void pg();
+}
+
+template <typename T>
+struct S { typedef int G; };
+
+// Partially specialize
+template <typename T>
+struct S<T *> { typedef int H; };
diff --git a/test/PCH/Inputs/chain-cxx2.h b/test/PCH/Inputs/chain-cxx2.h
new file mode 100644
index 0000000..adc10fd
--- /dev/null
+++ b/test/PCH/Inputs/chain-cxx2.h
@@ -0,0 +1,32 @@
+// Dependent header for C++ chained PCH test
+
+// Overload function from primary
+void f(int);
+
+// Add function with different name
+void f2();
+
+// Reopen namespace
+namespace ns {
+ // Overload function from primary
+ void g(int);
+
+ // Add different name
+ void g2();
+}
+
+// Specialize template from primary
+template <>
+struct S<int> { typedef int I; };
+
+// Partially specialize
+template <typename T>
+struct S<T &> { typedef int J; };
+
+// Specialize previous partial specialization
+template <>
+struct S<int *> { typedef int K; };
+
+// Specialize the partial specialization from this file
+template <>
+struct S<int &> { typedef int L; };
diff --git a/test/PCH/Inputs/chain-decls1.h b/test/PCH/Inputs/chain-decls1.h
new file mode 100644
index 0000000..9de4461
--- /dev/null
+++ b/test/PCH/Inputs/chain-decls1.h
@@ -0,0 +1,11 @@
+void f();
+
+struct one {};
+void two();
+
+void many(int i);
+struct many;
+void many(int j);
+struct many;
+
+void noret();
diff --git a/test/PCH/Inputs/chain-decls2.h b/test/PCH/Inputs/chain-decls2.h
new file mode 100644
index 0000000..b8b7d04
--- /dev/null
+++ b/test/PCH/Inputs/chain-decls2.h
@@ -0,0 +1,12 @@
+void g();
+
+struct two {};
+void one();
+struct three {}; // for verification
+
+void many(int k);
+struct many;
+void many(int l);
+struct many {};
+
+void noret() __attribute__((noreturn));
diff --git a/test/PCH/Inputs/chain-ext_vector1.h b/test/PCH/Inputs/chain-ext_vector1.h
new file mode 100644
index 0000000..5109336
--- /dev/null
+++ b/test/PCH/Inputs/chain-ext_vector1.h
@@ -0,0 +1,3 @@
+// First header file for chain-ext_vector.c PCH test
+
+typedef __attribute__((ext_vector_type(2))) float float2;
diff --git a/test/PCH/Inputs/chain-ext_vector2.h b/test/PCH/Inputs/chain-ext_vector2.h
new file mode 100644
index 0000000..bdaeccc
--- /dev/null
+++ b/test/PCH/Inputs/chain-ext_vector2.h
@@ -0,0 +1,3 @@
+// Second header file for chain-ext_vector.c PCH test
+
+typedef __attribute__((ext_vector_type(4))) float float4;
diff --git a/test/PCH/Inputs/chain-external-defs1.h b/test/PCH/Inputs/chain-external-defs1.h
new file mode 100644
index 0000000..36a2653
--- /dev/null
+++ b/test/PCH/Inputs/chain-external-defs1.h
@@ -0,0 +1,13 @@
+// Helper 1 for chain-external-defs.c test
+
+// Tentative definitions
+int x;
+int x2;
+
+// Should not show up
+static int z;
+
+int incomplete_array[];
+int incomplete_array2[];
+
+struct S s;
diff --git a/test/PCH/Inputs/chain-external-defs2.h b/test/PCH/Inputs/chain-external-defs2.h
new file mode 100644
index 0000000..72af92f
--- /dev/null
+++ b/test/PCH/Inputs/chain-external-defs2.h
@@ -0,0 +1,11 @@
+// Helper 2 for chain-external-defs.c test
+
+// Tentative definitions
+int y;
+int y2;
+
+// Should still not show up
+static int z;
+
+int incomplete_array[];
+int incomplete_array3[];
diff --git a/test/PCH/Inputs/chain-macro-override1.h b/test/PCH/Inputs/chain-macro-override1.h
new file mode 100644
index 0000000..4f9321d
--- /dev/null
+++ b/test/PCH/Inputs/chain-macro-override1.h
@@ -0,0 +1,4 @@
+void f() __attribute__((unavailable));
+void g();
+#define g() f()
+#define h() f()
diff --git a/test/PCH/Inputs/chain-macro-override2.h b/test/PCH/Inputs/chain-macro-override2.h
new file mode 100644
index 0000000..f279e2a
--- /dev/null
+++ b/test/PCH/Inputs/chain-macro-override2.h
@@ -0,0 +1,4 @@
+#define f() g()
+#undef g
+#undef h
+#define h() g()
diff --git a/test/PCH/Inputs/chain-macro1.h b/test/PCH/Inputs/chain-macro1.h
new file mode 100644
index 0000000..2e80e47
--- /dev/null
+++ b/test/PCH/Inputs/chain-macro1.h
@@ -0,0 +1 @@
+#define FOOBAR void f();
diff --git a/test/PCH/Inputs/chain-macro2.h b/test/PCH/Inputs/chain-macro2.h
new file mode 100644
index 0000000..e888228
--- /dev/null
+++ b/test/PCH/Inputs/chain-macro2.h
@@ -0,0 +1 @@
+#define BARFOO void g();
diff --git a/test/PCH/Inputs/chain-selectors1.h b/test/PCH/Inputs/chain-selectors1.h
new file mode 100644
index 0000000..37c1c00
--- /dev/null
+++ b/test/PCH/Inputs/chain-selectors1.h
@@ -0,0 +1,12 @@
+@interface X
+ -(void)f;
+ -(void)f2;
+ -(void)g:(int)p;
+ -(void)h:(int)p1 foo:(int)p2;
+@end
+
+void foo1() {
+ // FIXME: Can't verify warnings in headers
+ //(void)@selector(x);
+ (void)@selector(f);
+}
diff --git a/test/PCH/Inputs/chain-selectors2.h b/test/PCH/Inputs/chain-selectors2.h
new file mode 100644
index 0000000..4d6b556
--- /dev/null
+++ b/test/PCH/Inputs/chain-selectors2.h
@@ -0,0 +1,11 @@
+@interface Y
+ -(void)f;
+ -(double)f2;
+ -(void)e;
+@end
+
+void foo2() {
+ // FIXME: Can't verify warnings in headers
+ //(void)@selector(y);
+ //(void)@selector(e);
+}
diff --git a/test/PCH/Inputs/chain-trivial1.h b/test/PCH/Inputs/chain-trivial1.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/PCH/Inputs/chain-trivial1.h
diff --git a/test/PCH/Inputs/chain-trivial2.h b/test/PCH/Inputs/chain-trivial2.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/PCH/Inputs/chain-trivial2.h
diff --git a/test/PCH/Inputs/preamble.h b/test/PCH/Inputs/preamble.h
new file mode 100644
index 0000000..aee330a
--- /dev/null
+++ b/test/PCH/Inputs/preamble.h
@@ -0,0 +1 @@
+int f(int);
OpenPOWER on IntegriCloud