summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/kr-func-promote.c
Commit message (Collapse)AuthorAgeFilesLines
* Reland "[CodeGen] Fix crash when a function taking transparent union is ↵Volodymyr Sapsai2018-01-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | redeclared." When a function taking transparent union is declared as taking one of union members earlier in the translation unit, clang would hit an "Invalid cast" assertion during EmitFunctionProlog. This case corresponds to function f1 in test/CodeGen/transparent-union-redecl.c. We decided to cast i32 to union because after merging function declarations function parameter type becomes int, CGFunctionInfo::ArgInfo type matches with ABIArgInfo type, so we decide it is a trivial case. But these types should also be castable to parameter declaration type which is not the case here. Now the fix is in converting from ABIArgInfo type to VarDecl type and using argument demotion when necessary. Additional tests in Sema/transparent-union.c capture current behavior and make sure there are no regressions. rdar://problem/34949329 Reviewers: rjmccall, rafael Reviewed By: rjmccall Subscribers: aemerson, cfe-commits, kristof.beyls, ahatanak Differential Revision: https://reviews.llvm.org/D41311 llvm-svn: 323156
* Revert "[CodeGen] Fix crash when a function taking transparent union is ↵Volodymyr Sapsai2017-12-211-1/+1
| | | | | | | | | | | | redeclared." This reverts commit r321296. It caused performance regressions FAIL: imp.execution_time FAIL: 2007-01-04-KNR-Args.execution_time FAIL: sse_expandfft.execution_time FAIL: sse_stepfft.execution_time llvm-svn: 321306
* [CodeGen] Fix crash when a function taking transparent union is redeclared.Volodymyr Sapsai2017-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a function taking transparent union is declared as taking one of union members earlier in the translation unit, clang would hit an "Invalid cast" assertion during EmitFunctionProlog. This case corresponds to function f1 in test/CodeGen/transparent-union-redecl.c. We decided to cast i32 to union because after merging function declarations function parameter type becomes int, CGFunctionInfo::ArgInfo type matches with ABIArgInfo type, so we decide it is a trivial case. But these types should also be castable to parameter declaration type which is not the case here. The fix is in checking for the trivial case if ABIArgInfo type matches with parameter declaration type. It exposed inconsistency that we check hasScalarEvaluationKind for different types in EmitParmDecl and EmitFunctionProlog, and comment says they should match. Additional tests in Sema/transparent-union.c capture current behavior and make sure there are no regressions. rdar://problem/34949329 Reviewers: rjmccall, rafael Reviewed By: rjmccall Subscribers: aemerson, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D41311 llvm-svn: 321296
* test: Convert some tests to FileCheckJustin Bogner2015-01-241-1/+2
| | | | | | These were all doing trivial greps. It's better to use FileCheck. llvm-svn: 227007
* 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). llvm-svn: 91446
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Force triple for codegen tests which have expectations on outputDaniel Dunbar2009-02-031-1/+1
| | | | | | types. llvm-svn: 63669
* Do typechecking and codegen for K&R-style function declarations Eli Friedman2008-08-251-0/+5
correctly. Not a regression, but made more obvious by my recent fix which made function type compatibility checking a bit more strict. llvm-svn: 55339
OpenPOWER on IntegriCloud