2 920501-2.c from the execute part of the gcc torture suite.
11 // Todo: Enable when sdcc supports long long
14 gcd_ll (unsigned long long x
, unsigned long long y
)
19 return (unsigned long) x
;
22 return (unsigned long) y
;
28 powmod_ll (unsigned long long b
, unsigned e
, unsigned long long m
)
31 unsigned long long pow
;
37 /* Find the most significant bit in E. */
39 for (i
= 0; t
!= 0; i
++)
42 /* The most sign bit in E is handled outside of the loop, by beginning
43 with B in POW, and decrementing I. */
57 unsigned long factab
[10];
60 facts (t
, a_int
, x0
, p
)
66 unsigned long *xp
= factab
;
67 unsigned long long x
, y
;
69 unsigned long long a
= a_int
;
79 for (i
= 1; i
< 10000; i
++)
81 x
= powmod_ll (x
, p
, t
) + a
;
82 y
= powmod_ll (y
, p
, t
) + a
;
83 y
= powmod_ll (y
, p
, t
) + a
;
89 q
= (unsigned long long) q
* tmp
% t
;
112 testTortureExecute (void)
115 unsigned long long t
;
126 if (factab
[0] != 7 || factab
[1] != 73 || factab
[2] != 262657)