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

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 12:13:46 PST 2018


dschuff added a comment.

> - 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.

Interesting, I'll look closer at that. We haven't gotten any complaints about it so far.

> - This patch simply removes all prototype less functions which is not fine.

Sorry, in case I wasn't clear, I agree that these tests are valid C and we should not change them.

> - 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.

Yeah, you can sort of cheat because in C, vararg functions must have at least one non-vararg parameter (at least AFAIK no C standard implemented by Clang allows that). So you can tell a real vararg function `declare i32 @foo(i32, ...)` from a non-prototype function `declare i32 @foo(...)`. I suspect that only works for C though.


Repository:
  rT test-suite

https://reviews.llvm.org/D42576





More information about the llvm-commits mailing list