Mercurial > projects > dstress
annotate run/mini/bug24.d @ 1630:d0efa3ae5522 default tip
run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sat, 23 Apr 2011 22:57:32 +0200 |
parents | c6ef09dfba4d |
children |
rev | line source |
---|---|
1628
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
1 module bug24; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
2 extern(C) int printf(char*, ...); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
3 |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
4 struct S |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
5 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
6 long l; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
7 float f; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
8 } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
9 |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
10 void main() |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
11 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
12 S s = S(3L,2f); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
13 delegate { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
14 S t = S(4L, 1f); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
15 delegate { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
16 s.l += t.l; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
17 s.f += t.f; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
18 }(); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
19 }(); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
20 printf("%lu %f\n", s.l, s.f); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
21 assert(s.l == 7 && s.f == 3); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
22 } |