Mercurial > projects > ldc
annotate tests/mini/a.d @ 1599:0a4be54234d6
Revert fix by Robert for downs as it causes a segfault when compiling tango.
author | Kelly Wilson <wilsonk cpsc.ucalgary.ca> |
---|---|
date | Wed, 23 Dec 2009 22:49:20 -0700 |
parents | 1bb99290e03a |
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 } |