This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testcase] PR c/4308


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]