summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
new file mode 100644
index 00000000000..1e0c2c11cf8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -ftree-vectorizer-verbose=3 -fdump-tree-vect-stats" } */
+
+#include <stdlib.h>
+
+#define N 128
+
+#if __LONG_MAX__ == 2147483647
+typedef short half_word;
+#else
+typedef int half_word;
+#endif
+
+int main (int n, int *p)
+{
+ int i;
+ half_word ib[N];
+ half_word ia[N];
+ int k;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = n;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != n)
+ abort ();
+ }
+
+ k = *p;
+ for (i = 0; i < N; i++)
+ {
+ ib[i] = k;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ib[i] != k)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */