aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr119318.c38
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr119530.c21
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr118476-1.c14
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr119757.c17
4 files changed, 90 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/pr119318.c b/gcc/testsuite/gcc.dg/ipa/pr119318.c
new file mode 100644
index 0000000..8e62ec5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr119318.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int128 } */
+/* { dg-additional-options "-Wno-psabi -w" } */
+/* { dg-options "-Wno-psabi -O2" } */
+
+typedef unsigned V __attribute__((vector_size (64)));
+typedef unsigned __int128 W __attribute__((vector_size (64)));
+
+W a;
+W b;
+W c = { -0xffff, -0xffff, -0xffff, -0xffff };
+
+static __attribute__((__noinline__, __noclone__)) W
+bar (unsigned __int128 u)
+{
+ return u + c;
+}
+
+static inline W
+foo (unsigned short s, V v)
+{
+ V y = (V) bar ((unsigned short) ~s);
+ v >>= y;
+ b ^= (W) a;
+ v *= v;
+ return (W) v + b;
+}
+
+
+int
+main ()
+{
+ W x = foo (0, (V) { 0, 5 });
+ for (unsigned i = 0; i < sizeof(x)/sizeof(x[0]); i++)
+ if (x[i] != (i ? 0 : 0x1900000000))
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr119530.c b/gcc/testsuite/gcc.dg/ipa/pr119530.c
new file mode 100644
index 0000000..f99c4fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr119530.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-tree-vrp -fno-inline" } */
+
+struct a {
+ int b;
+};
+int c;
+signed char d;
+static int e(long long f) { return f < 0; }
+static void g(unsigned f) { c = e(~f); }
+int main() {
+ int h;
+ struct a i = {128};
+ h = d > i.b;
+ g(h);
+ if (h)
+ __builtin_abort();
+ if (c)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr118476-1.c b/gcc/testsuite/gcc.dg/torture/pr118476-1.c
new file mode 100644
index 0000000..33509403
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr118476-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+/* PR tree-optimization/118476 */
+
+typedef unsigned long long poly64x1 __attribute__((__vector_size__(1*sizeof(long long))));
+
+poly64x1 vext_p64(poly64x1 a, poly64x1 b, const int n)
+{
+ poly64x1 r = a;
+ unsigned src = (unsigned)n;
+ long long t = b[0];
+ r[0] = (src < 1) ? a[src] : t;
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr119757.c b/gcc/testsuite/gcc.dg/vect/pr119757.c
new file mode 100644
index 0000000..8644299
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr119757.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+void base64_encode(const char *table64,
+ const char *inputbuff, int insize,
+ char * __restrict output)
+{
+ const unsigned char *in = (const unsigned char *)inputbuff;
+
+ while(insize >= 3) {
+ *output++ = table64[ in[0] >> 2 ];
+ *output++ = table64[ ((in[0] & 0x03) << 4) | (in[1] >> 4) ];
+ *output++ = table64[ ((in[1] & 0x0F) << 2) | ((in[2] & 0xC0) >> 6) ];
+ *output++ = table64[ in[2] & 0x3F ];
+ insize -= 3;
+ in += 3;
+ }
+}