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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Ensure that overload resolution does not produce warnings as
2
   side-effects.  */
3
/* { dg-do run } */
4
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
5
 
6
#include "../objc-obj-c++-shared/TestsuiteObject.m"
7
#include 
8
 
9
#define CHECK_IF(E) if(!(E)) abort ()
10
 
11
@interface MyCursor: TestsuiteObject
12
+ (MyCursor *)crosshairCursor;
13
@end
14
 
15
@class MyImage;
16
 
17
class A {
18
public:
19
    A();
20
 
21
    int foo(MyImage *);
22
    int foo(MyCursor *);
23
};
24
 
25
A::A() {}
26
int A::foo(MyCursor * c) { return 17; }
27
int A::foo(MyImage * i) { return 29; }
28
 
29
@implementation MyCursor
30
+ (MyCursor *)crosshairCursor {
31
  return self;
32
}
33
@end
34
 
35
int main(void) {
36
  A a;
37
 
38
  int r = a.foo([MyCursor crosshairCursor]);
39
 
40
  CHECK_IF (r == 17);
41
  return 0;
42
}
43
 

powered by: WebSVN 2.1.0

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