]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/PCH/chain-categories2.m
Vendor import of clang trunk r154661:
[FreeBSD/FreeBSD.git] / test / PCH / chain-categories2.m
1 // Test that infinite loop in rdar://10418538 was fixed.
2
3 // Without PCH
4 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -include %s -include %s %s
5
6 // With PCH
7 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s -chain-include %s -chain-include %s
8
9 #ifndef HEADER1
10 #define HEADER1
11 //===----------------------------------------------------------------------===//
12 // Primary header
13
14 @class I;
15
16 @interface I2
17 @property (readonly) id prop1;
18 @end
19
20 //===----------------------------------------------------------------------===//
21 #elif !defined(HEADER2)
22 #define HEADER2
23 #if !defined(HEADER1)
24 #error Header inclusion order messed up
25 #endif
26
27 //===----------------------------------------------------------------------===//
28 // Dependent header
29
30 @interface I
31 @end
32
33 @interface I(Cat1)
34 @end
35
36 @interface I(Cat2)
37 @end
38
39 @interface I2()
40 @property (readwrite,assign) id prop1;
41 @property (copy) id prop2;
42 @end
43
44 //===----------------------------------------------------------------------===//
45 #else
46 //===----------------------------------------------------------------------===//
47
48 void f(I* i) {
49   [i meth]; // expected-warning {{not found}}
50 }
51
52 @implementation I2
53 @synthesize prop1, prop2;
54 @end
55
56 //===----------------------------------------------------------------------===//
57 #endif