]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fixed PR [PR116093]
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Apr 2025 06:42:35 +0000 (08:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Apr 2025 06:44:37 +0000 (08:44 +0200)
This testcase got fixed with r15-9397 PR119722 fix.

2025-04-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/116093
* gcc.dg/bitint-122.c: New test.

gcc/testsuite/gcc.dg/bitint-122.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/bitint-122.c b/gcc/testsuite/gcc.dg/bitint-122.c
new file mode 100644 (file)
index 0000000..c791969
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR tree-optimization/116093 */
+/* { dg-do run { target bitint } } */
+/* { dg-options "-Og -ftree-vrp -fno-tree-dce" } */
+
+#if __BITINT_MAXWIDTH__ >= 129
+char
+foo (int a, _BitInt (129) b, char c)
+{
+  return c << (5 / b % (0xdb75dbf5 | a));
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 129
+  if (foo (0, 6, 1) != 1)
+    __builtin_abort ();
+#endif
+}