diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-26 20:27:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-26 20:27:24 +0000 |
commit | 217e056e409f51bc64a82334e72bed0f14a51270 (patch) | |
tree | 425800e065fb935cc5b19ef38d67f82bd058fe8c /clang/test/CodeGen/exprs.c | |
parent | 3bbc52ce3e3d5a4e28147085266819c17bb7ad99 (diff) | |
download | bcm5719-llvm-217e056e409f51bc64a82334e72bed0f14a51270.tar.gz bcm5719-llvm-217e056e409f51bc64a82334e72bed0f14a51270.zip |
implement rdar://7432000 - signed negate should codegen as NSW.
While I'm in there, adjust pointer to member adjustments as well.
llvm-svn: 106955
Diffstat (limited to 'clang/test/CodeGen/exprs.c')
-rw-r--r-- | clang/test/CodeGen/exprs.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/CodeGen/exprs.c b/clang/test/CodeGen/exprs.c index d82cbf48d30..a90ae58dc3f 100644 --- a/clang/test/CodeGen/exprs.c +++ b/clang/test/CodeGen/exprs.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // PR1895 // sizeof function @@ -119,3 +119,16 @@ void f9(struct S *x) { void f10() { __builtin_sin(0); } + +// Tests for signed integer overflow stuff. +// rdar://7432000 +void f11() { + // CHECK: define void @f11 + extern volatile int f11G, a, b; + // CHECK: add nsw i32 + f11G = a + b; + // CHECK: sub nsw i32 + f11G = a - b; + // CHECK: sub nsw i32 0, + f11G = -a; +} |