llvm-project/clang/test
Jamie Schmeiser dfc1e31d49 Produce warning for performing pointer arithmetic on a null pointer.
Summary:
Test and produce warning for subtracting a pointer from null or subtracting
null from a pointer.  Reuse existing warning that this is undefined
behaviour.  Also add unit test for both warnings.

Reformat to satisfy clang-format.

Respond to review comments:  add additional test.

Respond to review comments:  Do not issue warning for nullptr - nullptr
in C++.

Fix indenting to satisfy clang-format.

Respond to review comments:  Add C++ tests.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: efriedma (Eli Friedman), nickdesaulniers (Nick Desaulniers)
Differential Revision: https://reviews.llvm.org/D98798
2021-05-11 11:29:50 -04:00
..
APINotes
ARCMT
AST Fix null ptr crash dumping TemplateTemplateParmDecl 2021-04-24 12:28:10 -04:00
ASTMerge Modify TypePrinter to differentiate between anonymous struct and unnamed struct 2021-02-22 14:16:43 -08:00
Analysis [analyzer] Fix a crash for dereferencing an empty llvm::Optional variable in SMTConstraintManager.h. 2021-05-04 16:50:21 +02:00
CXX CWG2076: Permit implicit conversions within a single level of braces 2021-04-22 16:49:39 -07:00
ClangScanDeps [clang][deps] Only generate absolute paths when asked to 2021-04-26 10:53:41 +02:00
CodeCompletion [clang][PreProcessor] Cutoff parsing after hitting completion point 2021-05-10 11:24:27 +02:00
CodeGen [WebAssembly] Support for WebAssembly globals in LLVM IR 2021-05-11 11:19:29 +02:00
CodeGenCUDA [HIP] Fix device lib selection 2021-05-01 20:31:11 -04:00
CodeGenCXX [SEH] Fix regression with SEH in noexpect functions 2021-05-07 13:27:59 -07:00
CodeGenCoroutines [NFC][Coroutines] Fix two tests by removing hardcoded SSA value. 2021-05-09 19:06:16 -07:00
CodeGenHIP
CodeGenObjC [ObjC] Add a command line flag that disables recognition of objc_direct for testability 2021-04-06 11:17:01 -04:00
CodeGenObjCXX [ObjC][ARC] Don't enter the cleanup scope if the initializer expression 2021-04-29 16:04:30 -07:00
CodeGenOpenCL [CGAtomic] Lift strong requirement for remaining compare_exchange combinations 2021-05-06 21:05:20 -07:00
CodeGenOpenCLCXX [OpenCL] Added distinct file extension for C++ for OpenCL. 2021-03-24 13:07:04 +00:00
CodeGenSYCL [SYCL] Implement SYCL address space attributes handling 2021-04-26 13:44:10 +03:00
Coverage
CoverageMapping [clang] remove an incremental build workaround 2021-05-05 12:21:56 -04:00
Driver Revert "[AMDGPU][OpenMP] Emit textual IR for -emit-llvm -S" 2021-05-11 10:07:13 -05:00
FixIt Revert "[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable" 2021-04-28 12:47:18 -07:00
Format
Frontend [clang][test] Update -fc++-abi tests 2021-05-04 15:53:00 -07:00
Headers [WebAssembly] Use functions instead of macros for const SIMD intrinsics 2021-05-07 11:50:19 -07:00
Import
Index [index] Improve macro indexing support 2021-04-06 09:12:14 -07:00
Integration XFAIL thinlto testcases on AIX 2021-04-26 17:02:06 +00:00
InterfaceStubs
Layout [SystemZ][z/OS] fix lit test related to alignment 2021-03-23 13:15:19 -04:00
Lexer [C++2b] Support size_t literals 2021-03-31 13:36:23 +00:00
Misc [OpenCL] Allow use of double type without extension pragma. 2021-05-11 12:54:38 +01:00
Modules [ASTReader] Only mark module out of date if not already compiled 2021-04-16 17:57:03 -07:00
OpenMP [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode. 2021-05-10 06:34:11 -07:00
PCH Thread safety analysis: Fix false negative on break 2021-05-03 14:03:17 +02:00
Parser Fix potential infinite loop with malformed attribute syntax 2021-04-15 10:47:32 -04:00
Preprocessor Introduce -Wreserved-identifier 2021-05-04 11:19:01 +02:00
Profile [PGO, test] Fix typo in FileCheck var 2021-04-03 08:44:46 +01:00
Refactor
Rewriter
Sema Produce warning for performing pointer arithmetic on a null pointer. 2021-05-11 11:29:50 -04:00
SemaCUDA [CUDA][HIP] Allow non-ODR use of host var in device 2021-04-19 14:45:24 -04:00
SemaCXX [Matrix] Implement C-style explicit type conversions in CXX for matrix types 2021-05-04 15:27:57 +01:00
SemaObjC Revert "[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable" 2021-04-28 12:47:18 -07:00
SemaObjCXX [Sema] Don't set BlockDecl's DoesNotEscape bit if the parameter type of 2021-04-29 16:19:48 -07:00
SemaOpenCL [OpenCL] Allow use of double type without extension pragma. 2021-05-11 12:54:38 +01:00
SemaOpenCLCXX [OpenCL] Add clang extension for non-portable kernel parameters. 2021-05-05 14:58:23 +01:00
SemaSYCL [SYCL] Implement SYCL address space attributes handling 2021-04-26 13:44:10 +03:00
SemaTemplate When performing template argument deduction to select a partial 2021-05-05 14:47:18 -07:00
TableGen Fix test expectations for %diff documentation. 2021-03-30 17:48:08 -07:00
Templight
Tooling
Unit
VFS [clang] Don't crash when loading invalid VFS for the module dep collector 2021-04-26 17:05:22 -07:00
clang-rename
utils/update_cc_test_checks [OpenMP] Overhaul `declare target` handling 2021-05-06 02:10:41 -05:00
.clang-format
CMakeLists.txt [llvm-rc] Add a GNU windres-like frontend to llvm-rc 2021-04-26 22:04:29 +03:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [llvm-rc] Run clang to preprocess input files 2021-04-21 11:50:10 +03:00
lit.site.cfg.py.in [clang][lit] Allow test cases to use the compiler that are used to compile Clang 2021-03-24 11:32:57 +01:00
make_test_dirs.pl Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk 2021-02-25 11:32:27 +01:00