diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-04 17:23:53 -0700 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2021-09-07 08:31:48 +0200 |
commit | 649a546d702b41474fe76e9c779086cc8d35f3d2 (patch) | |
tree | 71ff9c3fdcf2931865aca4a8c3d8c9b1b723b5f5 /test | |
parent | 028534d9897079bf64559dca0402bc59a956ce46 (diff) | |
download | roux-649a546d702b41474fe76e9c779086cc8d35f3d2.tar.gz |
test: assign result of print functions to temporary
Though I am not aware of any architecture where this matters, it is technically incorrect to call these stdio functions as if they had no result. The QBE documentation says > Unless the called function does not return a value, a return > temporary must be specified, even if it is never used afterwards. so we should follow it in the tests as well.
Diffstat (limited to 'test')
-rw-r--r-- | test/vararg2.ssa | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/test/vararg2.ssa b/test/vararg2.ssa index 5ad057a..52a6906 100644 --- a/test/vararg2.ssa +++ b/test/vararg2.ssa @@ -19,14 +19,14 @@ export function $qbeprint0(l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -34,7 +34,7 @@ export function $qbecall0(l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -59,14 +59,14 @@ export function $qbeprint1(w %argw0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -74,7 +74,7 @@ export function $qbecall1(w %argw0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -99,14 +99,14 @@ export function $qbeprint2(d %argd0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -114,7 +114,7 @@ export function $qbecall2(d %argd0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -139,14 +139,14 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -154,7 +154,7 @@ export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -179,14 +179,14 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -194,7 +194,7 @@ export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -219,14 +219,14 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -234,7 +234,7 @@ export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -259,14 +259,14 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -274,7 +274,7 @@ export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } |