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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [proto-lossage-1.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Test for situations in which protocol conformance information
2
   may be lost, leading to superfluous warnings.  */
3
/* Author: Ziemowit Laski .  */
4
/* { dg-do compile } */
5
 
6
/* One-line substitute for objc/objc.h */
7
typedef struct objc_object { struct objc_class *class_pointer; } *id;
8
 
9
@protocol NSObject
10
- (int)someValue;
11
@end
12
 
13
@interface NSObject 
14
@end
15
 
16
@protocol PlateMethods
17
- (void)someMethod;
18
@end
19
 
20
@interface Foo {
21
  NSObject  *plate;
22
  id  plate1;
23
  NSObject *plate2;
24
}
25
- (id ) getPlate;
26
- (id ) getPlate1;
27
- (int) getValue;
28
@end
29
 
30
@implementation Foo
31
- (id ) getPlate {
32
  return plate;  /* { dg-bogus "does not implement" } */
33
}
34
- (id ) getPlate1 {
35
  return (id )plate1; /* { dg-bogus "does not conform" } */
36
}
37
- (int) getValue {
38
  int i = [plate1 someValue];   /* { dg-warning ".\\-someValue. not found in protocol\\(s\\)" } */
39
 
40
  int j = [(id )plate1 someValue];  /* { dg-bogus "not found in protocol" } */
41
  int k = [(id)plate1 someValue]; /* { dg-bogus "not found in protocol" } */
42
  return i + j + k;
43
}
44
@end

powered by: WebSVN 2.1.0

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