llvm-project/clang/test
Erik Pilkington 9c3b588db9 Add a new builtin: __builtin_dynamic_object_size
This builtin has the same UI as __builtin_object_size, but has the
potential to be evaluated dynamically. It is meant to be used as a
drop-in replacement for libraries that use __builtin_object_size when
a dynamic checking mode is enabled. For instance,
__builtin_object_size fails to provide any extra checking in the
following function:

  void f(size_t alloc) {
    char* p = malloc(alloc);
    strcpy(p, "foobar"); // expands to __builtin___strcpy_chk(p, "foobar", __builtin_object_size(p, 0))
  }

This is an overflow if alloc < 7, but because LLVM can't fold the
object size intrinsic statically, it folds __builtin_object_size to
-1. With __builtin_dynamic_object_size, alloc is passed through to
__builtin___strcpy_chk.

rdar://32212419

Differential revision: https://reviews.llvm.org/D56760

llvm-svn: 352665
2019-01-30 20:34:53 +00:00
..
ARCMT
AST [ASTDumper][OpenMP] CapturedDecl has a 'nothrow' bit 2019-01-30 15:41:20 +00:00
ASTMerge
Analysis [analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of Objective-C methods 2019-01-30 02:11:04 +00:00
CXX Add a triple to this test so it passes for targets where alignof(double) 2019-01-24 20:52:56 +00:00
CodeCompletion [CodeComplete] [clangd] Fix crash on ValueDecl with a null type 2019-01-24 10:41:43 +00:00
CodeGen Add a new builtin: __builtin_dynamic_object_size 2019-01-30 20:34:53 +00:00
CodeGenCUDA [CUDA] Treat extern global variable shadows same as regular extern vars. 2018-12-22 01:11:09 +00:00
CodeGenCXX [FIX] Adjust CXX microsoft abi dynamic cast test to r352293 2019-01-27 00:22:10 +00:00
CodeGenCoroutines Revert "[CodeGenCXX] Treat 'this' as noalias in constructors" 2018-10-15 15:43:00 +00:00
CodeGenObjC [clang][slh] add Clang attr no_speculative_load_hardening 2019-01-18 17:20:46 +00:00
CodeGenObjCXX [CodeGen] Replace '@' characters in block descriptors' symbol names with 2018-12-29 17:28:30 +00:00
CodeGenOpenCL Revert "OpenCL: Extend argument promotion rules to vector types" 2019-01-29 20:49:47 +00:00
CodeGenOpenCLCXX [OpenCL] Add generic addr space to the return of implicit assignment. 2019-01-30 11:18:08 +00:00
Coverage [Frontend] Delete -print-decl-contexts 2018-10-03 03:50:44 +00:00
CoverageMapping [Coverage] Specify the Itanium ABI triple for a C++ test 2018-11-28 20:51:09 +00:00
Driver Fix the tests from r350970 2019-01-29 20:13:02 +00:00
FixIt Introduce the _Clang scoped attribute token. 2018-11-09 17:19:45 +00:00
Format
Frontend Fix the behavior of clang's -w flag. 2019-01-29 19:33:48 +00:00
Headers Recommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms" 2019-01-16 22:56:25 +00:00
Import [ASTImporter] Fix importing OperatorDelete from CXXConstructorDecl 2019-01-22 17:59:45 +00:00
Index [Sema] Fix Modified Type in address_space AttributedType 2019-01-24 00:11:35 +00:00
Integration
Layout
Lexer Disable _Float16 for non ARM/SPIR Targets 2019-01-25 17:27:57 +00:00
Misc [cc1as] Test that -g of empty .s file does something sensible. 2019-01-29 20:57:50 +00:00
Modules Fix the behavior of clang's -w flag. 2019-01-29 19:33:48 +00:00
OpenMP [OPENMP]Fix PR40513: lastprivate taskloop counter. 2019-01-29 21:12:28 +00:00
PCH Fix thread safety tests after r352549 2019-01-30 00:18:24 +00:00
Parser Add two new pragmas for controlling software pipelining optimizations. 2019-01-04 17:20:00 +00:00
Preprocessor [MSP430] Ajust f32/f64 alignment according to MSP430 EABI 2019-01-25 08:51:53 +00:00
Profile
Refactor
Rewriter
Sema Add a new builtin: __builtin_dynamic_object_size 2019-01-30 20:34:53 +00:00
SemaCUDA [HIP] Fix size_t for MSVC environment 2019-01-30 12:26:54 +00:00
SemaCXX Thread safety analysis: Improve diagnostics for double locking 2019-01-29 22:11:42 +00:00
SemaObjC Add a priority field to availability attributes to prioritize explicit 2019-01-24 19:14:39 +00:00
SemaObjCXX [Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed 2019-01-23 00:55:48 +00:00
SemaOpenCL [OpenGL] Fix test on PPC after r352540 2019-01-30 11:24:04 +00:00
SemaOpenCLCXX [OpenCL] Add generic addr space to the return of implicit assignment. 2019-01-30 11:18:08 +00:00
SemaTemplate Remember to instantiate explicit template argument lists in a friend 2019-01-11 01:59:33 +00:00
TableGen Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Templight
Tooling [test] Pass -ccc-install-dir in mac compilation db test 2019-01-21 17:05:43 +00:00
Unit
VFS [VFS] Implement `RedirectingFileSystem::getRealPath`. 2018-11-16 01:18:04 +00:00
clang-rename
.clang-format
CMakeLists.txt [analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions 2019-01-10 17:44:04 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions 2019-01-10 17:44:04 +00:00
lit.site.cfg.py.in Import lit.llvm after rC341132 2018-08-31 00:24:36 +00:00
make_test_dirs.pl