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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [proto-hier-2.m] - Blame information for rev 714

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

Line No. Rev Author Line
1 704 jeremybenn
/* Test protocol warning.  */
2
/* Contributed by Devang Patel <dpatel@apple.com>.  */
3
/* { dg-do compile } */
4
 
5
typedef struct objc_object { struct objc_class *class_pointer; } *id;
6
 
7
@protocol Bar
8
@end
9
 
10
id <Bar> Foo_Bar () { }
11
 
12
typedef struct
13
{
14
        int i;
15
} MyStruct;
16
 
17
@interface Foo
18
{
19
  id _mainData;
20
  MyStruct *_anotherData;
21
}
22
 
23
-(id) mainDataSource;
24
-(id) anotherDataSource;
25
-(id) my_method: (int) i;
26
@end
27
 
28
@implementation Foo
29
-(id) anotherDataSource
30
{
31
        return (id)_anotherData;
32
}
33
 
34
-(id) mainDataSource
35
{
36
        return _mainData;
37
}
38
 
39
-(id) my_method: (int) i
40
{
41
  id one = [self anotherDataSource];
42
 
43
  i = i - 1;
44
  // Do not issue warning about my_method not found in protocol
45
  return [(one ? [self mainDataSource] : one) my_method:i];
46
}
47
 
48
@end
49
 

powered by: WebSVN 2.1.0

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