From 268a53de823a6750d6256ee1fb1e7707b4b45740 Mon Sep 17 00:00:00 2001 From: Xavier ASUS Date: Fri, 18 Oct 2019 00:31:54 +0200 Subject: sdcc-3.9.0 fork implementing GNU assembler syntax This fork aims to provide better support for stm8-binutils --- support/valdiag/tests/const.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 support/valdiag/tests/const.c (limited to 'support/valdiag/tests/const.c') diff --git a/support/valdiag/tests/const.c b/support/valdiag/tests/const.c new file mode 100644 index 0000000..5082081 --- /dev/null +++ b/support/valdiag/tests/const.c @@ -0,0 +1,21 @@ + +char a; +const char ca=2; +const char *pca; +char * const cpa=&a; + +void test(void) +{ + a = 1; +#ifdef TEST1 + ca = a; /* ERROR */ +#endif +#ifdef TEST2 + pca = &a; + *pca = 2; /* ERROR */ +#endif +#ifdef TEST3 + *cpa = 3; + cpa = &ca; /* ERROR */ +#endif +} -- cgit v1.2.3