Mercurial > projects > ldc
annotate test/a.d @ 291:068cb3c60afb trunk
[svn r312] Changed assert codegen to insert an unreachable terminator after the call to the assert function, which currently calls abort().
Changed array comparison runtime support to pass the array typeinfo instead of the element typeinfo. This allows a cleaner and faster implementation.
author | lindquist |
---|---|
date | Sat, 21 Jun 2008 21:16:26 +0200 |
parents | d9d5d59873d8 |
children |
rev | line source |
---|---|
1 | 1 module a; |
2 | |
270
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
3 extern(C) int printf(char*, ...); |
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
1
diff
changeset
|
4 |
1 | 5 int i = 42; |
6 | |
7 void main() | |
8 { | |
9 int j; | |
10 j = i; | |
11 int* p; | |
12 p = &j; | |
13 int k = *p; | |
14 assert(k == 42); | |
15 | |
16 byte b = -1; | |
17 int i = b; | |
18 assert(i == -1); | |
19 | |
20 int* p2 = p; | |
21 | |
22 printf("Done\n"); | |
23 } |