diff options
author | Richard Guenther <rguenther@suse.de> | 2007-02-06 12:38:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-02-06 12:38:32 +0000 |
commit | 568265573d247d2f988d95f41f51325148139f3d (patch) | |
tree | 0a991bb66a5b4179756fb6dc9d21220ab46e9356 /gcc | |
parent | fbf798fcc5f1a456213c99d59df41adaf38ad4d8 (diff) | |
download | gcc-568265573d247d2f988d95f41f51325148139f3d.zip gcc-568265573d247d2f988d95f41f51325148139f3d.tar.gz gcc-568265573d247d2f988d95f41f51325148139f3d.tar.bz2 |
re PR middle-end/27302 (Fold does not fold (i < j) == (j > i) to 1)
2007-02-06 Richard Guenther <rguenther@suse.de>
PR middle-end/27302
* gcc.dg/torture/pr27302-2.c: New testcase.
From-SVN: r121644
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr27302-2.c | 52 |
2 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d86d872..0ae9d64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-02-06 Richard Guenther <rguenther@suse.de> + + PR middle-end/27302 + * gcc.dg/torture/pr27302-2.c: New testcase. + 2007-02-06 Dorit Nuzman <dorit@il.ibm.com> * gcc.dg/vect/vect.exp: Add support for -fno-tree-scev-cprop tests. diff --git a/gcc/testsuite/gcc.dg/torture/pr27302-2.c b/gcc/testsuite/gcc.dg/torture/pr27302-2.c new file mode 100644 index 0000000..5c201b3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr27302-2.c @@ -0,0 +1,52 @@ +/* { dg-do run } */ +/* { dg-options "-fstrict-overflow" } */ + +extern void link_error (void); + +void test0 (int a, int b) +{ + if ((a < b) != (b > a)) + link_error (); + + if ((a - 1 < b) != (a <= b)) + link_error (); + if ((a - 2 < b) != (a - 1 <= b)) + link_error (); + if ((a + -1 < b) != (a <= b)) + link_error (); + if ((a + -2 < b) != (a + -1 <= b)) + link_error (); + + if ((a + 1 > b) != (a >= b)) + link_error (); + if ((a + 2 > b) != (a + 1 >= b)) + link_error (); + if ((a - -1 > b) != (a >= b)) + link_error (); + if ((a - -2 > b) != (a - -1 >= b)) + link_error (); + + if ((a + 1 <= b) != (a < b)) + link_error (); + if ((a + 2 <= b) != (a + 1 < b)) + link_error (); + if ((a - -1 <= b) != (a < b)) + link_error (); + if ((a - -2 <= b) != (a - -1 < b)) + link_error (); + + if ((a - 1 >= b) != (a > b)) + link_error (); + if ((a - 2 >= b) != (a - 1 > b)) + link_error (); + if ((a + -1 >= b) != (a > b)) + link_error (); + if ((a + -2 >= b) != (a + -1 > b)) + link_error (); +} + +int main() +{ + test0 (1, 2); + return 0; +} |