Mercurial > projects > ldc
annotate tests/mini/arrays4.d @ 468:45a67b6f1310
Removed the 'needsstorage' thing from Dsymbol. Arguments are not always given storage when applicable. This is not longer treat specially
in this regard. Code for accessing nested variables and contexts rewritten. Probably more. Fairly well tested.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 04 Aug 2008 02:59:34 +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 } |