diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-06-26 22:18:28 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-06-26 22:18:28 +0000 |
| commit | 431bef44098ad37188c0f692b28e683d37a79e0f (patch) | |
| tree | d3423f1c0ff16758aadcdc46734bc35458aae19f /clang/test/CodeGen | |
| parent | 05dc78c0965caae4c19ad318a1690c70a51156d7 (diff) | |
| download | bcm5719-llvm-431bef44098ad37188c0f692b28e683d37a79e0f.tar.gz bcm5719-llvm-431bef44098ad37188c0f692b28e683d37a79e0f.zip | |
fix inc/dec to honor -fwrapv and -ftrapv, implementing PR7426.
llvm-svn: 106962
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/integer-overflow.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/clang/test/CodeGen/integer-overflow.c b/clang/test/CodeGen/integer-overflow.c index dea3d0a1a3e..9bed741b323 100644 --- a/clang/test/CodeGen/integer-overflow.c +++ b/clang/test/CodeGen/integer-overflow.c @@ -21,13 +21,25 @@ void test1() { // TRAPV: llvm.ssub.with.overflow.i32 f11G = a - b; - // DEFAULT: sub nsw i32 0, - // WRAPV: sub i32 0, - // TRAPV: llvm.ssub.with.overflow.i32 - f11G = -a; - // DEFAULT: mul nsw i32 // WRAPV: mul i32 // TRAPV: llvm.smul.with.overflow.i32 f11G = a * b; + + // DEFAULT: sub nsw i32 0, + // WRAPV: sub i32 0, + // TRAPV: llvm.ssub.with.overflow.i32(i32 0 + f11G = -a; + + // PR7426 - Overflow checking for increments. + + // DEFAULT: add nsw i32 {{.*}}, 1 + // WRAPV: add i32 {{.*}}, 1 + // TRAPV: llvm.sadd.with.overflow.i32({{.*}}, i32 1) + ++a; + + // DEFAULT: add nsw i32 {{.*}}, -1 + // WRAPV: add i32 {{.*}}, -1 + // TRAPV: llvm.sadd.with.overflow.i32({{.*}}, i32 -1) + --a; } |

