ffi 1.8a: xfail — #objc_call(>16 B non-HFA) skips the sret transform
103/103 regression tests pass (+ffi-objc-call-06-sret-return).
The runtime output is misleadingly clean — `[nil tripleValue]`
zeros all three fields because libobjc's nil-stub clears the
return registers. But the IR snapshot reveals the actual ABI
mismatch:
%objc.msg = call { i64, i64, i64 } @objc_msgSend(ptr null, ptr %load)
A live receiver returning a non-zero `Triple` would surface
garbage in the third field — the AArch64 backend lowers
{ i64, i64, i64 } returns to x0/x1 pair + a third register that
the runtime's sret-shaped stub doesn't populate.
Next commit (1.8b): emit_llvm's `objc_msg_send` arm gains the
same sret transform we did for plain `#foreign` calls in Phase
0.3 — ret type collapses to void, prepend a ptr sret param,
alloca the result slot at the call site, mirror the
`sret(<T>)` attribute on the call, load result from the slot
post-call. IR snapshot will flip to:
%slot = alloca <Triple>
call void @objc_msgSend(ptr sret(<Triple>) %slot, ptr null, ptr %load)
%objc.msg = load <Triple>, ptr %slot
This commit is contained in:
1
tests/expected/ffi-objc-call-06-sret-return.exit
Normal file
1
tests/expected/ffi-objc-call-06-sret-return.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2572
tests/expected/ffi-objc-call-06-sret-return.ir
Normal file
2572
tests/expected/ffi-objc-call-06-sret-return.ir
Normal file
File diff suppressed because it is too large
Load Diff
1
tests/expected/ffi-objc-call-06-sret-return.txt
Normal file
1
tests/expected/ffi-objc-call-06-sret-return.txt
Normal file
@@ -0,0 +1 @@
|
||||
triple = (0, 0, 0)
|
||||
Reference in New Issue
Block a user