annotate tests/mini/asm5.d @ 1351:8d501abecd24

Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 14 May 2009 17:20:17 +0200
parents 855889b7b268
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
1 int foo()
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
2 {
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
3 version(X86)
949
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
4 {
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
5 asm { mov EAX, 42; }
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
6 } else version(X86_64)
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
7 {
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
8 asm { movq RAX, 42; }
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
9 }
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
10 else static assert(0, "todo");
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
11 }
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
12
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
13 ulong bar()
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
14 {
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
15 version(X86)
949
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
16 {
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
17 asm { mov EAX, 0xFF; mov EDX, 0xAA; }
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
18 } else version(X86_64)
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
19 {
981
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 949
diff changeset
20 asm { movq RAX, 0xAA000000FF; }
949
b2d27ddf8f45 changes to get the naked asm stuff working for x64
wilsonk@ubuntu
parents: 945
diff changeset
21 }
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
22 else static assert(0, "todo");
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
23 }
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
24
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
25 void main()
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
26 {
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
27 long l = 1;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
28 l = 2;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
29 l = 4;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
30 l = 8;
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
31 assert(foo() == 42);
981
855889b7b268 Update some testcases now that 64-bit immediates are working.
Frits van Bommel <fvbommel wxs.nl>
parents: 949
diff changeset
32 assert(bar() == 0xAA000000FF);
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
33 }