diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-06-15 15:11:26 +0200 |
---|---|---|
committer | Bernhard Schommer <bschommer@users.noreply.github.com> | 2017-07-06 15:41:51 +0200 |
commit | dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a (patch) | |
tree | 82c09b8cff023557084d6257acdef84b1311dd35 /test/regression | |
parent | 92fc8a425034abc1247203a4c0d471e8b6d0e941 (diff) | |
download | compcert-dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a.tar.gz compcert-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')
-rw-r--r-- | test/regression/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Results/volatile4 | 5 | ||||
-rw-r--r-- | test/regression/volatile4.c | 29 |
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; +} |