summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/exprs.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-26 20:27:24 +0000
committerChris Lattner <sabre@nondot.org>2010-06-26 20:27:24 +0000
commit217e056e409f51bc64a82334e72bed0f14a51270 (patch)
tree425800e065fb935cc5b19ef38d67f82bd058fe8c /clang/test/CodeGen/exprs.c
parent3bbc52ce3e3d5a4e28147085266819c17bb7ad99 (diff)
downloadbcm5719-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.c15
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;
+}
OpenPOWER on IntegriCloud