OSDN Git Service

Fix PR 17408 and PR 17409.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20000402-1.c
1 #include <limits.h>
2
3 #if ULONG_LONG_MAX != 18446744073709551615ull && ULONG_MAX != 18446744073709551615ull
4 int main(void) { exit (0); }
5 #else
6 #if ULONG_MAX != 18446744073709551615ull
7 typedef unsigned long long ull;
8 #else
9 typedef unsigned long ull;
10 #endif
11
12 #include <stdio.h>
13
14 void checkit(int);
15
16 main () {
17     const ull a = 0x1400000000ULL;
18     const ull b = 0x80000000ULL;
19     const ull c = a/b;
20     const ull d = 0x1400000000ULL / 0x80000000ULL;
21
22     checkit ((int) c);
23     checkit ((int) d);
24
25     exit(0);
26 }
27
28 void checkit (int a)
29 {
30   if (a != 40)
31     abort();
32 }
33 #endif