OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 309 jeremybenn
/* Check if finding multiple signatures for a method is handled gracefully.  */
2
/* Author:  Ziemowit Laski <zlaski@apple.com>  */
3
/* { dg-do compile } */
4
/* { dg-options "-Wstrict-selector-match" } */
5
 
6
 
7
#include "../objc-obj-c++-shared/Object1.h"
8
 
9
@interface Class1
10
- (void)setWindow:(Object *)wdw;
11
@end
12
 
13
@interface Class2
14
- (void)setWindow:(Class1 *)window;
15
@end
16
 
17
id foo(void) {
18
  Object *obj = [[Object alloc] init];
19
  id obj2 = obj;
20
  [obj setWindow:nil];  /* { dg-warning ".Object. may not respond to .\\-setWindow:." } */
21
  /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 20 } */
22
  /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 20 } */
23
  /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 20 } */
24
  [obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
25
  /* { dg-message "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 10 } */
26
  /* { dg-message "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 14 } */
27
 
28
  return obj;
29
}

powered by: WebSVN 2.1.0

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