From f6246503546e88e834108170fc5455f7245d5a67 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Thu, 23 Apr 2015 01:50:45 +0000 Subject: 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 --- clang/test/CodeGen/integer-overflow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/test/CodeGen/integer-overflow.c') diff --git a/clang/test/CodeGen/integer-overflow.c b/clang/test/CodeGen/integer-overflow.c index eee1da7..de3b53f 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; -- cgit v1.1