Mercurial > projects > ldc
annotate tests/mini/arrays4.d @ 1419:a6dfd3cb5b99 0.9.1
Error instead of assert on delegate literals as constant expressions.
Make function literal linkage internal inside functions and external otherwise.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 27 May 2009 19:20:18 +0200 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
36
c0967c4b2a74
[svn r40] Cleaned up some of the array routines to use gep/load/store instead of memcpy/memset.
lindquist
parents:
diff
changeset
|
1 module arrays4; |
175
c44e6a711885
[svn r191] Fixed: array literals did not support all type/storage combinations.
lindquist
parents:
40
diff
changeset
|
2 |
36
c0967c4b2a74
[svn r40] Cleaned up some of the array routines to use gep/load/store instead of memcpy/memset.
lindquist
parents:
diff
changeset
|
3 void main() |
c0967c4b2a74
[svn r40] Cleaned up some of the array routines to use gep/load/store instead of memcpy/memset.
lindquist
parents:
diff
changeset
|
4 { |
40 | 5 int[] arr; |
6 arr ~= 3; | |
7 assert(arr.length == 1); | |
8 assert(arr[0] == 3); | |
9 arr ~= 5; | |
10 assert(arr.length == 2); | |
11 assert(arr[0] == 3); | |
12 assert(arr[1] == 5); | |
36
c0967c4b2a74
[svn r40] Cleaned up some of the array routines to use gep/load/store instead of memcpy/memset.
lindquist
parents:
diff
changeset
|
13 } |