From dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 15 Jun 2017 15:11:26 +0200 Subject: 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. --- test/regression/volatile4.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/regression/volatile4.c (limited to 'test/regression/volatile4.c') 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 + +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; +} -- cgit