[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 11:31:29 PST 2018


MatzeB added a comment.

In https://reviews.llvm.org/D42576#1003685, @dschuff wrote:

> I'll just add that what we do in WebAssembly right now for unprototyped functions is to codegen them using the fixed-arg calling convention; at link-time if there are any mismatches between the definition and any calls, then the program has UB, and the resulting WebAssembly module will be invalid. I think this currently has the problem that if the definition does turn out to be vararg, then we have generated an invalid module even though the program is correct (I consider that a bug or shortcoming in our toolchain though). In any case, we do aim to support correct programs with prototypeless functions. If the test suite has non-vararg cases where there are mismatches between the callsites and/or the definition (I have seen that in some other test/benchmark suites), then even though that works on most X86 and ARM ABIs that I know of it's still UB and I'd be in favor of removing it from LLVM's test suite.




- My reading of the C standard is that using a prototype less declaration and defining that as a vararg functions is invalid in C. If you find bugs in this area we should fix them.
- This patch simply removes all prototype less functions which is not fine.
- The llvm IR coming out of clang appears to mark all prototype less functions as varargs which from what I suspect makes it impossible to implement varargs different from prototype-less functions. But that is a problem in clang/IR, it doesn't change the fact that the tests are valid C.


Repository:
  rT test-suite

https://reviews.llvm.org/D42576





More information about the llvm-commits mailing list