PR target/59927
[official-gcc.git] / gcc / testsuite / gcc.target / x86_64 / abi / callabi / func-2a.c
blob513f5619a2ee58d5b94e7d4489d0f52bbcf0823a
1 /* Test for cross x86_64<->w64 abi standard calls. */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -mabi=ms -std=gnu99 -ffast-math -fno-builtin" } */
4 /* { dg-additional-sources "func-2b.c" } */
6 extern void __attribute__ ((sysv_abi)) abort (void);
7 long double func_cross (long double, double, float, long, int, char);
9 long double __attribute__ ((sysv_abi))
10 func_native (long double a, double b, float c, long d, int e, char f)
12 long double ret;
13 ret = a + (long double) b + (long double) c;
14 ret *= (long double) (d + (long) e);
15 if (f>0)
16 ret += func_native (a,b,c,d,e,-f);
17 return ret;
20 int __attribute__ ((sysv_abi))
21 main ()
23 if (func_cross (1.0,2.0,3.0,1,2,3)
24 != func_native (1.0,2.0,3.0,1,2,3))
25 abort ();
26 return 0;