]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ARCMT/objcmt-protocol-conformance.m.result
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / ARCMT / objcmt-protocol-conformance.m.result
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -objcmt-migrate-protocol-conformance -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
3 // RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
5
6 @interface NSObject @end
7
8 @protocol P
9 - (id) Meth1: (double) arg;
10 @end
11
12 @interface Test1<P>   // Test for no super class and no protocol list
13 @end
14
15 @implementation Test1
16 - (id) Meth1: (double) arg { return 0; }
17 @end
18
19 @protocol P1 @end
20 @protocol P2 @end
21
22 @interface Test2 <P1, P2, P>  // Test for no super class and with protocol list
23 {
24   id IVAR1;
25   id IVAR2;
26 }
27 @end
28
29 @implementation Test2
30 - (id) Meth1: (double) arg { return 0; }
31 @end
32
33 @interface Test3 : NSObject<P>   { // Test for Super class and no  protocol list
34   id IV1;
35 }
36 @end
37
38 @implementation Test3
39 - (id) Meth1: (double) arg { return 0; }
40 @end
41
42 @interface Test4 : NSObject <P1, P2, P> // Test for Super class and protocol list
43 @end
44
45 @implementation Test4
46 - (id) Meth1: (double) arg { return 0; }
47 @end
48
49 // Test5 - conforms to P3 because it implement's P3's property.
50 @protocol P3
51 @property (copy) id Prop;
52 @end
53
54 @protocol P4
55 @property (copy) id Prop;
56 @end
57
58 @interface Test5 : NSObject<P3, P4>
59 @end
60
61 @implementation Test5
62 @synthesize Prop=_XXX;
63 @end
64
65 @protocol P5 <P3, P4>
66 @property (copy) id Prop;
67 @end
68
69 @protocol P6 <P3, P4, P5>
70 @property (copy) id Prop;
71 @end
72
73 @interface Test6 : NSObject<P6>  // Test for minimal listing of conforming protocols
74 @property (copy) id Prop;
75 @end
76
77 @implementation Test6 
78 @end
79
80 @class UIDynamicAnimator, UIWindow;
81 @interface UIResponder : NSObject
82 @end
83
84 @protocol EmptyProtocol
85 @end
86
87 @protocol OptionalMethodsOnly
88 @optional
89 - (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
90 - (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
91 @end
92
93 @protocol OptionalPropertiesOnly
94 @optional
95 @property (strong, nonatomic) id OptionalProperty;
96 @end
97
98 @protocol OptionalEvrything
99 @optional
100 - (void)dynamicAnimatorWillResume:(UIDynamicAnimator*)animator;
101 @property (strong, nonatomic) id OptionalProperty;
102 - (void)dynamicAnimatorDidPause:(UIDynamicAnimator*)animator;
103 @end
104
105 @protocol UIApplicationDelegate
106 @end
107
108 @interface Test7 : UIResponder <UIApplicationDelegate>
109 @property (strong, nonatomic) UIWindow *window;
110 @end
111
112 @implementation Test7
113 @end
114