Left shifts of negative values are defined if -fwrapv is set
authorJames Molloy <james.molloy@arm.com>
Tue, 16 Aug 2016 09:45:36 +0000 (09:45 +0000)
committerJames Molloy <james.molloy@arm.com>
Tue, 16 Aug 2016 09:45:36 +0000 (09:45 +0000)
commit59802321785b4b9fc31b10456c62ba3a06d3a631
tree9972dd07f70520851b4bed007d4ee1a8f074ab42
parent5a123c4e37d9969a7c1a0d2b470db9330267817b
Left shifts of negative values are defined if -fwrapv is set

This means we shouldn't emit ubsan detection code or warn.
Fixes PR25552.

llvm-svn: 278786
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGen/wrapv-lshr-sanitize.c [new file with mode: 0644]
clang/test/Sema/negative-shift-wrapv.c [new file with mode: 0644]