summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/LoadVN/call_cse.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Analysis/LoadVN/call_cse.ll')
-rw-r--r--llvm/test/Analysis/LoadVN/call_cse.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Analysis/LoadVN/call_cse.ll b/llvm/test/Analysis/LoadVN/call_cse.ll
new file mode 100644
index 00000000000..78cdd43051f
--- /dev/null
+++ b/llvm/test/Analysis/LoadVN/call_cse.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
+declare int %strlen(sbyte*)
+
+int %test(sbyte* %P) {
+ %X = call int %strlen(sbyte* %P)
+ %A = add int %X, 14
+ %Y = call int %strlen(sbyte* %P)
+ %Z = sub int %X, %Y
+ %B = add int %A, %Z
+ ret int %B
+}
OpenPOWER on IntegriCloud