Mercurial > projects > ldc
annotate tests/mini/asm4.d @ 1442:0a5f7890f327
Adjust some more code that was depending on the function and delegate calling
conventions being equal.
There's also an instance in `tango.text.convert.Layout` that should be adjusted:
{{{
Index: tango/text/convert/Layout.d
===================================================================
--- tango/text/convert/Layout.d (revision 4578)
+++ tango/text/convert/Layout.d (working copy)
-660,8 +660,12 @@
case TypeCode.STRUCT:
auto s = cast(TypeInfo_Struct) type;
- if (s.xtoString)
- return Utf.fromString8 (s.xtoString(p), result);
+ if (s.xtoString) {
+ char[] delegate() toString;
+ toString.ptr = p;
+ toString.funcptr = cast(char[] function()) s.xtoString;
+ return Utf.fromString8 (toString(), result);
+ }
goto default;
case TypeCode.INTERFACE:
}}}
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 31 May 2009 15:27:01 +0200 |
parents | 4c524d80e6e1 |
children |
rev | line source |
---|---|
229
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
1 module tangotests.asm4; |
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
2 |
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
3 extern(C) int printf(char*,...); |
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
4 |
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
5 void main() |
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
6 { |
741
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
7 char* stmt = "yay!\n"; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
8 char* fmt = "%s"; |
1035
4c524d80e6e1
Move more tests to D_InlineAsm
Christian Kamm <kamm incasoftware de>
parents:
746
diff
changeset
|
9 version (D_InlineAsm_X86) |
229
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
10 { |
741
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
11 asm |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
12 { |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
13 jmp L2; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
14 L1:; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
15 jmp L3; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
16 L2:; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
17 jmp L1; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
18 L3:; |
746 | 19 push stmt; |
741
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
20 call printf; |
744
ef5f75ae6895
Fix minitest breakage from the x86-64 patch.
Christian Kamm <kamm incasoftware de>
parents:
741
diff
changeset
|
21 pop EAX; |
741
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
22 } |
229
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
23 } |
1035
4c524d80e6e1
Move more tests to D_InlineAsm
Christian Kamm <kamm incasoftware de>
parents:
746
diff
changeset
|
24 else version(D_InlineAsm_X86_64) |
741
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
25 { |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
26 asm |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
27 { |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
28 jmp L2; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
29 L1:; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
30 jmp L3; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
31 L2:; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
32 jmp L1; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
33 L3:; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
34 movq RDI, fmt; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
35 movq RSI, stmt; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
36 xor AL, AL; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
37 call printf; |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
38 } |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
39 } |
4ac97ec7c18e
Applied easy part from wilsonk's x86-64 patch in #107
Christian Kamm <kamm incasoftware de>
parents:
341
diff
changeset
|
40 printf(fmt,stmt); |
229
cac3d27ae481
[svn r245] initial support for labels in inline asm, broken :/
lindquist
parents:
diff
changeset
|
41 } |