summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20030323-1.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-23 22:57:26 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-23 22:57:26 +0000
commitcee280efb4397b8c6e08a33b5000b42c885325fd (patch)
treee1c8674477700f6ed2edd93d67199d024ef407d1 /gcc/testsuite/gcc.dg/20030323-1.c
parent8df677b548f48904cd6374e32bbb5076fbf8b731 (diff)
downloadgcc-cee280efb4397b8c6e08a33b5000b42c885325fd.tar.gz
PR c/8224
* fold-const.c (extract_muldiv_1): Don't pass through type conversions when signedness changes for division or modulus. PR c/8224 * gcc.dg/20030323-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/20030323-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/20030323-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20030323-1.c b/gcc/testsuite/gcc.dg/20030323-1.c
new file mode 100644
index 00000000000..8a563ec5eb2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030323-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+/* PR c/8224 */
+/* Contributed by Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> */
+
+extern void abort (void);
+
+unsigned f (int x)
+{
+ return (unsigned) (x / 2) / 2;
+}
+
+unsigned f1 (int x)
+{
+ unsigned xx = x / 2;
+ return xx / 2;
+}
+
+int main ()
+{
+ if (f1 (-5) != f (-5))
+ abort ();
+ return 0;
+}