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