This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testcase] PR c/4308
- From: Jakub Jelinek <jakub at redhat dot com>
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Feb 2002 17:13:43 +0100
- Subject: [testcase] PR c/4308
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
PR c/4308 was fixed by
http://gcc.gnu.org/ml/gcc-patches/2001-11/msg00513.html
but I cannot find any testcase added for this.
Ok to commit?
2002-02-19 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20020219-1.c: New test.
--- gcc/testsuite/gcc.c-torture/execute/20020219-1.c.jj Thu Aug 30 22:30:55 2001
+++ gcc/testsuite/gcc.c-torture/execute/20020219-1.c Tue Feb 19 17:25:09 2002
@@ -0,0 +1,21 @@
+/* PR c/4308
+ This testcase failed because 0x8000000000000000 >> 0
+ was incorrectly folded into 0xffffffff00000000. */
+
+extern void abort (void);
+extern void exit (int);
+
+long long foo (void)
+{
+ long long C = 1ULL << 63, X;
+ int Y = 32;
+ X = C >> (Y & 31);
+ return X;
+}
+
+int main (void)
+{
+ if (foo () != 1ULL << 63)
+ abort ();
+ exit (0);
+}
Jakub