Rebase.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr34174-1.c
blob0f1ed067fb47631701203f538101bf7ac74b05b3
1 /* { dg-do run } */
2 /* Based on PR target/27386 testcase by Joerg Wunsch. */
4 extern void abort (void);
5 extern void exit (int);
7 #if __INT_MAX__ >= 9223372036854775807LL
8 typedef unsigned int uint64_t;
9 #elif __LONG_MAX__ >= 9223372036854775807LL
10 typedef unsigned long int uint64_t;
11 #elif __LONG_LONG_MAX__ >= 9223372036854775807LL
12 typedef unsigned long long int uint64_t;
13 #else
14 int
15 main (void)
17 exit (0);
19 #endif
21 uint64_t a, b, c;
23 int
24 foo (uint64_t x, uint64_t y, uint64_t z, int i)
26 a = x;
27 b = y;
28 c = z;
29 return 2 * i;
32 int
33 main (void)
35 if (foo (1234512345123ull, 3456734567345ull, 7897897897897ull, 42) != 84)
36 abort ();
37 if (a != 1234512345123ull)
38 abort ();
39 if (b != 3456734567345ull)
40 abort ();
41 if (c != 7897897897897ull)
42 abort ();
43 exit (0);