Mercurial > projects > ldc
annotate test/cond.d @ 203:e881c9b1c738 trunk
[svn r219] Fixed: the tango/lib/gc/basic garbage collector now compiles and links into an executable (change in tango/lib/llvmdc-posix.mak), closes #5 .
Changed: removed the crappy realloc based dynamic memory runtime and started moving over to DMD style runtime support, part of moving to real GC.
Fixed: dynamic arrays now use GC runtime for allocating memory.
Fixed: new expression now use GC for allocating memory.
Changed: revamped the dynamic array support routines related to dynamic memory.
Fixed: assertions no longer create exsessive allocas.
Changed: misc. minor cleanups.
author | lindquist |
---|---|
date | Tue, 13 May 2008 14:42:09 +0200 |
parents | c53b6e3fe49a |
children | d9d5d59873d8 |
rev | line source |
---|---|
1 | 1 version=AndAnd; |
2 version=OrOr; | |
3 | |
4 version(AndAnd) | |
5 void andand1() | |
6 { | |
7 int a,b; | |
8 a = 4; | |
9 b = 5; | |
10 assert(a == 4); | |
11 assert(b == 5); | |
12 assert(a+b == 9); | |
13 assert(a == 4 && b == 5); | |
14 assert(a != 3 && b == 5); | |
15 assert(a > 2); | |
16 assert(a < 54); | |
17 assert(a < b); | |
18 assert(a > b-2); | |
19 | |
20 int apb = a+b; | |
21 int amb = a*b; | |
22 assert(apb < amb && apb > a); | |
23 } | |
24 | |
25 version(OrOr) | |
26 void oror1() | |
27 { | |
28 int a,b; | |
29 a = 10; | |
30 b = 1000; | |
31 assert(a); | |
32 assert(b); | |
33 assert(a || b); | |
34 assert(a > b || a < b); | |
35 } | |
36 | |
37 void main() | |
38 { | |
39 printf("Conditionals test\n"); | |
40 version(AndAnd) andand1(); | |
41 version(OrOr) oror1(); | |
42 printf(" SUCCESS\n"); | |
43 } |