diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2014-12-24 14:27:06 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2014-12-24 14:27:06 +0000 |
commit | 369695b99d6eb0382c32ad442a55a5d3e656069a (patch) | |
tree | 513232d8915399cf8c78a01f112931fa4bd7657e | |
parent | 5704db3364d16d19ef2da79b2a6c21da8160b939 (diff) | |
download | gcc-369695b99d6eb0382c32ad442a55a5d3e656069a.zip gcc-369695b99d6eb0382c32ad442a55a5d3e656069a.tar.gz gcc-369695b99d6eb0382c32ad442a55a5d3e656069a.tar.bz2 |
Fix undefined-loop-2.c test case.
2014-12-24 Andrew Stubbs <ams@codesourcery.com>
PR testsuite/64032
* gcc.dg/undefined-loop-2.c: Don't allow GCC to optimize away the
loop exits too early.
From-SVN: r219059
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/undefined-loop-2.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b74165e..ef6a8aa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-12-24 Andrew Stubbs <ams@codesourcery.com> + + PR testsuite/64032 + * gcc.dg/undefined-loop-2.c: Don't allow GCC to optimize away the + loop exits too early. + 2014-12-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/63985 diff --git a/gcc/testsuite/gcc.dg/undefined-loop-2.c b/gcc/testsuite/gcc.dg/undefined-loop-2.c index dbea62c..7ab37f4 100644 --- a/gcc/testsuite/gcc.dg/undefined-loop-2.c +++ b/gcc/testsuite/gcc.dg/undefined-loop-2.c @@ -15,8 +15,11 @@ foo (int p) (p ? array1[i] /* { dg-message "note: possible undefined statement is here" } */ : array2[i]) /* { dg-message "note: possible undefined statement is here" } */ - && i < 5 /* { dg-warning "loop exit may only be reached after undefined behavior" } */ && i < 100; /* { dg-warning "loop exit may only be reached after undefined behavior" } */ i++) - doSomething(array1[i]); + { + if (i >= 5) /* { dg-warning "loop exit may only be reached after undefined behavior" } */ + break; + doSomething(array1[i]); + } } |