diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-09 21:50:19 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-03-09 21:50:19 +0000 |
commit | 1f820737c86ceb1c35ab448f80d128c95c354814 (patch) | |
tree | 5cf345f4aecf0c557f7f96c825c46bf8eefa5057 /test/CodeGenCXX/catch-undef-behavior2.cpp | |
parent | 002c12199fd7e6d2e0e80500223f1d8a92b920a6 (diff) |
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
This is a recommit of r231150, reverted in r231409. Turns out
that -fsanitize=shift-base check implementation only works if the
shift exponent is valid, otherwise it contains undefined behavior
itself.
Make sure we check that exponent is valid before we proceed to
check the base. Make sure that we actually report invalid values
of base or exponent if -fsanitize=shift-base or
-fsanitize=shift-exponent is specified, respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/catch-undef-behavior2.cpp')
-rw-r--r-- | test/CodeGenCXX/catch-undef-behavior2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/CodeGenCXX/catch-undef-behavior2.cpp b/test/CodeGenCXX/catch-undef-behavior2.cpp index b8b31ca23f..6e9ca0c088 100644 --- a/test/CodeGenCXX/catch-undef-behavior2.cpp +++ b/test/CodeGenCXX/catch-undef-behavior2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift-base,shift-exponent,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s bool GetOptionalBool(bool *value); bool GetBool(bool default_value) { |