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