aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll b/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
new file mode 100644
index 0000000000..1f4ec5b0c1
--- /dev/null
+++ b/test/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
@@ -0,0 +1,13 @@
+; This testcase shows a bug where an common subexpression exists, but there
+; is no shared dominator block that the expression can be hoisted out to.
+;
+; RUN: as < %s | opt -gcse | dis
+
+int "test"(int %X, int %Y) {
+ %Z = add int %X, %Y
+ ret int %Z
+
+Unreachable:
+ %Q = add int %X, %Y
+ ret int %Q
+}