OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [protocol-forward-2.mm] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , December 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test that all protocols appearing in @interface declarations are
5
   real (ie, we saw a full @protocol definition with list of methods),
6
   and not just forward-references (ie, "@protocol NSObject;").  This
7
   test checks protocols implemented by other protocols.  */
8
 
9
#include 
10
 
11
@protocol MyProtocol;
12
 
13
@interface MyClass  /* { dg-warning "definition of protocol .MyProtocol. not found" } */
14
@end
15
 
16
 
17
@protocol MyProtocol2 
18
- (int)method2;
19
@end
20
 
21
@interface MyClass2  /* { dg-warning "definition of protocol .MyProtocol. not found" } */
22
- (int)method2;
23
@end
24
 
25
 
26
@protocol MyProtocol3 
27
- (int)method3;
28
@end
29
 
30
@interface MyClass3   /* { dg-warning "definition of protocol .MyProtocol. not found" } */
31
- (int)method2;
32
- (int)method3;
33
@end
34
 
35
 
36
@protocol MyProtocol4 
37
- (int)method4;
38
@end
39
 
40
@interface MyClass4   /* { dg-warning "definition of protocol .MyProtocol. not found" } */
41
- (int)method2;
42
- (int)method3;
43
- (int)method4;
44
@end
45
 
46
 
47
@protocol MyProtocol5
48
- (int)method5;
49
@end
50
 
51
@interface MyClass5  /* Ok */
52
- (int)method5;
53
@end
54
 
55
 
56
@protocol MyProtocol6 
57
- (int)method6;
58
@end
59
 
60
@interface MyClass6  /* Ok */
61
- (int)method5;
62
- (int)method6;
63
@end
64
 
65
 
66
@protocol MyProtocol7 
67
- (int)method7;
68
@end
69
 
70
@interface MyClass7  /* { dg-warning "definition of protocol .MyProtocol. not found" } */
71
- (int)method2;
72
- (int)method3;
73
- (int)method4;
74
- (int)method5;
75
- (int)method7;
76
@end
77
 
78
 
79
/* Now test that if we finally define MyProtocol, the warnings go away.  */
80
@protocol MyProtocol
81
- (int)method;
82
@end
83
 
84
@protocol MyProtocol8 
85
- (int)method8;
86
@end
87
 
88
@interface MyClass8  /* Ok */
89
- (int)method;
90
- (int)method2;
91
- (int)method3;
92
- (int)method4;
93
- (int)method5;
94
- (int)method8;
95
@end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.