summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/vect-fold-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-fold-1.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-fold-1.c b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
new file mode 100644
index 000000000..8aca1e420
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+typedef unsigned char v4qi __attribute__ ((vector_size (4)));
+
+v4qi c;
+
+void foo()
+{
+ v4qi a = { 1, 2, 3, 4 };
+ v4qi b = { 5, 6, 7, 8 };
+ c = a + b;
+}
+
+/* { dg-final { scan-tree-dump-times "c =.* { 6, 8, 10, 12 }" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */