comparison run/mini/vararg7.d @ 1628:c6ef09dfba4d

add mini test set from ldc project
author Moritz Warning <moritzwarning@web.de>
date Mon, 10 Jan 2011 19:47:18 +0100
parents
children
comparison
equal deleted inserted replaced
1627:e1b954780837 1628:c6ef09dfba4d
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 }