annotate run/ptr_02.d @ 1619:bebc7472a832

Fix #7.
author Christian Kamm <kamm incasoftware de>
date Sat, 07 Nov 2009 18:55:30 +0100
parents 1a77f6d93b45
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
168
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
1 // $HeadURL$
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
2 // $Date$
199
1a77f6d93b45 1) added websvn links
thomask
parents: 168
diff changeset
3 // $Author$
168
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
4
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
5 module dstress.run.ptr_02;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
6
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
7 int main(){
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
8 Object[] array;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
9 array.length=3;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
10
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
11 Object a = new Object();
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
12 Object b = new Object();
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
13 Object c = new Object();
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
14
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
15 array[1]=b;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
16 array[2]=c;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
17 array[0]=a;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
18
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
19 assert(*array.ptr == a);
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
20
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
21 return 0;
a9d16ec2b848 added basic ptr tests
thomask
parents:
diff changeset
22 }