aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-26 10:53:55 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-30 20:34:47 +0200
commit0170c91f27ead43ed2805c988bdd0ce465560322 (patch)
tree6b1c58f55fb620abb7bdbc02e44da5534350b65b /validation
parentf9b3fd61a779afac92e29b9b913416441e143486 (diff)
downloadsparse-dev-0170c91f27ead43ed2805c988bdd0ce465560322.tar.gz
fix killing OP_SWITCH
Currently OP_SWITCHes are only handled by default in kill_insn(). In consequence, when killed, OP_SWITCHes leave a fake usage on the condition. Fix this by removing the condition's usage when killing an OP_SWITCH. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/kill-switch.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/validation/kill-switch.c b/validation/kill-switch.c
new file mode 100644
index 00000000..1316a775
--- /dev/null
+++ b/validation/kill-switch.c
@@ -0,0 +1,17 @@
+extern int i;
+
+static void foo(void)
+{
+ switch (i) {
+ case 0:
+ ;
+ }
+}
+
+/*
+ * check-name: kill-switch
+ * check-command: test-linearize $file
+ *
+ * check-output-ignore
+ * check-output-excludes: load\\.
+ */