aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Analysis/LoadVN/dependent_loads.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/LoadVN/dependent_loads.ll b/test/Analysis/LoadVN/dependent_loads.ll
index 97c6e95496..959628f4d6 100644
--- a/test/Analysis/LoadVN/dependent_loads.ll
+++ b/test/Analysis/LoadVN/dependent_loads.ll
@@ -1,5 +1,7 @@
; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
+%S = type { int, sbyte }
+
sbyte %test(sbyte** %P) {
%A = load sbyte** %P
%B = load sbyte* %A
@@ -10,3 +12,16 @@ sbyte %test(sbyte** %P) {
%R = sub sbyte %B, %Y
ret sbyte %R
}
+
+sbyte %test(%S ** %P) {
+ %A = load %S** %P
+ %B = getelementptr %S* %A, int 0, ubyte 1
+ %C = load sbyte* %B
+
+ %X = load %S** %P
+ %Y = getelementptr %S* %X, int 0, ubyte 1
+ %Z = load sbyte* %Y
+
+ %R = sub sbyte %C, %Z
+ ret sbyte %R
+}