aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/InstCombine/add.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/add.ll b/test/Transforms/InstCombine/add.ll
index 8868929ff6..c9715635ea 100644
--- a/test/Transforms/InstCombine/add.ll
+++ b/test/Transforms/InstCombine/add.ll
@@ -177,3 +177,17 @@ long %test25(long %Y) {
ret long %tmp.8
}
+int %test26(int %A, int %B) {
+ %C = add int %A, %B
+ %D = sub int %C, %B
+ ret int %D
+}
+
+int %test27(bool %C, int %X, int %Y) {
+ %A = add int %X, %Y
+ %B = add int %Y, 123
+ %C = select bool %C, int %A, int %B ;; Fold add through select.
+ %D = sub int %C, %Y
+ ret int %D
+}
+