llvm-project/clang/test
Vedant Kumar 10c3102071 [ubsan] Diagnose invalid uses of builtins (clang)
On some targets, passing zero to the clz() or ctz() builtins has undefined
behavior. I ran into this issue while debugging UB in __hash_table from libcxx:
the bug I was seeing manifested itself differently under -O0 vs -Os, due to a
UB call to clz() (see: libcxx/r304617).

This patch introduces a check which can detect UB calls to builtins.

llvm.org/PR26979

Differential Revision: https://reviews.llvm.org/D34590

llvm-svn: 309459
2017-07-29 00:19:51 +00:00
..
ARCMT clang/test/ARCMT/remap-applying.c: Use %/s on the command line of echo(1). 2017-04-28 05:02:52 +00:00
ASTMerge Revert r299355 "[ASTImporter] Fix for importing unnamed structs" 2017-04-03 21:06:45 +00:00
Analysis [StaticAnalyzer] Completely unrolling specific loops with known bound option 2017-07-25 19:23:23 +00:00
CXX [modules ts] Basic for module linkage. 2017-07-07 20:04:28 +00:00
CodeCompletion Fixed failing assert in code completion. 2017-07-21 09:24:00 +00:00
CodeGen [ubsan] Diagnose invalid uses of builtins (clang) 2017-07-29 00:19:51 +00:00
CodeGenCUDA CodeGenModule: Always output wchar_size, check LLVM assumptions. 2017-05-20 01:29:55 +00:00
CodeGenCXX Update comment in test case after r309308. 2017-07-28 01:58:14 +00:00
CodeGenCoroutines [coroutines] Allow co_await and co_yield expressions that return an lvalue to compile 2017-06-15 19:43:36 +00:00
CodeGenObjC Adopt to LLVM API change (llvm.dbg.value no longer has an offset) 2017-07-28 20:21:08 +00:00
CodeGenObjCXX test: fix test for release builds 2017-06-27 18:57:50 +00:00
CodeGenOpenCL [OpenCL] Fix access qualifiers metadata for kernel arguments with typedef 2017-07-26 18:49:54 +00:00
Coverage Handle -ast-dump-all when passed as the only option. 2017-06-15 00:00:08 +00:00
CoverageMapping [Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761) 2017-04-24 20:52:04 +00:00
Driver [ubsan] Diagnose invalid uses of builtins (clang) 2017-07-29 00:19:51 +00:00
FixIt unguarded availability: add a fixit for the "annotate '...' 2017-07-26 13:58:02 +00:00
Format [clang-format] Replace IncompleteFormat by a struct with Line 2017-04-21 14:35:20 +00:00
Frontend Remove Bitrig: Clang Changes 2017-07-21 22:46:31 +00:00
Headers [Headers] Add a test for arm64intr.h 2017-07-27 19:45:13 +00:00
Import [ExternalASTMerger] Import Objective-C classes 2017-07-25 19:54:22 +00:00
Index [index] Set SymbolSubKind::Accessor[GS]etter on class methods 2017-07-21 23:04:27 +00:00
Integration Tie the macOS tests in test/Integration to the latest macOS SDK 2017-06-02 11:26:35 +00:00
Layout Print nested name specifiers for typedefs and type aliases 2017-03-10 15:04:58 +00:00
Lexer Reorder tests to match latest SD-6 draft. 2017-07-25 23:31:42 +00:00
Misc [CodeGen][mips] Support `long_call/far/near` attributes 2017-07-20 20:34:18 +00:00
Modules Fix incorrect use of current directory to find moved paths in ASTReader. 2017-07-25 10:22:06 +00:00
OpenMP Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
PCH Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
Parser Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
Preprocessor Remove Bitrig: Clang Changes 2017-07-21 22:46:31 +00:00
Profile [Profile] Do not assign counters to functions without bodies 2017-06-30 21:02:14 +00:00
Rewriter [Objective-C] Fix non-determinism in clang 2017-07-06 18:49:57 +00:00
Sema Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
SemaCUDA [CUDA] Let NVPTX inherit the host's calling conventions. 2017-01-05 16:53:38 +00:00
SemaCXX [Sema] Improve diagnostic message for unavailable C++17 aligned 2017-07-19 17:17:50 +00:00
SemaObjC Recommit r308327 3rd time: Add a warning for missing 2017-07-28 14:41:21 +00:00
SemaObjCXX Fix errored return value in CheckFunctionReturnType and add a fixit hint 2017-05-10 20:03:16 +00:00
SemaOpenCL [OpenCL] Test on image access modifiers and image type can only be a type of a function argument. 2017-07-06 07:06:11 +00:00
SemaTemplate Regression test for PR10856 2017-07-26 14:58:55 +00:00
TableGen
Tooling [clang-diff] Add initial implementation 2017-07-21 12:49:28 +00:00
Unit Change remaining references to lit.util.capture to use subprocess.check_output. 2017-07-06 21:46:47 +00:00
VFS
clang-rename Move ClassReplacements.cpp test from clang-rename tests to the 2017-06-30 16:58:36 +00:00
.clang-format
CMakeLists.txt Clang's tests should depend on clang-diff 2017-07-21 13:12:01 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg [clang] Add abi-breaking-checks support to clang 2017-07-25 23:00:02 +00:00
lit.site.cfg.in [clang] Add abi-breaking-checks support to clang 2017-07-25 23:00:02 +00:00
make_test_dirs.pl