From: Gwenole Beauchesne Date: Wed, 9 Jan 2002 23:24:33 +0000 (+0000) Subject: * gcc.c-torture/execute/loop-10.c: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d15f472b060369717a423a48fcb927998667cae;p=gcc.git * gcc.c-torture/execute/loop-10.c: New test. From-SVN: r48698 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d9a1885973d..37e0b7be5b3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-01-09 Gwenole Beauchesne + + * gcc.c-torture/execute/loop-10.c: New test. + 2002-01-09 Jakub Jelinek * gcc.c-torture/compile/20010226-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-10.c b/gcc/testsuite/gcc.c-torture/execute/loop-10.c new file mode 100644 index 00000000000..1a6afba6b95 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/loop-10.c @@ -0,0 +1,31 @@ +/* Reduced from PR optimization/5076, PR optimization/2847 */ + +static int count = 0; + +static void +inc (void) +{ + count++; +} + +int +main (void) +{ + int iNbr = 1; + int test = 0; + while (test == 0) + { + inc (); + if (iNbr == 0) + break; + else + { + inc (); + iNbr--; + } + test = 1; + } + if (count != 2) + abort (); + return 0; +}