aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-01-13 11:13:22 +0100
committerJakub Jelinek <jakub@redhat.com>2023-01-13 11:13:22 +0100
commitadd71b95dd27d73d64eee0a9c8f748672b7050f5 (patch)
treec38f471e345d2bcad45b1d59b95eb3c3d725a318
parenteb4994545fbd2a670e422f6e98c16e4ed60ac53e (diff)
downloadgcc-add71b95dd27d73d64eee0a9c8f748672b7050f5.zip
gcc-add71b95dd27d73d64eee0a9c8f748672b7050f5.tar.gz
gcc-add71b95dd27d73d64eee0a9c8f748672b7050f5.tar.bz2
testsuite: Add testcase for PR that went latent in GCC 13 [PR107131]
The following testcase is probably latent since r13-3217-gc4d15dddf6b9e. Adding testcase so that it doesn't silently reappear. 2023-01-13 Jakub Jelinek <jakub@redhat.com> PR target/107131 * gcc.dg/pr107131.c: New test.
-rw-r--r--gcc/testsuite/gcc.dg/pr107131.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr107131.c b/gcc/testsuite/gcc.dg/pr107131.c
new file mode 100644
index 0000000..458b128
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr107131.c
@@ -0,0 +1,30 @@
+/* PR target/107131 */
+/* { dg-do run } */
+/* { dg-options "-Os -fno-ipa-vrp -fno-tree-bit-ccp -Wno-psabi" } */
+
+typedef unsigned char C;
+typedef unsigned long long __attribute__((__vector_size__ (32))) U;
+typedef unsigned long long __attribute__((__vector_size__ (64))) V;
+
+static __attribute__((__noclone__)) C
+foo (C o, U x, U y, U z)
+{
+ V a = __builtin_shufflevector (x, x, 3, 1, 3, 0, 0, 1, 1, 3);
+ V b = (V) { } >= o;
+ V c = b <= (V)(b >= (V) { 0, 0, 0, 0, 0, 0x90DF0BE3990AC871ULL });
+ U d = __builtin_shufflevector (y, z, 3, 1, 4, 5);
+ V e = a + c;
+ U f = ((union { V v; U u[2]; }) e).u[1] + d;
+ return ((union { U u; C c[32]; }) f).c[9];
+}
+
+int
+main ()
+{
+ if (__SIZEOF_LONG_LONG__ != 8 || __CHAR_BIT__ != 8)
+ return 0;
+ C x = foo (0, (U) { }, (U) { }, (U) { });
+ if (x != 0xff)
+ __builtin_abort();
+ return 0;
+}