summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorMichael Liao <michael.liao@intel.com>2012-08-28 16:55:13 +0000
committerMichael Liao <michael.liao@intel.com>2012-08-28 16:55:13 +0000
commit48f498fccf84d4b8888a567884cb935a4f457741 (patch)
tree440e14aea342c0534be908d9d6846620ca62cfe8 /clang/test/CodeGen
parent2a226a61daea6282cb20eca5bdd51360e3b801bd (diff)
downloadbcm5719-llvm-48f498fccf84d4b8888a567884cb935a4f457741.tar.gz
bcm5719-llvm-48f498fccf84d4b8888a567884cb935a4f457741.zip
Fix PR13704
- The increment needs to be signed value to preserve the original value when its data type is larger than 64-bit integer. llvm-svn: 162766
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/pr13704.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/pr13704.c b/clang/test/CodeGen/pr13704.c
new file mode 100644
index 00000000000..41b8b2cc710
--- /dev/null
+++ b/clang/test/CodeGen/pr13704.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+extern void foo(__int128);
+
+void bar() {
+ __int128 x = 2;
+ x--;
+ foo(x);
+// CHECK: add nsw i128 %0, -1
+}
OpenPOWER on IntegriCloud