]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fixed PR112518
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Nov 2023 10:31:12 +0000 (11:31 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 22 Nov 2023 10:32:54 +0000 (11:32 +0100)
This PR has been fixed by the PR112526 fix.

2023-11-22  Jakub Jelinek  <jakub@redhat.com>

PR target/112518
* gcc.target/i386/bmi2-pr112518.c: New test.

gcc/testsuite/gcc.target/i386/bmi2-pr112518.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/i386/bmi2-pr112518.c b/gcc/testsuite/gcc.target/i386/bmi2-pr112518.c
new file mode 100644 (file)
index 0000000..6aea13f
--- /dev/null
@@ -0,0 +1,25 @@
+/* PR target/112518 */
+/* { dg-do run { target { bmi2 && int128 } } } */
+/* { dg-options "-Os -mbmi2" } */
+
+#include "bmi2-check.h"
+
+unsigned u;
+int g;
+
+unsigned long long
+foo (int i)
+{
+  unsigned long long x = u;
+  g = __builtin_mul_overflow_p (u, ((unsigned __int128) 4292468825) << 64 | 150, 0);
+  x |= g % i;
+  return x;
+}
+
+static __attribute__((noipa)) void
+bmi2_test ()
+{
+  unsigned long long x = foo (3);
+  if (x)
+    __builtin_abort ();
+}