Mercurial > projects > dstress
annotate run/mini/asm5.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 |
rev | line source |
---|---|
1628
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
1 int foo() |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
2 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
3 version(X86) |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
4 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
5 asm { mov EAX, 42; } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
6 } else version(X86_64) |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
7 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
8 asm { movq RAX, 42; } |
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 else static assert(0, "todo"); |
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 |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
13 ulong bar() |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
14 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
15 version(X86) |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
16 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
17 asm { mov EAX, 0xFF; mov EDX, 0xAA; } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
18 } else version(X86_64) |
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 asm { movq RAX, 0xAA000000FF; } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
21 } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
22 else static assert(0, "todo"); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
23 } |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
24 |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
25 void main() |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
26 { |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
27 long l = 1; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
28 l = 2; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
29 l = 4; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
30 l = 8; |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
31 assert(foo() == 42); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
32 assert(bar() == 0xAA000000FF); |
c6ef09dfba4d
add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents:
diff
changeset
|
33 } |