aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/volatile4.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2017-06-15 15:11:26 +0200
committerBernhard Schommer <bschommer@users.noreply.github.com>2017-07-06 15:41:51 +0200
commitdff22ef6d855973e0e0f05c7203a6bfa9a4cf01a (patch)
tree82c09b8cff023557084d6257acdef84b1311dd35 /test/regression/volatile4.c
parent92fc8a425034abc1247203a4c0d471e8b6d0e941 (diff)
downloadcompcert-kvx-dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a.tar.gz
compcert-kvx-dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a.zip
Extend builtin arguments with a pointer addition operator
This extension enables more addressing modes to be encoded as builtin arguments and used in conjunction with volatile memory accesses. Current status: x86 port only, the only new addressing mode handled is reg + offset.
Diffstat (limited to 'test/regression/volatile4.c')
-rw-r--r--test/regression/volatile4.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/regression/volatile4.c b/test/regression/volatile4.c
new file mode 100644
index 00000000..b72e1bb9
--- /dev/null
+++ b/test/regression/volatile4.c
@@ -0,0 +1,29 @@
+/* Addressing modes in volatiles */
+
+#include <stdio.h>
+
+volatile int g = 1;
+volatile int b[10];
+
+void test1(volatile int * p)
+{
+ volatile int l;
+ volatile int a[10];
+
+ l = 42;
+ printf ("l = %d\n", l);
+ a[5] = 0xff;
+ printf ("a[5] = %d\n", a[5]);
+ g = 3;
+ printf ("g = %d\n", g);
+ b[2] = -1;
+ printf ("b[2] = %d\n", b[2]);
+ p[1] = 80;
+ printf ("p[1] = %d\n", p[1]);
+}
+
+int main()
+{
+ test1(&b[0]);
+ return 0;
+}