]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/test15898.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test15898.d
1 // REQUIRED_ARGS: -O
2 // https://issues.dlang.org/show_bug.cgi?id=15898
3
4 int addAssignSimple(int[] , const(int)[] )
5 {
6 uint c;
7 return c;
8 }
9
10 void mulKaratsuba(int[] result, const(int)[] x, const(int)[] y, int[] )
11 {
12 const(int)[] y1 = y;
13 int[] newscratchbuff;
14 int[] resultHigh = result;
15
16 bool ysmaller2 = x.length >= y1.length;
17 newscratchbuff[0..y1.length] = resultHigh;
18 mulKaratsuba(
19 resultHigh[1..$],
20 ysmaller2 ? x[1..$] : y1,
21 ysmaller2 ? y1 : x,
22 newscratchbuff[y1.length..$]
23 );
24
25 addAssignSimple(resultHigh[1..$], newscratchbuff[0..y1.length]);
26 }
27