]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PR rtl-optimization/115877][6/n] Add testcase from pr115877
authorJeff Law <jlaw@ventanamicro.com>
Wed, 24 Jul 2024 01:11:04 +0000 (19:11 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Wed, 24 Jul 2024 01:11:04 +0000 (19:11 -0600)
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.

gcc/testsuite/gcc.dg/torture/pr115877.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/pr115877.c b/gcc/testsuite/gcc.dg/torture/pr115877.c
new file mode 100644 (file)
index 0000000..432b128
--- /dev/null
@@ -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();
+}