comparison gcc/testsuite/gcc.c-torture/execute/20180226-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* PR rtl-optimization/83496 */
2 /* Reported by Hauke Mehrtens <gcc@hauke-m.de> */
3
4 extern void abort (void);
5
6 typedef unsigned long mp_digit;
7
8 typedef struct { int used, alloc, sign; mp_digit *dp; } mp_int;
9
10 int mytest(mp_int *a, mp_digit b) __attribute__((noclone, noinline));
11
12 int mytest(mp_int *a, mp_digit b)
13 {
14 if (a->sign == 1)
15 return -1;
16 if (a->used > 1)
17 return 1;
18 if (a->dp[0] > b)
19 return 1;
20 if (a->dp[0] < b)
21 return -1;
22 return 0;
23 }
24
25 int main (void)
26 {
27 mp_int i = { 2, 0, -1 };
28 if (mytest (&i, 0) != 1)
29 abort ();
30 return 0;
31 }