From: Jeff Law Date: Wed, 24 Jul 2024 01:11:04 +0000 (-0600) Subject: [PR rtl-optimization/115877][6/n] Add testcase from pr115877 X-Git-Tag: basepoints/gcc-16~7313 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9a60d575f02822852aa22513c636be38f9c63ea;p=thirdparty%2Fgcc.git [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 --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(); +}