Mercurial > projects > dstress
view run/o/odd_bug_07_A.d @ 1630:d0efa3ae5522 default tip
run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Sat, 23 Apr 2011 22:57:32 +0200 |
parents | daef239f37cf |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ icee <iceelyne@gmail.com> // @date@ 2006-08-14 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=287 // @desc@ [Issue 287] DMD optimization bug arround dynamic array length module dstress.run.o.odd_bug_07_A; int status; void validate(int a, int b){ if(a != status){ assert(0); } status += 4; if(b != status){ assert(0); } } int main(){ int x = 0; int y = 0; char[] sa = "abcd"; for(int i = 0; i < 10; i++){ y = x + sa.length; validate(x, y); x = y; y = x + sa.length; validate(x, y); x = y; } if(status != 80){ assert(0); } return 0; }