aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/regression/Makefile2
-rw-r--r--test/regression/Results/volatile45
-rw-r--r--test/regression/volatile4.c29
3 files changed, 35 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index 54745863..25b47c7e 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -10,7 +10,7 @@ LIBS=$(LIBMATH)
TESTS=int32 int64 floats floats-basics \
expr1 expr6 funptr2 initializers initializers2 initializers3 \
- volatile1 volatile2 volatile3 \
+ volatile1 volatile2 volatile3 volatile4 \
funct3 expr5 struct7 struct8 struct11 struct12 casts1 casts2 char1 \
sizeof1 sizeof2 binops bool for1 switch switch2 compound \
decl1 interop1 bitfields9 ptrs3 \
diff --git a/test/regression/Results/volatile4 b/test/regression/Results/volatile4
new file mode 100644
index 00000000..e650a8e5
--- /dev/null
+++ b/test/regression/Results/volatile4
@@ -0,0 +1,5 @@
+l = 42
+a[5] = 255
+g = 3
+b[2] = -1
+p[1] = 80
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;
+}