The check-builtins is failing 3 tests on a v7 armhf target:
- divtc3_test.c
- divdc3_test.c
- divxc3_test.c
- mulsc3_test.c (already marked UNSUPPORTED, but for the same underlying cause)
Clang is always using the soft float calling convention for implicit calls to the complex divide functions, such as in the expression used to detect whether test results are within a reasonable tolerance:
if (cabsl((r - z)/r) > 1.e-6) ...
This gives an incorrect result for the hard float calling convention as the builtin function in compiler-rt (or libgcc) is expecting hard float. I think that this is clang/llvm https://bugs.llvm.org/show_bug.cgi?id=28164 . Given that the compiler-rt builtin is working correctly and the problem is in clang/llvm, I think the tests should be marked as XFAIL.
A possible alternative is to not use the divide operator in (r-z)/r and instead call out to a function that evaluates the division without calling a complex divide builtin. I've prototyped this and the tests all pass, but such an implementation wouldn't have caught the problem in 28164.
As an aside the divsc3_test doesn't use the expression above to check the result of __divsc3, instead it uses if (r != z), which I guess is a bit inconsistent with the other complex divide routines but doesn't seem to be causing any problems right now.