Mercurial > projects > ldc
diff tangotests/asm4.d @ 229:cac3d27ae481 trunk
[svn r245] initial support for labels in inline asm, broken :/
author | lindquist |
---|---|
date | Sat, 07 Jun 2008 21:31:38 +0200 |
parents | |
children | 79d8f6b3fbaf |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangotests/asm4.d Sat Jun 07 21:31:38 2008 +0200 @@ -0,0 +1,30 @@ +module tangotests.asm4; + +extern(C) int printf(char*,...); + +void main() +{ + char* fmt = "yay!\n"; + asm + { + jmp L2; + L1:; + jmp L3; + L2:; + jmp L1; + L3:; + push fmt; + call printf; + pop EAX; + } + if (x) + { + printf("foobar\n"); + } + else + { + printf("baz\n"); + } +} + +extern(C) extern int x;