diff options
Diffstat (limited to 'support/valdiag/tests/bug-895992.c')
| -rw-r--r-- | support/valdiag/tests/bug-895992.c | 34 |
1 files changed, 34 insertions, 0 deletions
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 |
