No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / tf_to_di-1.c
blobf4f478a0f7ccbe6364d357ffc64322666e58ead5
1 /* { dg-do run { target s390*-*-* } } */
2 /* { dg-options "-O0 -mlong-double-128" } */
4 #include <stdio.h>
5 #include <stdlib.h>
7 void
8 check_ll (long double ld, long long ll)
10 if ((long long)ld != ll)
12 printf ("ld: %Lf expect: %lld result: %lld\n",
13 ld, ll, (long long)ld);
14 abort ();
18 void
19 check_ull (long double ld, unsigned long long ull)
21 if ((unsigned long long)ld != ull)
23 printf ("ld: %Lf expect: %llu result: %llu\n",
24 ld, ull, (unsigned long long)ld);
25 abort ();
29 int
30 main ()
32 const long long ll_max = (long long)((1ULL << 63) - 1);
33 const long long ll_min = -ll_max - 1;
35 check_ll (206.23253, 206LL);
36 check_ull (206.23253, 206ULL);
37 check_ll ((long double)ll_max, ll_max);
38 check_ull ((long double)ll_max, ll_max);
39 check_ll ((long double)ll_min, ll_min);
40 check_ll (0.0, 0);
41 check_ull (0.0, 0);
42 check_ll (-1.0, -1);
43 check_ll ((long double)0xffffffffffffffffULL, ll_max);
44 check_ull ((long double)0xffffffffffffffffULL, 0xffffffffffffffffULL);
46 return 0;