Mercurial > projects > ldc
comparison tests/mini/vararg7.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | tangotests/vararg4.d@0806379a5eca |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module tangotests.vararg4; | |
2 | |
3 extern(C) int printf(char*, ...); | |
4 | |
5 struct S | |
6 { | |
7 int i; | |
8 } | |
9 | |
10 void func(...) | |
11 { | |
12 S* sp = cast(S*)_argptr; | |
13 assert(sp.i == 42); | |
14 } | |
15 | |
16 void main() | |
17 { | |
18 printf("1st:\n"); | |
19 { | |
20 S s = S(42); | |
21 func(s); | |
22 } | |
23 printf("ok\n"); | |
24 | |
25 printf("2nd:\n"); | |
26 { | |
27 func(S(42)); | |
28 } | |
29 printf("ok\n"); | |
30 } |