aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-12-11 13:33:13 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:39 +0200
commit86af2a17d26712bce69759120c290c5ede88f677 (patch)
treec29b24b7dde23233b88a99fe3fc29538bd18bb5d /validation/optim
parent3e7e84decfebec22936e288e66fd7a5a51f01fc7 (diff)
downloadsparse-dev-86af2a17d26712bce69759120c290c5ede88f677.tar.gz
cast: reorg testcases related to casts
* merge the tests about implicit & explicit casts in a single file as there was a lot of redundancy. * shuffle the tests to linear/ or optim/ Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
-rw-r--r--validation/optim/kill-casts.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/validation/optim/kill-casts.c b/validation/optim/kill-casts.c
new file mode 100644
index 00000000..cf52f246
--- /dev/null
+++ b/validation/optim/kill-casts.c
@@ -0,0 +1,22 @@
+extern void __abort(void);
+
+struct s {
+ int elem:3;
+};
+
+void foo(struct s *x);
+void foo(struct s *x)
+{
+ if (x->elem == 0) {
+ if (x->elem != 0 && x->elem != 1)
+ __abort();
+ }
+}
+
+/*
+ * check-name: kill-casts
+ * check-command: test-linearize $file
+ *
+ * check-output-ignore
+ * check-output-excludes: cast\\.
+ */