[PATCH] D42576: [test-suite] Add prototypes to functions in Olden and MiBench

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 08:43:44 PST 2018


MatzeB requested changes to this revision.
MatzeB added a comment.
This revision now requires changes to proceed.

In https://reviews.llvm.org/D42576#1003045, @arichardson wrote:

> Your example will work for x86 and probably ARM, but as far as I can tell it is up to the ABI which calling convention should be used for functions without prototypes.
>  For us these calling conventions are incompatible since the variadic one will pass arguments on the stack instead of in registers so if the target function is not actually variadic this will cause it to read garbage from undefined registers. While it *should* work if there is only zero or one arguments it is not guaranteed to work with more than 1.
>
> I also found that apparently WebAssembly does the same: https://github.com/WebAssembly/tool-conventions/issues/16 and it also causes issues with functions without prototypes (https://bugs.llvm.org/show_bug.cgi?id=35385)


I am repeating myself:

- This is perfectly legal C, so I consider it a legitimate test.
- If your compiler cannot handle it (even if it is llvms fault) then you need to fix the compiler not the test.
- I am fine to add a cmake option to skip this test for cases where it doesn’t work.


Repository:
  rT test-suite

https://reviews.llvm.org/D42576





More information about the llvm-commits mailing list