- example for the Unknown problem
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 23 Oct 2008 13:01:33 +0000 (13:01 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 23 Oct 2008 13:01:33 +0000 (13:01 +0000)
[r23129]

ir/be/test/unknown_combo2.c [new file with mode: 0644]

diff --git a/ir/be/test/unknown_combo2.c b/ir/be/test/unknown_combo2.c
new file mode 100644 (file)
index 0000000..5033e21
--- /dev/null
@@ -0,0 +1,26 @@
+/*$ -fcombo $*/
+
+/*
+ * This is a example for the 'Top reaches if first'
+ * problem.
+ *
+ * If the Cond is evaluated BEFORE the Phi(Unknown, 1)
+ * gets the Const 1, we decide for != and cannot revert
+ * this decision...
+ */
+int main(int argc) {
+       int x;
+
+       if (argc) {
+               x = 1;
+       } else {
+               ++argc;
+       }
+
+       if (x == 1) {
+               printf("x == 1\n");
+       } else {
+               printf("x != 1\n");
+       }
+       return 0;
+}