summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/ubsan/TestCases/Float/cast-overflow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ubsan][test] Fix cast-overflow.cpp and delete float-divide-by-zero test ↵Fangrui Song2019-07-081-1/+1
| | | | | | after D63793/rC365272 llvm-svn: 365307
* [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)Kamil Rytarowski2018-01-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch (on top of the previous two (https://reviews.llvm.org/D40898 and https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris sanitizer port. It contains the following sets of changes: * For the time being, the port is for 32-bit x86 only, so reject the various tests on x86_64. * When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares _setjmp and _longjmp inside namespace std. * MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a no-op compat define, Solaris does not. * test/asan/TestCases/Posix/coverage.cc was initially failing like this: /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument Further digging revealed that the rm was trying to remove the running test's working directory which failed as observed. cd'ing out of the dir before let the test pass. * Two tests needed a declaration of alloca. I've now copied the existing code from test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and maintainable to have a common testsuite header where such code is collected. * Similarly, Solaris' printf %p format doesn't include the leading 0x. * In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__ (predefined by clang for no apparent reason) to avoid conflicting declarations for memalign. * test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and friends as predefined by clang and gcc? Patch by Rainer Orth. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40900 llvm-svn: 322635
* Enable ubsan on NetBSDKamil Rytarowski2017-08-081-4/+10
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: fjricci Subscribers: srhines, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36483 llvm-svn: 310412
* [ubsan] Make the cast overflow message less redundantVedant Kumar2017-04-271-10/+10
| | | | llvm-svn: 301589
* Fix bad regression from r263077 when building with MSVC.Nico Weber2016-03-121-3/+0
| | | | | | | | | | | | | | That change did: -#if defined(__BIG_ENDIAN__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ If __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ aren't defined, like they are with MSVC, this condition is true (0 == 0). Fixes PR26919. llvm-svn: 263324
* Disable a test that started failing recently; see PR26919.Nico Weber2016-03-121-0/+3
| | | | llvm-svn: 263311
* [ubsan/float-cast-overflow] Make the test also work with C++11 narrowingFilipe Cabecinhas2016-03-041-4/+4
| | | | llvm-svn: 262733
* [UBSan] Test churn: use the approach from r244839 and r245962 in UBSan lit ↵Alexey Samsonov2015-08-251-1/+1
| | | | | | | | | | | tests. Introduce %env_ubsan_opts= substitution instead of specifying UBSAN_OPTIONS manually in the RUN-lines. This will come in handy once we introduce some default UBSAN_OPTIONS for the whole testsuite (for instance, make abort_on_error common option). llvm-svn: 245967
* [UBSan] Add the ability to print more precise error kind in summary line.Alexey Samsonov2015-08-241-2/+2
| | | | | | | | | | Reviewers: rsmith, pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12215 llvm-svn: 245897
* [compiler-rt] Add SourceLocations for float_cast_overflow data.Filipe Cabecinhas2015-08-111-11/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Compiler-rt part of http://reviews.llvm.org/D11757 I ended up making UBSan work with both the old version and the new version of the float_cast_overflow data (instead of just erroring with the previous version). The old version will try to symbolize its caller. Now we compile the float_cast_overflow tests without -g, and make sure we have the source file+line+column. If you think I'm trying too hard to make sure we can still use both versions, let me know. Reviewers: samsonov, rsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11793 llvm-svn: 244567
* UBSan: Enable runtime library tests on Windows, and get most tests passing.Peter Collingbourne2015-07-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically: - Disable int128 tests on Windows, as MSVC cl.exe does not support int128, so we might not have been able to build the runtime with int128 support. - XFAIL the vptr tests as we lack Microsoft ABI support. - XFAIL enum.cpp as UBSan fails to add the correct instrumentation code for some reason. - Modify certain tests that build executables multiple times to use unique names for each executable. This works around a race condition observed on Windows. - Implement IsAccessibleMemoryRange for Windows to fix the last misaligned.cpp test. - Introduce a substitution for testing crashes on Windows using KillTheDoctor. Differential Revision: http://reviews.llvm.org/D10864 llvm-svn: 241303
* Address old FIXMEs in UBSan test cases.Alexey Samsonov2015-04-281-1/+0
| | | | llvm-svn: 235961
* [UBSan] Make sure proper error summary is printed for ↵Alexey Samsonov2015-04-231-2/+3
| | | | | | | | | | -fsanitize=float-cast-overflow. float-cast-overflow handler doesn't have source location provided by the compiler, but we still have *some* source location if we have a symbolizer. llvm-svn: 235567
* [ubsan] Stop cast-overflow.cpp test leaking undefined behaviour into the ↵Daniel Sanders2015-04-221-4/+8
| | | | | | | | | | | | | | | | | | | | | exit code. Summary: ubsan was correctly catching the undefined behaviour but lit's shell was failing the test anyway because the exit code was non-zero as a result of the undefined behaviour. This fixes the test on a mips-linux-gnu target. Reviewers: samsonov Reviewed By: samsonov Subscribers: samsonov, llvm-commits, rsmith, sagar Differential Revision: http://reviews.llvm.org/D9155 llvm-svn: 235518
* Remove XFAILs from cast-overflow.cppBill Seurer2015-04-011-2/+0
| | | | | | My fix for power also fixed armv7l-unknown-linux-gnueabihf and aarch64 llvm-svn: 233827
* [PPC64]This activates UBSan for the power architecture.Bill Seurer2015-04-011-8/+16
| | | | | | | | One test case is updated to allow for differences between power and other architectures in behavior when returning from main in certain instances http://reviews.llvm.org/D8743 llvm-svn: 233813
* XFAIL AArch64 UBsan test, just like ARMRenato Golin2015-01-071-0/+1
| | | | llvm-svn: 225370
* [Ubsan] Fix the cast-overflow.cpp test to build on FreeBSDViktor Kutuzov2014-11-101-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D6087 llvm-svn: 221596
* [UBSan] Disable one run line of this test to allow the test as a wholeChandler Carruth2014-10-111-1/+1
| | | | | | | | | | | to pass in an opt build. The test case in question does show UBSan catching the error, but it doesn't then successfully set the exit code of the program. I'll let the UBSan folks sort out why. It should reproduce trivially with an optimized build. llvm-svn: 219563
* [UBSan] Fix UBSan testcase for float->int conversion after LLVM r219542.Alexey Samsonov2014-10-111-2/+5
| | | | llvm-svn: 219559
* Mark sanitizer tests XFAIL on ARMv7Renato Golin2014-10-081-0/+1
| | | | | | | | | ASAN, UBSAN and profile tests that don't work with arm-linux-gnueabi and android also don't work on armv7l-linux-gnueabihf. Some of the tests have known causes, others not yet. In order to get a green bot, I'm disabling those tests for now and will investigate when the priority rises. llvm-svn: 219343
* [UBSan] Use <machine/endian.h> on Darwin.Alexander Potapenko2014-09-301-3/+13
| | | | llvm-svn: 218662
* [UBSan] Adding support of MIPS32Petar Jovanovic2014-09-261-0/+9
| | | | | | | | | | | | | | Changed files: config-ix.cmake: Enabled UBSan for MIPS32 sanitizer_stacktrace.cc: Program counter for MIPS32 is four byte aligned and a delay slot so subtracted PC by 8 for getting call site address. cast-overflow.cpp: Added big endian support for this test case. Patch by Sagar Thakur. Differential Revision: http://reviews.llvm.org/D4881 llvm-svn: 218519
* [UBSan] Try to enable pipefail in UBSan lit tests to make them behave more ↵Alexey Samsonov2014-07-291-16/+3
| | | | | | predictably llvm-svn: 214149
* [ubsan] temporary disable testing with -m32 as there are bots that don't ↵Kostya Serebryany2014-05-231-11/+11
| | | | | | support it llvm-svn: 209517
* [ubsan] handle long double in 32-bit mode; part of the patch by Marek PolacekKostya Serebryany2014-05-231-0/+20
| | | | llvm-svn: 209516
* Add %run to all lit testsGreg Fitzgerald2014-04-301-10/+10
| | | | llvm-svn: 207709
* Move UBSan test suite under test/Alexey Samsonov2014-02-141-0/+99
llvm-svn: 201401
OpenPOWER on IntegriCloud