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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [objc.dg/] [method-6.m] - Blame information for rev 309

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* Check that sending messages to variables of type 'Class' does not involve instance methods,
2
   unless they reside in root classes.  */
3
/* Author: Ziemowit Laski <zlaski@apple.com>  */
4
/* { dg-do compile } */
5
/* { dg-options "-Wstrict-selector-match" } */
6
 
7
#include "../objc-obj-c++-shared/Protocol1.h"
8
 
9
@interface Base
10
- (unsigned)port;
11
@end
12
 
13
@interface Derived: Base
14
- (Object *)port;
15
+ (Protocol *)port;
16
- (id)starboard;
17
@end
18
 
19
void foo(void) {
20
  Class receiver;
21
 
22
  [receiver port];  /* { dg-warning "multiple methods named .\\+port. found" } */
23
       /* { dg-message "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 10 } */
24
       /* { dg-message "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 15 } */
25
 
26
  [receiver starboard];  /* { dg-warning "no .\\+starboard. method found" } */
27
       /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 26 } */
28
       /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 26 } */
29
       /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 26 } */
30
 
31
  [Class port];  /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */
32
}

powered by: WebSVN 2.1.0

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