terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.71k stars 197 forks source link

cconv_more.t fails on x86 with N=10 #576

Open elliottslaughter opened 2 years ago

elliottslaughter commented 2 years ago

The modified cconv_more.t from #575 fails on x86 with N = 10.

Relevant parts of the test output:

define float @cff10(<2 x float> %x1.coerce, <2 x float> %x2.coerce, <2 x float> %x3.coerce, <2 x float> %x4.coerce, <2 x float> %x5.coerce, <2 x float> %x6.coerce, <2 x float> %x7.coerce, <2 x float> %x8.coerce, %struct.float_2* noundef byval(%struct.float_2) align 8 %x9, %struct.float_2* noundef byval(%struct.float_2) align 8 %x10) #0 {
...

define internal float @"$tff10"(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4, <2 x float> %5, <2 x float> %6, <2 x float> %7, <2 x float> %8, <2 x float> %9) #2 {
...

tests/cconv_more.t:593: scalar test failed for N=10, {float_2,float_2,float_2,float_2,float_2,float_2,float_2,float_2,float_2,float_2} -> float: error code 220

It seems that Clang switches to byval after 8 arguments, and Terra fails to do so.

Tested on macOS 12.4 with LLVM 14.