annotate test/arrays11.d @ 131:5825d48b27d1 trunk

[svn r135] * Merged DMD 1.025 * * Fixed a minor linking order mishap * * Added an command line option -annotate * * Fixed some problems with running optimizations * * Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) * * Fixed problems with passing aggregate types to variadic functions * * Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory * * Fixed problems with resolving nested function context pointers for some heavily nested cases * * Redid function argument passing + other minor code cleanups, still lots to do on this end... *
author lindquist
date Fri, 04 Jan 2008 01:38:42 +0100
parents 6789050b5ad1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
1 module arrays11;
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
2
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
3 void ints()
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
4 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
5 int[] a = [1,2,3,4,5,6];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
6 {assert(a == a);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
7
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
8 int[] b = [4,5,6,7,8,9];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
9 {assert(a != b);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
10 {assert(a[3..$] == b[0..3]);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
11 }
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
12
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
13 void floats()
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
14 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
15 float[] a = [1.0f, 2.0f, 3.0f, 4.0f];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
16 {assert(a == a);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
17
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
18 float[] b = [2.0f, 3.0f, 5.0f];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
19 {assert(a != b);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
20 {assert(a[1..3] == b[0..2]);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
21 }
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
22
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
23 struct S
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
24 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
25 int i;
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
26 int j;
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
27
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
28 int opEquals(S s)
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
29 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
30 return (i == s.i) && (j == s.j);
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
31 }
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
32 }
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
33
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
34 void structs()
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
35 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
36 S[] a = [S(0,0), S(1,0), S(2,0), S(3,0)];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
37 {assert(a == a);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
38 S[] b = [S(0,1), S(1,0), S(2,0), S(3,1)];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
39 {assert(a != b);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
40 {assert(a[1..3] == b[1..3]);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
41
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
42 S[2] c = [S(2,0), S(3,1)];
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
43 {assert(c == b[2..$]);}
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
44 }
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
45
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
46 void main()
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
47 {
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
48 ints();
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
49 floats();
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
50 structs();
6789050b5ad1 [svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
lindquist
parents:
diff changeset
51 }