Mercurial > projects > ldc
annotate test/classes4.d @ 237:a168a2c3ea48 trunk
[svn r253] Removed -inlineasm option. inline asm is now enabled by default unless the new -noasm option is passed.
Tried adding a stack trace print when compiler crashes, not sure it's working though.
Changed data layouts to match that of llvm-gcc.
Fixed casting function pointers.
Added support checks in AsmStatement.
author | lindquist |
---|---|
date | Sun, 08 Jun 2008 19:09:24 +0200 |
parents | c53b6e3fe49a |
children | d9d5d59873d8 |
rev | line source |
---|---|
1 | 1 class A |
2 { | |
3 int i = 42; | |
4 double df = 3.1415; | |
5 this() | |
6 { | |
7 } | |
8 char[] toString() | |
9 { | |
10 return "A:Object"; | |
11 } | |
12 } | |
13 | |
14 class B : A | |
15 { | |
16 ubyte b; | |
17 char[] toString() | |
18 { | |
19 return "B:A"; | |
20 } | |
21 } | |
22 | |
23 void main() | |
24 { | |
25 scope a = new A; | |
26 char[] as = a.toString; | |
27 {printf("a.toString = '%.*s'\n", as.length, as.ptr);} | |
28 | |
29 Object o = a; | |
30 char[] os = o.toString; | |
31 {printf("o.toString = '%.*s'\n", os.length, os.ptr);} | |
32 | |
33 scope b = new B; | |
34 char[] bs = b.toString; | |
35 {printf("b.toString = '%.*s'\n", bs.length, bs.ptr);} | |
36 } |