diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-23 01:50:45 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-04-23 01:50:45 +0000 |
commit | f6246503546e88e834108170fc5455f7245d5a67 (patch) | |
tree | 0e1d9c0734889f5c476c659fedb5243eb317374a /clang/test/CodeGen/integer-overflow.c | |
parent | 434984ef583edf64c13962fa092197410a950369 (diff) | |
download | bcm5719-llvm-f6246503546e88e834108170fc5455f7245d5a67.tar.gz bcm5719-llvm-f6246503546e88e834108170fc5455f7245d5a67.zip |
Unify the way we report overflow in increment/decrement operator.
Summary:
Make sure signed overflow in "x--" is checked with
llvm.ssub.with.overflow intrinsic and is reported as:
"-2147483648 - 1 cannot be represented in type 'int'"
instead of:
"-2147483648 + -1 cannot be represented in type 'int'"
, like we do for unsigned overflow.
Test Plan: clang + compiler-rt regression test suite
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D8236
llvm-svn: 235568
Diffstat (limited to 'clang/test/CodeGen/integer-overflow.c')
-rw-r--r-- | clang/test/CodeGen/integer-overflow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/CodeGen/integer-overflow.c b/clang/test/CodeGen/integer-overflow.c index eee1da7937a..de3b53f4b5b 100644 --- a/clang/test/CodeGen/integer-overflow.c +++ b/clang/test/CodeGen/integer-overflow.c @@ -52,8 +52,8 @@ void test1() { // DEFAULT: add nsw i32 {{.*}}, -1 // WRAPV: add i32 {{.*}}, -1 - // TRAPV: llvm.sadd.with.overflow.i32({{.*}}, i32 -1) - // CATCH_UB: llvm.sadd.with.overflow.i32({{.*}}, i32 -1) + // TRAPV: llvm.ssub.with.overflow.i32({{.*}}, i32 1) + // CATCH_UB: llvm.ssub.with.overflow.i32({{.*}}, i32 1) // TRAPV_HANDLER: foo( --a; |