| 1 |
/* |
| 2 |
PERMUTE_ARGS: |
| 3 |
RUN_OUTPUT: |
| 4 |
--- |
| 5 |
Success |
| 6 |
--- |
| 7 |
*/ |
| 8 |
|
| 9 |
import core.stdc.stdio; |
| 10 |
import core.stdc.math : isnan; |
| 11 |
|
| 12 |
void test12826() |
| 13 |
{ |
| 14 |
string s, t; |
| 15 |
t = t ~ "1234567"; |
| 16 |
s = s ~ "1234567"; |
| 17 |
|
| 18 |
s ~= s; |
| 19 |
assert(s == "12345671234567", s); |
| 20 |
assert(t == "1234567", t); |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
int[] a; |
| 27 |
|
| 28 |
for (int i = 0; i < 1000; i++) |
| 29 |
{ |
| 30 |
a.length = a.length + 100; |
| 31 |
} |
| 32 |
foreach (v; a) |
| 33 |
{ |
| 34 |
assert(v == 0); |
| 35 |
} |
| 36 |
|
| 37 |
float[] b; |
| 38 |
for (int i = 0; i < 2000; i++) |
| 39 |
{ |
| 40 |
b.length = b.length + 100; |
| 41 |
} |
| 42 |
foreach (v; b) |
| 43 |
{ |
| 44 |
assert(isnan(v)); |
| 45 |
} |
| 46 |
destroy(a); |
| 47 |
destroy(b); |
| 48 |
|
| 49 |
a = null; |
| 50 |
for (int i = 0; i < 100000; i++) |
| 51 |
{ |
| 52 |
a ~= i; |
| 53 |
} |
| 54 |
foreach (k, v; a) |
| 55 |
{ |
| 56 |
assert(v == k); |
| 57 |
} |
| 58 |
|
| 59 |
b = null; |
| 60 |
for (int i = 0; i < 200000; i++) |
| 61 |
{ |
| 62 |
b ~= i; |
| 63 |
} |
| 64 |
foreach (k, v; b) |
| 65 |
{ |
| 66 |
assert(v == k); |
| 67 |
} |
| 68 |
destroy(a); |
| 69 |
destroy(b); |
| 70 |
|
| 71 |
test12826(); |
| 72 |
printf("Success\n"); |
| 73 |
return 0; |
| 74 |
} |