d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / test19754.d
bloba7ad4ac651e830d54b306fec86f7689d1c631659
1 // https://issues.dlang.org/show_bug.cgi?id=19754
3 void test19754()
5 shared int x;
6 static assert((cast(int*) &x) == &(cast() x));
7 (cast() x) = 5;
8 (cast() x) += 3;
10 const int x1;
11 static assert(&x1 == &(cast() x1));
12 (cast() x1) = 5;
13 (cast() x1) *= 3;
15 immutable int x2;
16 static assert(&x2 == &(cast() x2));
17 (cast() x2) = 5;
18 (cast() x2) &= 3;
20 int[4] a;
21 (cast(long[2]) a)[0] = 5;
22 (cast(long[2]) a)[0] += 3;
24 static if (is(__vector(int[4])))
26 __vector(int[4]) v;
27 (cast(int[4]) v)[0] = 5;
28 (cast(int[4]) v)[0] += 3;
32 // https://issues.dlang.org/show_bug.cgi?id=20608
34 void foo(T...)(auto ref T args) {}
36 struct Tuple
38 int expand;
41 void test20608()
43 enum tup = Tuple();
44 foo(tup.expand);