annotate tests/mini/classes6.d @ 715:30b42a283c8e

Removed TypeOpaque from DMD. Changed runtime functions taking opaque[] to void[]. Implemented proper type painting, to avoid "resizing" array casts in runtime calls that previously took opaque[]. Implemented dynamic arrays as first class types, this implements proper ABI for these types on x86. Added dwarf region end after call to assert function, fixes some problems with llvm not allowing this to be missing. Reverted change to WithStatement from rev [704] it breaks MiniD, mini/with2.d needs to be fixed some other way... Fixed tango bug 1339 in runtime, problem with _adReverseChar on invalid UTF-8. Disabled .bc generation in the compiler runtime part, genobj.d triggers some llvm bug when using debug info. the .o seems to work fine.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 22 Oct 2008 14:55:33 +0200
parents 6aaa3d3c1183
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
1 module classes6;
270
d9d5d59873d8 [svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents: 11
diff changeset
2 extern(C) int printf(char*, ...);
9
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
3
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
4 class C
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
5 {
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
6 void f()
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
7 {
11
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
8 printf("world\n");
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
9 }
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
10 }
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
11
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
12 class D : C
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
13 {
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
14 void f()
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
15 {
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
16 printf("moon\n");
9
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
17 }
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
18 }
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
19
11
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
20
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
21 extern(C)
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
22 {
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
23 void srand(uint seed);
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
24 int rand();
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
25 }
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
26
663
6aaa3d3c1183 First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents: 443
diff changeset
27 import ldc.intrinsics;
11
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
28
9
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
29 void main()
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
30 {
11
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
31 C c;
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
32 srand(readcyclecounter());
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
33 if (rand() % 2)
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
34 c = new C;
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
35 else
d3ee9efe20e2 [svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents: 9
diff changeset
36 c = new D;
9
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
37 c.f();
dafae18f9c08 [svn r13] * Updated for LLVM 2.1
lindquist
parents:
diff changeset
38 }