From ec604c3c577443a3bbc436d0cbcc06b6b67f3851 Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 10 Nov 2010 12:34:24 +0000 Subject: In StructAssign: be careful not to duplicate accesses to a volatile variable. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1551 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/Makefile | 2 +- test/regression/struct9.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/regression/struct9.c (limited to 'test') diff --git a/test/regression/Makefile b/test/regression/Makefile index c1925c79..a385cc48 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -16,7 +16,7 @@ TESTS=bitfields1 bitfields2 bitfields3 bitfields4 \ # Other tests: should compile to .s without errors (but expect warnings) EXTRAS=annot1 commaprec expr2 expr3 expr4 extern1 funct2 funptr1 init1 \ init2 init3 init4 pragmas ptrs1 ptrs2 sizeof1 struct1 struct2 struct3 \ - struct4 struct5 struct6 types1 volatile1 + struct4 struct5 struct6 struct9 types1 volatile1 # Test known to fail FAILURES=funct1 varargs1 diff --git a/test/regression/struct9.c b/test/regression/struct9.c new file mode 100644 index 00000000..fae137ce --- /dev/null +++ b/test/regression/struct9.c @@ -0,0 +1,13 @@ +struct S1 { + unsigned char f0; + short f1; +}; + +struct S1 g_77 = {0x73,9}; +struct S1 * volatile g_85 = &g_77; +struct S1 g_204 = {0xAD,0x9086}; + +void func_1(void) +{ + *g_85 = g_204; +} -- cgit