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/bug-895992.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 support/valdiag/tests/bug-895992.c (limited to 'support/valdiag/tests/bug-895992.c') diff --git a/support/valdiag/tests/bug-895992.c b/support/valdiag/tests/bug-895992.c new file mode 100644 index 0000000..24bf327 --- /dev/null +++ b/support/valdiag/tests/bug-895992.c @@ -0,0 +1,34 @@ + +/* bug-895992.c + + Life Range problem with + - uninitialized variable + - loop + - conditional block + */ + +#ifdef TEST1 +char p0; + +void wait (void); + +void foo(void) +{ + unsigned char number; + unsigned char start = 1; + unsigned char i; + + do + { + for (i = 1; i > 0 ; i--) + wait(); + if (start) + { + number = p0; + start = 0; + } + number--; /* WARNING(SDCC) */ + } + while (number != 0); +} +#endif -- cgit v1.2.3