terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.

Home Page:terralang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vecobj.t exposes Moonjit bugs on PPC64le

elliottslaughter opened this issue · comments

The vecobj.t test appears to expose multiple bugs in the Moonjit support for the C calling convention. I'm reasonably certain that these are Moonjit bugs rather than Terra bugs because we have extremely comprehensive tests against Clang, which Terra passes with flying colors.

  1. Callbacks: the printfloat callback into Lua ({float}->{}) results in a segfault.
  2. Calling a C/Terra function with a struct (containing arrays) results in garbage.

I'm going to patch the test to work around this since there isn't much we can do about Moonjit limitations.

The second of these two issues (disagreement in the calling convention for arrays) applies to AArch64 as well. Since I'm pretty sure we're doing this correctly (thanks to cconv_more.t and cconv_array.t) I'm going to apply the workaround here as well.