struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20180226-1.c
blobf2138de4c6040ee56ae795fc82e949d8e2b4c2cb
1 /*
2 20180226-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* PR rtl-optimization/83496 */
8 /* Reported by Hauke Mehrtens <gcc@hauke-m.de> */
10 typedef unsigned long mp_digit;
12 typedef struct { int used, alloc, sign; mp_digit *dp; } mp_int;
14 int mytest(mp_int *a, mp_digit b);
16 int mytest(mp_int *a, mp_digit b)
18 if (a->sign == 1)
19 return -1;
20 if (a->used > 1)
21 return 1;
22 if (a->dp[0] > b)
23 return 1;
24 if (a->dp[0] < b)
25 return -1;
26 return 0;
29 void
30 testTortureExecute (void)
32 mp_int i = { 2, 0, -1 };
33 if (mytest (&i, 0) != 1)
34 ASSERT (0);
35 return;