aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-07-23 19:11:04 -0600
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:05:49 +0200
commit73948d0d4ec3b7866df9e141ac49acfb86768149 (patch)
tree2af213d9e733ce120fea5723c60d8c1a7a588d34 /gcc
parent1bc9314f8b837da7a68912142387d924791e5de4 (diff)
downloadgcc-73948d0d4ec3b7866df9e141ac49acfb86768149.zip
gcc-73948d0d4ec3b7866df9e141ac49acfb86768149.tar.gz
gcc-73948d0d4ec3b7866df9e141ac49acfb86768149.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr115877.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr115877.c b/gcc/testsuite/gcc.dg/torture/pr115877.c
new file mode 100644
index 0000000..432b128
--- /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();
+}