aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr117811.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr117811.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr117811.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr117811.c b/gcc/testsuite/gcc.dg/torture/pr117811.c
new file mode 100644
index 0000000..13d7e13
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr117811.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+#include <string.h>
+
+typedef int v4 __attribute__((vector_size (4 * sizeof (int))));
+
+void __attribute__((noclone,noinline)) do_shift (v4 *vec, int shift)
+{
+ v4 t = *vec;
+
+ if (shift > 0)
+ {
+ t = t >> shift;
+ }
+
+ *vec = t;
+}
+
+int main ()
+{
+ v4 vec = {0x1000000, 0x2000, 0x300, 0x40};
+ v4 vec2 = {0x100000, 0x200, 0x30, 0x4};
+ do_shift (&vec, 4);
+ if (memcmp (&vec, &vec2, sizeof (v4)) != 0)
+ __builtin_abort ();
+ return 0;
+}