OSDN Git Service

2005-10-24 Jerry DeLisle <jvdelisle@verizon.net>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / method-10.m
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
7 #include <objc/Object.h>
8 extern void abort(void);
9 #define CHECK_IF(expr) if(!(expr)) abort()
10
11 static double d = 4.5920234e2;
12
13 @interface Foo : Object
14 -(void) brokenType: (int)x floatingPoint: (double)y;
15 @end
16
17
18 @implementation Foo
19 -(void) brokenType: (int)x floatingPoint: (double)y
20 {
21         CHECK_IF(x == 459);
22         CHECK_IF(y == d);
23 }
24 @end
25
26 int main(void)
27 {
28         Foo *foo=[Foo new];
29         [foo brokenType: d floatingPoint: d];
30         return 0;
31 }
32