xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/chain-class-extension.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// Without PCH
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin10 -fobjc-arc %s -include %s -include %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc// With PCH
5*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin10 -fobjc-arc %s -chain-include %s -chain-include %s
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc// expected-no-diagnostics
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambuc#ifndef HEADER1
10*f4a2713aSLionel Sambuc#define HEADER1
11*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
12*f4a2713aSLionel Sambuc// Primary header
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface I
15*f4a2713aSLionel Sambuc+(void)meth;
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
19*f4a2713aSLionel Sambuc#elif !defined(HEADER2)
20*f4a2713aSLionel Sambuc#define HEADER2
21*f4a2713aSLionel Sambuc#if !defined(HEADER1)
22*f4a2713aSLionel Sambuc#error Header inclusion order messed up
23*f4a2713aSLionel Sambuc#endif
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
26*f4a2713aSLionel Sambuc// Dependent header
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc@interface I()
29*f4a2713aSLionel Sambuc@property (assign) id prop;
30*f4a2713aSLionel Sambuc+(void)meth2;
31*f4a2713aSLionel Sambuc@end
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
34*f4a2713aSLionel Sambuc#else
35*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambucvoid foo(I *i) {
38*f4a2713aSLionel Sambuc  [I meth];
39*f4a2713aSLionel Sambuc  [I meth2];
40*f4a2713aSLionel Sambuc  i.prop = 0;
41*f4a2713aSLionel Sambuc}
42*f4a2713aSLionel Sambuc
43*f4a2713aSLionel Sambuc//===----------------------------------------------------------------------===//
44*f4a2713aSLionel Sambuc#endif
45