c++: fix explicit/copy problem [PR109247]
[official-gcc.git] / gcc / testsuite / gdc.dg / torture / gdc171.d
bloba6c5ea6986a64ca7632cd496c2f92aa17dbc13dc
1 // https://bugzilla.gdcproject.org/show_bug.cgi?id=171
2 // { dg-do run }
3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
5 void test171a()
7 int count = 0;
8 short a = -1;
9 while (a != 0)
11 a >>>= 1;
12 count++;
13 assert(count <= 16);
17 void test171b()
19 uint[3] lhs = [99, 201, 300],
20 rhs = [-1, 0, 0];
21 long t = 0;
23 for (int i = 0; i < 3; i++)
25 t += lhs[i];
26 t -= rhs[i];
27 lhs[i] = cast(uint) t;
28 t >>= uint.sizeof * 8;
31 assert(lhs == [100, 200, 300]);
34 void main()
36 test171a();
37 test171b();