summaryrefslogtreecommitdiff
path: root/clang/test/PCH/chain-class-extension.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/PCH/chain-class-extension.m')
-rw-r--r--clang/test/PCH/chain-class-extension.m42
1 files changed, 42 insertions, 0 deletions
diff --git a/clang/test/PCH/chain-class-extension.m b/clang/test/PCH/chain-class-extension.m
new file mode 100644
index 0000000..c99d6d4
--- /dev/null
+++ b/clang/test/PCH/chain-class-extension.m
@@ -0,0 +1,42 @@
+// Without PCH
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin10 -fobjc-arc %s -include %s -include %s
+
+// With PCH
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin10 -fobjc-arc %s -chain-include %s -chain-include %s
+
+#ifndef HEADER1
+#define HEADER1
+//===----------------------------------------------------------------------===//
+// Primary header
+
+@interface I
++(void)meth;
+@end
+
+//===----------------------------------------------------------------------===//
+#elif !defined(HEADER2)
+#define HEADER2
+#if !defined(HEADER1)
+#error Header inclusion order messed up
+#endif
+
+//===----------------------------------------------------------------------===//
+// Dependent header
+
+@interface I()
+@property (assign) id prop;
++(void)meth2;
+@end
+
+//===----------------------------------------------------------------------===//
+#else
+//===----------------------------------------------------------------------===//
+
+void foo(I *i) {
+ [I meth];
+ [I meth2];
+ i.prop = 0;
+}
+
+//===----------------------------------------------------------------------===//
+#endif