diff mbox series

[committed,PR,rtl-optimization/115877,6/n] Add testcase from pr115877

Message ID 7bba5f77-eb27-44bb-b169-414654ad7119@gmail.com
State New
Headers show
Series [committed,PR,rtl-optimization/115877,6/n] Add testcase from pr115877 | expand

Commit Message

Jeff Law July 24, 2024, 1:12 a.m. UTC
This just adds the testcase from pr115877.  It's working now on the 
trunk.  I'm not done with cleanups/bugfixing, but there's no reason to 
not have the testcase installed at this point.

Pushed to the trunk.

jeff
commit f9a60d575f02822852aa22513c636be38f9c63ea
Author: Jeff Law <jlaw@ventanamicro.com>
Date:   Tue Jul 23 19:11:04 2024 -0600

    [PR rtl-optimization/115877][6/n] Add testcase from pr115877
    
    This just adds the testcase from pr115877.  It's working now on the trunk.  I'm
    not done with cleanups/bugfixing, but there's no reason to not have the
    testcase installed at this point.
    
            PR rtl-optimization/115877
    gcc/testsuite
            * gcc.dg/torture/pr115877.c: New test.
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/torture/pr115877.c b/gcc/testsuite/gcc.dg/torture/pr115877.c
new file mode 100644
index 00000000000..432b1280b17
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr115877.c
@@ -0,0 +1,20 @@ 
+/* { dg-do run { target int128 } } */
+
+char a[16];
+unsigned short u;
+
+__int128
+foo (int i)
+{
+  i -= (unsigned short) ~u;
+  a[(unsigned short) i] = 1;
+  return i;
+}
+
+int
+main ()
+{
+  __int128 x = foo (0);
+  if (x != -0xffff)
+    __builtin_abort();
+}