summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/catch-undef-behavior.c
Commit message (Collapse)AuthorAgeFilesLines
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-17/+19
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* [ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier2013-01-291-0/+149
| | | | | | | | | | | implementation; this is much more inline with the original implementation (i.e., pre-ubsan) and does not require run-time library support. The trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed. llvm-svn: 173848
* [ubsan] Make static check data non-const so it can be used for deduplication.Will Dietz2013-01-091-2/+2
| | | | llvm-svn: 171947
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-1/+1
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* [ubsan] Recover by default, use -fno-sanitize-recover to disable.Will Dietz2012-12-301-18/+18
| | | | llvm-svn: 171264
* [ubsan] Emit branch weight metadata to hint towards common case.Will Dietz2012-12-151-2/+4
| | | | | | | Results in better block placement that helps close the performance gap when making ubsan checks recoverable. llvm-svn: 170263
* ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads ofRichard Smith2012-12-131-1/+9
| | | | | | | bit-patterns which are not valid values for enumerated or boolean types. These checks are the ubsan analogue of !range metadata. llvm-svn: 170108
* [ubsan] Add flag to enable recovery from checks when possible.Will Dietz2012-12-021-17/+17
| | | | llvm-svn: 169114
* Add -fsanitize=integer for reporting suspicious integer behaviors.Will Dietz2012-11-271-1/+1
| | | | | | Introduces new sanitizer "unsigned-integer-overflow". llvm-svn: 168701
* Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as ↵Richard Smith2012-11-061-1/+26
| | | | | | -fsanitize=divide-by-zero. llvm-svn: 167433
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-1/+12
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* -fcatch-undefined-behavior: Start checking loads and stores for null pointers.Richard Smith2012-11-011-3/+13
| | | | | | | | We want the diagnostic, and if the load is optimized away, we still want to trap it. Stop checking non-default address spaces; that doesn't work in general. llvm-svn: 167219
* -fcatch-undefined-behavior: Trap undefined behavior due to conversions to orRichard Smith2012-10-121-0/+59
| | | | | | | from a floating-point type where the source value is not in the range of representable values of the destination type. llvm-svn: 165843
* -fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith2012-10-101-0/+11
| | | | | | non-positive value. llvm-svn: 165583
* Fix test broken by r165572.Richard Smith2012-10-101-4/+2
| | | | llvm-svn: 165581
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-091-10/+90
| | | | | | of the checks fails. llvm-svn: 165536
* If we flow off the end of a value-returning function:Richard Smith2012-10-041-0/+8
| | | | | | | | - 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
* -fcatch-undefined-behavior: add the -ftrapv checks to the set of things caughtRichard Smith2012-08-251-0/+25
| | | | | | | | | | | | | | | | by this mode, and also check for signed left shift overflow. The rules for the latter are a little subtle: * neither C89 nor C++98 specify the behavior of a signed left shift at all * in C99 and C11, shifting a 1 bit into the sign bit has undefined behavior * in C++11, with core issue 1457, shifting a 1 bit *out* of the sign bit has undefined behavior As of this change, we use the C99 rules for all C language variants, and the C++11 rules for all C++ language variants. Once we have individual -fcatch-undefined-behavior= flags, this should be revisited. llvm-svn: 162634
* New -fcatch-undefined-behavior features:Richard Smith2012-08-241-3/+7
| | | | | | | | * when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
* hopefully unbreak some buildbotsNuno Lopes2012-05-081-2/+2
| | | | llvm-svn: 156357
* make this test a little more useful. I'll add more tests for bound checking ↵Nuno Lopes2012-05-071-1/+11
| | | | | | once -fbounds-checking patch gets in llvm-svn: 156321
* Fix run line so this test actually tests something.Benjamin Kramer2010-04-111-1/+1
| | | | llvm-svn: 100962
* fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.Chris Lattner2010-04-101-0/+7
llvm-svn: 100938
OpenPOWER on IntegriCloud