summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr25413a.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/vect/pr25413a.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/pr25413a.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr25413a.c129
1 files changed, 129 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr25413a.c b/gcc/testsuite/gcc.dg/vect/pr25413a.c
new file mode 100644
index 000000000..b9bef5f5b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr25413a.c
@@ -0,0 +1,129 @@
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+#define N 8
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void *malloc (size_t __size) __attribute__ ((__nothrow__,
+ __malloc__));
+
+typedef double num_t;
+static const num_t num__infty = ((num_t)1.0)/((num_t)0.0);
+
+struct oct_tt;
+typedef struct oct_tt oct_t;
+
+typedef unsigned int var_t;
+typedef enum {
+ OCT_EMPTY = 0,
+ OCT_NORMAL = 1,
+ OCT_CLOSED = 2
+} oct_state;
+
+struct oct_tt {
+ var_t n;
+
+ int ref;
+
+ oct_state state;
+ struct oct_tt* closed;
+
+ num_t* c;
+};
+
+void* octfapg_mm_malloc (size_t t);
+oct_t* octfapg_alloc (var_t n);
+oct_t* octfapg_full_copy (oct_t* m);
+
+struct mmalloc_tt;
+typedef struct mmalloc_tt mmalloc_t;
+
+struct mmalloc_tt
+{
+ int id;
+
+ int nb_alloc;
+ int nb_realloc;
+ int nb_free;
+
+ size_t rem;
+ size_t max;
+ size_t tot;
+
+};
+
+typedef struct
+{
+ size_t size;
+
+ mmalloc_t* mm;
+ int id;
+
+ double dummy;
+
+} mmheader_t;
+
+void*
+octfapg_mm_malloc (size_t t)
+{
+ char* m = (char*)malloc(t+sizeof(mmheader_t));
+ return m+sizeof(mmheader_t);
+}
+
+oct_t* octfapg_empty (var_t n);
+
+oct_t*
+octfapg_empty (const var_t n)
+{
+ oct_t* m;
+ /*octfapg_timing_enter("oct_empty",3);*/
+ m = ((oct_t*) octfapg_mm_malloc (sizeof(oct_t)));
+ m->n = n;
+ m->ref = 1;
+ m->state = OCT_EMPTY;
+ m->closed = (oct_t*)((void *)0);
+ m->c = (num_t*)((void *)0);
+ /*octfapg_timing_exit("oct_empty",3);*/
+ return m;
+}
+
+oct_t*
+octfapg_alloc (const var_t n)
+{
+ size_t nn = (2*(size_t)(n)*((size_t)(n)+1));
+ oct_t* m;
+ m = octfapg_empty(n);
+ m->c = ((num_t*) octfapg_mm_malloc (sizeof(num_t)*(nn)));
+ ;
+ m->state = OCT_NORMAL;
+ m->closed = (oct_t*)((void *)0);
+ return m;
+}
+
+oct_t*
+octfapg_universe (const var_t n)
+{
+ oct_t* m;
+ size_t i, nn = (2*(size_t)(n)*((size_t)(n)+1));
+ m = octfapg_alloc(n);
+ for (i=0;i<nn;i++) *(m->c+i) = num__infty;
+ for (i=0;i<2*n;i++) *(m->c+((size_t)(i)+(((size_t)(i)+1)*((size_t)(i)+1))/2)) = (num_t)(0);
+ m->state = OCT_CLOSED;
+ return m;
+}
+
+int main (void)
+{
+ int i;
+ check_vect ();
+
+ oct_t *p = octfapg_universe(10);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */