summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/return.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a buildbot failure introduced by r290960.Alex Lorenz2017-01-041-3/+1
| | | | | | | The commit r290960 checked the the basic block label name which isn't there when clang is compiled in release mode. llvm-svn: 290968
* Add -f[no-]strict-return flag that can be used to avoid undefined behaviourAlex Lorenz2017-01-041-4/+97
| | | | | | | | | | | | | | | | | | | | | | | in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-2/+2
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Prepare for using MS ABI by default for Win32: update CodeGenCXX testsHans Wennborg2013-12-131-2/+2
| | | | llvm-svn: 197281
* Don't pass -O0 to clang_cc1, it is the default.Rafael Espindola2013-09-041-1/+1
| | | | llvm-svn: 189910
* At -O0, emit an @llvm.trap() call at the end of a value-returning function whichRichard Smith2012-10-151-3/+9
| | | | | | fails to return a value, to make debugging this issue easier. llvm-svn: 165914
* If we flow off the end of a value-returning function:Richard Smith2012-10-041-0/+6
- outside C++, return undef (behavior is not undefined unless the value is used) - in C++, with -fcatch-undefined-behavior, perform an appropriate trap - in C++, produce an 'unreachable' (behavior is undefined immediately) llvm-svn: 165273
OpenPOWER on IntegriCloud