summaryrefslogtreecommitdiff
path: root/clang/test/PCH/Inputs
diff options
context:
space:
mode:
authorZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
committerZancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au>2012-09-24 09:58:17 +1000
commit222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch)
tree7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/PCH/Inputs
parent3d206f03985b50beacae843d880bccdc91a9f424 (diff)
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/PCH/Inputs')
-rw-r--r--clang/test/PCH/Inputs/arc.h26
-rw-r--r--clang/test/PCH/Inputs/chain-decls1.h11
-rw-r--r--clang/test/PCH/Inputs/chain-decls2.h12
-rw-r--r--clang/test/PCH/Inputs/chain-ext_vector1.h3
-rw-r--r--clang/test/PCH/Inputs/chain-ext_vector2.h3
-rw-r--r--clang/test/PCH/Inputs/chain-external-defs1.h13
-rw-r--r--clang/test/PCH/Inputs/chain-external-defs2.h11
-rw-r--r--clang/test/PCH/Inputs/chain-macro-override1.h5
-rw-r--r--clang/test/PCH/Inputs/chain-macro-override2.h5
-rw-r--r--clang/test/PCH/Inputs/chain-macro1.h1
-rw-r--r--clang/test/PCH/Inputs/chain-macro2.h1
-rw-r--r--clang/test/PCH/Inputs/chain-remap-types1.h10
-rw-r--r--clang/test/PCH/Inputs/chain-remap-types2.h8
-rw-r--r--clang/test/PCH/Inputs/chain-selectors1.h16
-rw-r--r--clang/test/PCH/Inputs/chain-selectors2.h15
-rw-r--r--clang/test/PCH/Inputs/chain-trivial1.h0
-rw-r--r--clang/test/PCH/Inputs/chain-trivial2.h0
-rw-r--r--clang/test/PCH/Inputs/cxx-method.h6
-rw-r--r--clang/test/PCH/Inputs/namespaces.h44
-rw-r--r--clang/test/PCH/Inputs/preamble.h1
-rw-r--r--clang/test/PCH/Inputs/typo.h6
-rw-r--r--clang/test/PCH/Inputs/typo.hpp8
-rw-r--r--clang/test/PCH/Inputs/va_arg.h2
-rw-r--r--clang/test/PCH/Inputs/working-directory-1.h5
24 files changed, 212 insertions, 0 deletions
diff --git a/clang/test/PCH/Inputs/arc.h b/clang/test/PCH/Inputs/arc.h
new file mode 100644
index 0000000..304e612
--- /dev/null
+++ b/clang/test/PCH/Inputs/arc.h
@@ -0,0 +1,26 @@
+// Header for Objective-C ARC-related PCH tests
+
+typedef const void *CFTypeRef;
+typedef const struct __CFString *CFStringRef;
+
+CFTypeRef CFCreateSomething();
+CFStringRef CFCreateString();
+CFTypeRef CFGetSomething();
+CFStringRef CFGetString();
+
+@interface NSString
+@end
+
+id CreateSomething();
+NSString *CreateNSString();
+
+#if __has_feature(objc_arc)
+#define BRIDGE __bridge
+#else
+#define BRIDGE
+#endif
+
+typedef int array0[sizeof((BRIDGE id)CFCreateSomething())];
+typedef int array1[sizeof((BRIDGE CFTypeRef)CreateSomething())];
+
+
diff --git a/clang/test/PCH/Inputs/chain-decls1.h b/clang/test/PCH/Inputs/chain-decls1.h
new file mode 100644
index 0000000..9de4461
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-decls2.h b/clang/test/PCH/Inputs/chain-decls2.h
new file mode 100644
index 0000000..b8b7d04
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-ext_vector1.h b/clang/test/PCH/Inputs/chain-ext_vector1.h
new file mode 100644
index 0000000..5109336
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-ext_vector2.h b/clang/test/PCH/Inputs/chain-ext_vector2.h
new file mode 100644
index 0000000..bdaeccc
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-external-defs1.h b/clang/test/PCH/Inputs/chain-external-defs1.h
new file mode 100644
index 0000000..36a2653
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-external-defs2.h b/clang/test/PCH/Inputs/chain-external-defs2.h
new file mode 100644
index 0000000..72af92f
--- /dev/null
+++ b/clang/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/clang/test/PCH/Inputs/chain-macro-override1.h b/clang/test/PCH/Inputs/chain-macro-override1.h
new file mode 100644
index 0000000..d956396
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-macro-override1.h
@@ -0,0 +1,5 @@
+void f() __attribute__((unavailable));
+void g();
+#define g() f()
+#define h() f()
+#define x x
diff --git a/clang/test/PCH/Inputs/chain-macro-override2.h b/clang/test/PCH/Inputs/chain-macro-override2.h
new file mode 100644
index 0000000..e4bff77
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-macro-override2.h
@@ -0,0 +1,5 @@
+#define f() g()
+#undef g
+#undef h
+#define h() g()
+int x;
diff --git a/clang/test/PCH/Inputs/chain-macro1.h b/clang/test/PCH/Inputs/chain-macro1.h
new file mode 100644
index 0000000..2e80e47
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-macro1.h
@@ -0,0 +1 @@
+#define FOOBAR void f();
diff --git a/clang/test/PCH/Inputs/chain-macro2.h b/clang/test/PCH/Inputs/chain-macro2.h
new file mode 100644
index 0000000..e888228
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-macro2.h
@@ -0,0 +1 @@
+#define BARFOO void g();
diff --git a/clang/test/PCH/Inputs/chain-remap-types1.h b/clang/test/PCH/Inputs/chain-remap-types1.h
new file mode 100644
index 0000000..d105489
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-remap-types1.h
@@ -0,0 +1,10 @@
+@class X;
+
+struct Y {
+ X *my_X;
+};
+
+@interface X {
+}
+@property X *prop;
+@end
diff --git a/clang/test/PCH/Inputs/chain-remap-types2.h b/clang/test/PCH/Inputs/chain-remap-types2.h
new file mode 100644
index 0000000..55ca8a9
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-remap-types2.h
@@ -0,0 +1,8 @@
+void h(X*);
+
+@interface X (Blah) {
+}
+@end
+
+void g(X*);
+
diff --git a/clang/test/PCH/Inputs/chain-selectors1.h b/clang/test/PCH/Inputs/chain-selectors1.h
new file mode 100644
index 0000000..b0b68f8
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-selectors1.h
@@ -0,0 +1,16 @@
+@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);
+}
+
+@interface X (Blah)
+- (void)blah_method;
+@end
diff --git a/clang/test/PCH/Inputs/chain-selectors2.h b/clang/test/PCH/Inputs/chain-selectors2.h
new file mode 100644
index 0000000..973fc10
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-selectors2.h
@@ -0,0 +1,15 @@
+@interface Y
+ -(void)f;
+ -(double)f2;
+ -(void)e;
+@end
+
+void foo2() {
+ // FIXME: Can't verify warnings in headers
+ //(void)@selector(y);
+ //(void)@selector(e);
+}
+
+@interface X (Blarg)
+- (void)blarg_method;
+@end
diff --git a/clang/test/PCH/Inputs/chain-trivial1.h b/clang/test/PCH/Inputs/chain-trivial1.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-trivial1.h
diff --git a/clang/test/PCH/Inputs/chain-trivial2.h b/clang/test/PCH/Inputs/chain-trivial2.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/clang/test/PCH/Inputs/chain-trivial2.h
diff --git a/clang/test/PCH/Inputs/cxx-method.h b/clang/test/PCH/Inputs/cxx-method.h
new file mode 100644
index 0000000..6adb859
--- /dev/null
+++ b/clang/test/PCH/Inputs/cxx-method.h
@@ -0,0 +1,6 @@
+struct S {
+ void m(int x);
+
+ operator const char*();
+ operator char*();
+};
diff --git a/clang/test/PCH/Inputs/namespaces.h b/clang/test/PCH/Inputs/namespaces.h
new file mode 100644
index 0000000..bd2c3ee
--- /dev/null
+++ b/clang/test/PCH/Inputs/namespaces.h
@@ -0,0 +1,44 @@
+// Header for PCH test namespaces.cpp
+
+namespace N1 {
+ typedef int t1;
+}
+
+namespace N1 {
+ typedef int t2;
+
+ void used_func();
+
+ struct used_cls { };
+}
+
+namespace N2 {
+ typedef float t1;
+
+ namespace Inner {
+ typedef int t3;
+ };
+}
+
+namespace {
+ void anon() { }
+ class C;
+}
+
+namespace N3 {
+ namespace {
+ class C;
+ }
+}
+
+namespace Alias1 = N2::Inner;
+
+using namespace N2::Inner;
+
+extern "C" {
+ void ext();
+}
+
+inline namespace N4 {
+ struct MemberOfN4;
+}
diff --git a/clang/test/PCH/Inputs/preamble.h b/clang/test/PCH/Inputs/preamble.h
new file mode 100644
index 0000000..aee330a
--- /dev/null
+++ b/clang/test/PCH/Inputs/preamble.h
@@ -0,0 +1 @@
+int f(int);
diff --git a/clang/test/PCH/Inputs/typo.h b/clang/test/PCH/Inputs/typo.h
new file mode 100644
index 0000000..63b553b
--- /dev/null
+++ b/clang/test/PCH/Inputs/typo.h
@@ -0,0 +1,6 @@
+
+
+@interface NSString
++ (id)alloc;
+@end
+
diff --git a/clang/test/PCH/Inputs/typo.hpp b/clang/test/PCH/Inputs/typo.hpp
new file mode 100644
index 0000000..c811595
--- /dev/null
+++ b/clang/test/PCH/Inputs/typo.hpp
@@ -0,0 +1,8 @@
+namespace boost {
+ template<typename F> class function {};
+
+ namespace graph {
+ template<typename V, typename E> class adjacency_list { };
+ };
+}
+
diff --git a/clang/test/PCH/Inputs/va_arg.h b/clang/test/PCH/Inputs/va_arg.h
new file mode 100644
index 0000000..1244e9f
--- /dev/null
+++ b/clang/test/PCH/Inputs/va_arg.h
@@ -0,0 +1,2 @@
+#include <stdarg.h>
+
diff --git a/clang/test/PCH/Inputs/working-directory-1.h b/clang/test/PCH/Inputs/working-directory-1.h
new file mode 100644
index 0000000..e42eda4
--- /dev/null
+++ b/clang/test/PCH/Inputs/working-directory-1.h
@@ -0,0 +1,5 @@
+template<typename T> struct A {
+ A() {
+ int a;
+ }
+};