OSDN Git Service

2011-01-08 Dominique d'Humieres <dominiq@lps.ens.fr>
[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 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7
8 #include "../objc-obj-c++-shared/Object1.h"
9
10 extern void abort(void);
11 #define CHECK_IF(expr) if(!(expr)) abort()
12
13 static double d = 4.5920234e2;
14
15 @interface Foo : Object
16 -(void) brokenType: (int)x floatingPoint: (double)y;
17 @end
18
19
20 @implementation Foo
21 -(void) brokenType: (int)x floatingPoint: (double)y
22 {
23         CHECK_IF(x == 459);
24         CHECK_IF(y == d);
25 }
26 @end
27
28 int main(void)
29 {
30         Foo *foo=[Foo new];
31         [foo brokenType: d floatingPoint: d];
32         return 0;
33 }
34
35 #include "../objc-obj-c++-shared/Object1-implementation.h"