annotate tests/mini/asm5.d @ 1650:40bd4a0d4870

Update to work with LLVM 2.7. Removed use of dyn_cast, llvm no compiles without exceptions and rtti by default. We do need exceptions for the libconfig stuff, but rtti isn't necessary (anymore). Debug info needs to be rewritten, as in LLVM 2.7 the format has completely changed. To have something to look at while rewriting, the old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means that you have to define this to compile at the moment. Updated tango 0.99.9 patch to include updated EH runtime code, which is needed for LLVM 2.7 as well.
author Tomas Lindquist Olsen
date Wed, 19 May 2010 12:42:32 +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 }