aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-01-25 00:37:55 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-01-25 00:37:55 +0100
commit0fb77bb6e5429575f52b5e26f06db031f93de057 (patch)
treec568324597affc04c1d12dd7013d647e7e9e9fdf /validation/optim
parent879b11da4ef9a675216eb1f3458cff1e53904c03 (diff)
parent36df56f0a4f87da3add3347061544f53a1865317 (diff)
downloadsparse-dev-0fb77bb6e5429575f52b5e26f06db031f93de057.tar.gz
Merge branches 'fix-can-move-to' and 'asr-synth' into next
Diffstat (limited to 'validation/optim')
-rw-r--r--validation/optim/lsr-to-asr.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/validation/optim/lsr-to-asr.c b/validation/optim/lsr-to-asr.c
new file mode 100644
index 00000000..26927739
--- /dev/null
+++ b/validation/optim/lsr-to-asr.c
@@ -0,0 +1,27 @@
+int lsr_to_asr24(int x)
+{
+ return ((signed char)(((unsigned)x) >> 24)) == (x >> 24);
+}
+
+
+struct s {
+ int :30;
+ signed int f:2;
+};
+
+int lsr_to_asr30(int a)
+{
+ union {
+ int i;
+ struct s s;
+ } u = { .i = a };
+ return u.s.f == (a >> 30);
+}
+
+/*
+ * check-name: lsr-to-asr
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */