Debian Codegraph @

gcc/testsuite/gdc.test/compilable/inliner2.d

raw
1 // REQUIRED_ARGS: -O -inline
2
3 struct Cent
4 {
5 ulong lo; // low 64 bits
6 ulong hi; // high 64 bits
7 }
8
9 pure bool tst(Cent c)
10 {
11 return c.hi || c.lo;
12 }
13
14 pure Cent dec(Cent c);
15 pure Cent shl(Cent c, uint n);
16
17 pure Cent udivmod(Cent c1, Cent c2, out Cent modulus)
18 {
19 ulong v1 = shl(c2, 3).hi;
20
21 Cent quotient;
22
23 if (tst(quotient))
24 quotient = dec(quotient);
25
26 return quotient;
27 }