]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/test15862.d
d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / test15862.d
1 // https://issues.dlang.org/show_bug.cgi?id=15862
2
3 /*
4 PERMUTE_ARGS:
5 REQUIRED_ARGS: -O -release
6 */
7
8
9 int* p() pure nothrow {return new int;}
10 int[] a() pure nothrow {return [0];}
11 Object o() pure nothrow {return new Object;}
12
13 auto pa() pure nothrow {return new int;}
14
15 void main()
16 {
17 {
18 int* p1 = p();
19 int* p2 = p();
20
21 if (p1 is p2) assert(0);
22
23 int[] a1 = a();
24 int[] a2 = a();
25
26 if (a1 is a2) assert(0);
27
28 Object o1 = o();
29 Object o2 = o();
30
31 if (o1 is o2) assert(0);
32 }
33 {
34 auto p1 = pa();
35 auto p2 = pa();
36
37 if (p1 is p2) assert(0);
38 }
39 }