Mercurial > projects > ldc
annotate tests/mini/memory1.d @ 974:815e1b8c6b00
Allow 'return exp;' for void main().
It's unfortunate that for main the llvm type and D type don't match up...
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 17 Feb 2009 18:53:15 +0100 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
34 | 1 module memory1; |
2 | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
34
diff
changeset
|
3 extern(C) int printf(char*,...); |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
34
diff
changeset
|
4 |
34 | 5 void main() |
6 { | |
7 auto a = new int[16]; | |
8 {printf("array.length = %u\n", a.length);} | |
9 {a.length = a.length + 1;} | |
10 {printf("array.length = %u\n", a.length);} | |
11 {assert(a.length == 17);} | |
12 } |