1 // REQUIRED_ARGS: 2 // EXECUTE_ARGS: 10000 3 4 extern(C) int printf(const char *, ...); 5 extern(C) int atoi(const char *); 6 main(string[]argv)7 int main (string[] argv) 8 { 9 string s = ""; 10 int count, loop; 11 12 count = atoi((argv[1] ~ '\0').ptr); 13 if (count == 0) 14 count = 1; 15 printf("count = %u\n", count); 16 17 for (loop = 0; loop < count; loop ++) 18 s ~= "hello\n"; 19 for (loop = 0; loop < count; loop ++) 20 s ~= "h"; 21 printf ("%d\n", s.length); 22 //printf("%.*s\n", s[0..100]); 23 assert(s.length == count * (6 + 1)); 24 s.length = 3; 25 s.length = 10; 26 s.length = 0; 27 s.length = 1000; 28 return 0; 29 } 30 31