Mercurial > projects > ldc
annotate tests/mini/d.d @ 445:cc40db549aea
Changed the handling of variadic intrinsics a bit.
Removed the -fp80 option and made real be 80bit floats on X86, this is what the D spec really says it should be and fixes a bunch of issues.
Changed the handling of parameter attributes to a bit more generalized approach.
Added sext/zext attributes for byte/short/ubyte/ushort parameters, fixes #60 .
Parameter attribs now properly set for intrinsic calls if necessary.
Made the tango.math.Math patch less intrusive.
Fixed/added some mini tests.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Fri, 01 Aug 2008 17:59:58 +0200 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
1 | 1 module d; |
73 | 2 |
1 | 3 void main() |
4 { | |
5 int delegate() dg; | |
6 | |
7 struct S | |
8 { | |
9 int i; | |
10 long l; | |
11 float f; | |
12 | |
13 int func() | |
14 { | |
15 return 42; | |
16 } | |
17 } | |
18 | |
19 S s; | |
20 auto dg2 = &s.func; | |
73 | 21 int i = dg2(); |
22 assert(i == 42); | |
1 | 23 |
24 i = f(dg2, 1); | |
73 | 25 assert(i == 43); |
1 | 26 } |
27 | |
28 int f(int delegate() dg, int i) | |
29 { | |
30 return dg() + i; | |
31 } | |
32 | |
73 | 33 /* |
1 | 34 struct S |
35 { | |
36 int i; | |
37 float f; | |
38 int square() | |
39 { | |
40 return i*i; | |
41 } | |
42 } | |
43 | |
44 S s; | |
45 | |
46 void main() | |
47 { | |
48 auto dg = &s.square; | |
49 } | |
73 | 50 */ |