public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Add two testcases for recently fixed PRs
@ 2014-12-12 12:44 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2014-12-12 12:44 UTC (permalink / raw)
  To: gcc-patches

Hi!

I've committed these two testcases as obvious to trunk, they have been
fixed with the PR63917 r218658 fix.

2014-12-12  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/64255
	* gcc.c-torture/execute/pr64255.c: New test.

	PR rtl-optimization/64260
	* gcc.c-torture/execute/pr64260.c: New test.

--- gcc/testsuite/gcc.c-torture/execute/pr64255.c.jj	2014-12-12 09:12:31.940647593 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr64255.c	2014-12-12 09:12:27.000000000 +0100
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/64255 */
+
+__attribute__((noinline, noclone)) void
+bar (long i, unsigned long j)
+{
+  if (i != 1 || j != 1)
+    __builtin_abort ();
+}
+
+__attribute__((noinline, noclone)) void
+foo (long i)
+{
+  unsigned long j;
+
+  if (!i)
+    return;
+  j = i >= 0 ? (unsigned long) i : - (unsigned long) i;
+  if ((i >= 0 ? (unsigned long) i : - (unsigned long) i) != j)
+    __builtin_abort ();
+  bar (i, j);
+}
+
+int
+main ()
+{
+  foo (1);
+  return 0;
+}
--- gcc/testsuite/gcc.c-torture/execute/pr64260.c.jj	2014-12-12 09:11:27.847784037 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr64260.c	2014-12-12 09:11:19.000000000 +0100
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/64260 */
+
+int a = 1, b;
+
+void
+foo (char p)
+{
+  int t = 0;
+  for (; b < 1; b++)
+    {
+      int *s = &a;
+      if (--t)
+	*s &= p;
+      *s &= 1;
+    }
+}
+
+int
+main ()
+{
+  foo (0);
+  if (a != 0)
+    __builtin_abort ();
+  return 0;
+}

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-12 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-12 12:44 [committed] Add two testcases for recently fixed PRs Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).