OSDN Git Service

2010-04-01 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / method-17.mm
1 /* When there is only one candidate method available, make sure the
2    compiler uses its argument/return types when constructing the
3    message sends (so that proper C/C++ argument conversions may
4    take place).  */
5 /* { dg-do run } */
6 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7 #include "../objc-obj-c++-shared/Object1.h"
8 #include <stdlib.h>
9
10 #define CHECK_IF(expr) if(!(expr)) abort()
11
12 static double d = 4.5920234e2;
13
14 @interface Foo : Object
15 -(void) brokenType: (int)x floatingPoint: (double)y;
16 @end
17
18
19 @implementation Foo
20 -(void) brokenType: (int)x floatingPoint: (double)y
21 {
22         CHECK_IF(x == 459);
23         CHECK_IF(y == d);
24 }
25 @end
26
27 int main(void)
28 {
29         Foo *foo=[Foo new];
30         [foo brokenType: (int)d floatingPoint: d];
31         return 0;
32 }
33 #include "../objc-obj-c++-shared/Object1-implementation.h"