summaryrefslogtreecommitdiff
path: root/test/CodeGen/functions.c
Commit message (Collapse)AuthorAgeFilesLines
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-3/+3
| | | | | | tests fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite calls to bitcast unprototyped functions when emitting a definition.John McCall2012-12-121-1/+1
| | | | | | | | | | | | My variadics patch, r169588, changed these calls to typically be bitcasts rather than calls to a supposedly variadic function. This totally subverted a hack where we intentionally dropped excess arguments from such calls in order to appease the inliner and a "warning" from the optimizer. This patch extends the hack to also work with bitcasts, as well as teaching it to rewrite invokes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170034 91177308-0d34-0410-b5e6-96231b3b80d8
* ANSI C requires that a call to an unprototyped function type succeedJohn McCall2011-09-211-2/+2
| | | | | | | | | | | | | | | | | | | if the definition has a non-variadic prototype with compatible parameters. Therefore, the default rule for such calls must be to use a non-variadic convention. Achieve this by casting the callee to the function type with which it is required to be compatible, unless the target specifically opts out and insists that unprototyped calls should use the variadic rules. The only case of that I'm aware of is the x86-64 convention, which passes arguments the same way in both cases but also sets a small amount of extra information; here we seek to maintain compatibility with GCC, which does set this when calling an unprototyped function. Addresses PR10810 and PR10713. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140241 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge this test into another.John McCall2011-06-271-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133957 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly pass the address of a lazily-generated function declaration withJohn McCall2010-04-281-0/+12
| | | | | | | | incomplete type. Fixes PR6911. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102473 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this test portable to ABIs that use sret.John McCall2010-02-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97035 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test case and convert fully to FileCheck.John McCall2010-02-241-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97032 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize parameter and return types before computing ABI info. EliminatesJohn McCall2010-02-241-1/+10
| | | | | | | | | | | | | a common source of oddities and, in theory, removes some redundant ABI computations. Also fixes a miscompile I introduced yesterday by refactoring some code and causing a slightly different code path to be taken that didn't perform *parameter* type canonicalization, just normal type canonicalization; this in turn caused a bit of ABI code to misfire because it was looking for 'double' or 'float' but received 'const float'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97030 91177308-0d34-0410-b5e6-96231b3b80d8
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-4/+4
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
* Prep for new warning.Mike Stump2009-07-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76638 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR4423.Chris Lattner2009-06-231-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73938 91177308-0d34-0410-b5e6-96231b3b80d8
* When defining a function whose type has no prototype, make an effortChris Lattner2009-05-051-1/+1
| | | | | | | | | | to go back and clean up existing uses of the bitcasted function. This is not just an optimization: it is required for correctness to get always inline functions to work, see testcases in function-attributes.c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70971 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | | Tests and drivers updated, still need to shuffle dirs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a fixme: non-proto struct returning function definitions should be compiledChris Lattner2009-03-221-1/+5
| | | | | | | | | | | to something like: define void @bar(%struct.foo* noalias sret %agg.result) nounwind { instead of: define void @bar(%struct.foo* noalias sret %agg.result, ...) nounwind { git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67475 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit K&R unprototyped function definitions as varargs.Daniel Dunbar2009-02-191-1/+13
| | | | | | | - <rdar://problem/6584606> clang/x86-64 - too many reg saves git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65032 91177308-0d34-0410-b5e6-96231b3b80d8
* When merging from a function with a prototype to a function without aDouglas Gregor2009-02-161-0/+2
| | | | | | | prototype, synthesize ParmVarDecls for prototype-less FunctionDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64666 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression I introduced in r54107:Chris Lattner2008-07-311-1/+7
| | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=54107 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54242 91177308-0d34-0410-b5e6-96231b3b80d8
* implement codegen for functions whose function body type don't matchChris Lattner2007-12-021-0/+11
their prototype. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44506 91177308-0d34-0410-b5e6-96231b3b80d8