aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-11 23:18:26 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-15 20:34:26 +0100
commit8f1047988b881f5d8c43c60ed7f651b74952a4a5 (patch)
treecb8d0608632715e3b0fe36841731ae36855ff94a
parent27696c8a96012ccd85c714cfa9606129880fa89e (diff)
downloadsparse-8f1047988b881f5d8c43c60ed7f651b74952a4a5.tar.gz
cfg: add testcase for phi-adjusting during BB merge
When merging BBs, phi-sources from the bottom BB should 'overwrite' the ones from the top BB which should be ignored. Add a testcase from the incoming fix. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--validation/optim/merge_bbe-adjust_phi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/validation/optim/merge_bbe-adjust_phi.c b/validation/optim/merge_bbe-adjust_phi.c
new file mode 100644
index 00000000..de4c54cc
--- /dev/null
+++ b/validation/optim/merge_bbe-adjust_phi.c
@@ -0,0 +1,24 @@
+extern int array[2];
+
+static inline int stupid_select(int idx)
+{
+ if (idx)
+ idx = 0;
+ return array[idx];
+}
+
+int select(void)
+{
+ int d = stupid_select(-1);
+ return d;
+}
+
+/*
+ * check-name: merge_bbe-adjust_phi
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: phisrc\\.
+ * check-output-excludes: phi\\.
+ */