mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
In the presence of the hidden arg for return-by-value, the registers used for natural arguments were incorrect. (This should be applied on the 'winabi' branch.)
21 lines
325 B
Plaintext
21 lines
325 B
Plaintext
type :obj = { l, l, l, l }
|
|
|
|
export
|
|
function :obj $f(l %self) {
|
|
@_0
|
|
%_1 =l alloc8 16
|
|
storel 77, %_1
|
|
ret %_1
|
|
}
|
|
|
|
# >>> driver
|
|
# #include <stdio.h>
|
|
# typedef struct { long long a, b, c, d; } obj;
|
|
# extern obj f();
|
|
# int main() { obj ret = f(); printf("%lld\n", ret.a); return 0; }
|
|
# <<<
|
|
|
|
# >>> output
|
|
# 77
|
|
# <<<
|