Mercurial > projects > ldc
annotate test/calls1.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 | 068cb3c60afb |
rev | line source |
---|---|
131 | 1 module calls1; |
270
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
131
diff
changeset
|
2 import tango.core.Vararg; |
131 | 3 void main() |
4 { | |
5 {int a = byVal1(3);} | |
6 {int a = void; byRef1(a);} | |
7 {char[] c = void; refType(c);} | |
8 {char[] c = void; refTypeByRef(c);} | |
9 {S s = void; structByVal(s);} | |
10 {S s = void; structByRef(s);} | |
11 {S s = void; structByPtr(&s);} | |
12 {printf("c-varargs %d %d %d\n", 1,2,3);} | |
13 {int i=3; float f=24.7; dvararg(i,f);} | |
14 {char[] s = "hello"; dvarargRefTy(s);} | |
15 {char[] ss = "hello world!"; dvarargRefTy(ss);} | |
16 } | |
17 | |
18 int byVal1(int a) | |
19 { | |
20 return a; | |
21 } | |
22 | |
23 void byRef1(ref int a) | |
24 { | |
25 a = 3; | |
26 } | |
27 | |
28 void refType(char[] s) | |
29 { | |
30 } | |
31 | |
32 void refTypeByRef(ref char[] s) | |
33 { | |
34 } | |
35 | |
36 struct S | |
37 { | |
38 float f; | |
39 double d; | |
40 long l; | |
41 byte b; | |
42 } | |
43 | |
44 void structByVal(S s) | |
45 { | |
46 } | |
47 | |
48 void structByRef(ref S s) | |
49 { | |
50 } | |
51 | |
52 void structByPtr(S* s) | |
53 { | |
54 } | |
55 | |
56 void dvararg(...) | |
57 { | |
58 printf("%d %.1f\n", va_arg!(int)(_argptr), va_arg!(float)(_argptr)); | |
59 } | |
60 | |
61 void dvarargRefTy(...) | |
62 { | |
63 char[] s = va_arg!(char[])(_argptr); | |
64 printf("%.*s\n", s.length, s.ptr); | |
65 } |