Mercurial > projects > ldc
annotate test/staticarrays.d @ 275:665b81613475 trunk
[svn r296] Removed: the 'suite' dir, it never took off!
Fixed: foreach statement, key-type checks were buggy.
Fixed: setting LLVMDC versions on the command line is now an error.
Fixed: array compare runtime had incorrect param attrs on call.
Fixed: index expressions on dynamic array slices w/o storage was broken.
Fixed: scope classes had incorrect finalization in some cases.
Fixed: when outputting !ClassInfoS !OffsetTypeInfoS, static class members were trying to be included, crashing the compiler.
Fixed: calling LLVMDC with -inline but not any -O option caused assertion failure.
Changed: the runtime now uses a single interface to "get" to !TypeInfoS, part of eliminating duplicate !TypeInfo codegen.
author | lindquist |
---|---|
date | Thu, 19 Jun 2008 17:30:32 +0200 |
parents | d9d5d59873d8 |
children | 385a18242485 |
rev | line source |
---|---|
270
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
1 extern(C) int printf(char*, ...); |
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
2 |
1 | 3 void numbers() |
4 { | |
5 bool[8] bools; | |
6 char[8] chars; | |
7 byte[8] bytes; | |
8 short[8] shorts; | |
9 int[8] ints; | |
10 long[8] longs; | |
11 float[8] floats; | |
12 double[8] doubles; | |
13 real[8] reals; | |
14 { | |
15 bools[7] = true; | |
16 floats[7] = 3.14159265; | |
17 { | |
18 printf("bools[0] = %d, bools[7] = %d\n", bools[0], bools[7]); | |
19 printf("floats[0] = %f, floats[7] = %f\n", floats[0], floats[7]); | |
20 } | |
21 } | |
22 } | |
23 | |
24 struct S | |
25 { | |
26 int i = 42; | |
27 void print() | |
28 { | |
29 printf("S.i = %d\n", i); | |
30 } | |
31 } | |
32 | |
33 class C | |
34 { | |
35 int i; | |
36 this() | |
37 { | |
38 i = 3; | |
39 } | |
40 void print() | |
41 { | |
42 printf("C.i = %d\n", i); | |
43 } | |
44 } | |
45 | |
46 void refs() | |
47 { | |
48 void*[5] voids; | |
49 S*[5] structs; | |
50 C[5] classes; | |
51 | |
52 { | |
53 voids[0] = cast(void*)0xA; | |
54 printf("void* = %p\n", voids[0]); | |
55 } | |
56 { | |
57 structs[0] = new S; | |
58 structs[0].print(); | |
59 delete structs[0]; | |
60 } | |
61 { | |
62 classes[0] = new C; | |
63 classes[0].print(); | |
64 delete classes[0]; | |
65 } | |
66 } | |
67 | |
68 void main() | |
69 { | |
70 numbers(); | |
71 refs(); | |
72 } |