From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; 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. --- gcc/testsuite/g++.dg/graphite/pr41305.C | 332 ++++++++++++++++++++++++++++++++ 1 file changed, 332 insertions(+) create mode 100644 gcc/testsuite/g++.dg/graphite/pr41305.C (limited to 'gcc/testsuite/g++.dg/graphite/pr41305.C') diff --git a/gcc/testsuite/g++.dg/graphite/pr41305.C b/gcc/testsuite/g++.dg/graphite/pr41305.C new file mode 100644 index 000000000..6a30b0e9e --- /dev/null +++ b/gcc/testsuite/g++.dg/graphite/pr41305.C @@ -0,0 +1,332 @@ +// { dg-do compile } +// { dg-options "-O3 -floop-interchange -Wno-conversion-null" } + +void __throw_bad_alloc (); + +template void +swap (_Tp & __a, _Tp __b) +{ + __a = __b; +} + +template struct iterator +{ + typedef _Category iterator_category; +}; + +template struct allocator +{ + typedef __SIZE_TYPE__ size_type; + typedef _Tp pointer; + pointer allocate (size_type) + { + __throw_bad_alloc (); + return __null; + } +}; + +template >class unbounded_array; +template >class vector; +template class scalar_vector; +template struct random_access_iterator_base : public iterator +{ +}; + +template struct promote_traits +{ + typedef __typeof__ ((X ())) promote_type; +}; + +template struct scalar_traits +{ + typedef T const_reference; + typedef T reference; +}; + +template struct type_traits : scalar_traits +{ +}; + +struct dense_proxy_tag +{ +}; + +template struct iterator_base_traits; + +template <> struct iterator_base_traits +{ + template struct iterator_base + { + typedef random_access_iterator_base type; + }; +}; + +template struct iterator_restrict_traits +{ + typedef I1 iterator_category; +}; + +template class storage_array +{ +}; + +template struct unbounded_array : public storage_array > +{ + typedef typename ALLOC::size_type size_type; + typedef T & reference; + typedef T *pointer; + unbounded_array (size_type size, ALLOC = ALLOC ()) : alloc_ (), size_ (size) + { + alloc_.allocate (size_); + } + ~unbounded_array () + { + if (size_) + for (;;); + } + size_type + size () const + { + return size_; + } + reference + operator[] (size_type i) + { + return data_[i]; + } + void + swap (unbounded_array & a) + { + ::swap (size_, a.size_); + } + ALLOC alloc_; + size_type size_; + pointer data_; +}; + +template struct scalar_binary_functor +{ + typedef typename promote_traits ::promote_type result_type; +}; + +template struct scalar_plus : public scalar_binary_functor +{ +}; + +template struct scalar_multiplies : public scalar_binary_functor +{ +}; + +template struct scalar_binary_assign_functor +{ + typedef typename type_traits ::reference argument1_type; + typedef typename type_traits ::const_reference argument2_type; +}; + +template struct scalar_assign : public scalar_binary_assign_functor +{ + typedef typename scalar_binary_assign_functor ::argument1_type argument1_type; + typedef typename scalar_binary_assign_functor ::argument2_type argument2_type; + static const bool computed = false; + static void + apply (argument1_type t1, argument2_type t2) + { + t1 = t2; + } +}; + +template struct vector_expression +{ + typedef E expression_type; + const expression_type & + operator () () const + { + return *static_cast (this); + } +}; + +template class vector_container : public vector_expression +{ +}; + +template struct vector_reference : public vector_expression > +{ + typedef typename E::size_type size_type; + typename E::const_reference const_reference; + typedef E referred_type; + vector_reference (referred_type & e) : e_ (e) + { + } + size_type + size () const + { + return expression ().size (); + } + referred_type & + expression () const + { + return e_; + } + referred_type &e_; +}; + +template struct vector_binary : public vector_expression > +{ + typedef E1 expression1_type; + typedef E2 expression2_type; + typedef typename E1::const_closure_type expression1_closure_type; + typedef typename E2::const_closure_type expression2_closure_type; + typedef typename promote_traits ::promote_type size_type; + typedef typename F::result_type value_type; + + vector_binary (const expression1_type & e1, expression2_type e2) : e1_ (e1), e2_ (e2) + { + } + + size_type + size () const + { + return e1_.size (); + } + + class const_iterator : public iterator_base_traits ::iterator_category>::template iterator_base ::type + { + }; + expression1_closure_type e1_; + expression2_closure_type e2_; +}; + +template struct vector_binary_traits +{ + typedef vector_binary expression_type; + typedef expression_type result_type; +}; + +template typename vector_binary_traits >::result_type +operator + (vector_expression &e1, const vector_expression &e2) +{ + typedef typename vector_binary_traits >::expression_type expression_type; + return expression_type (e1 (), e2 ()); +} + +template struct vector_binary_scalar2 : public vector_expression > +{ + typedef vector_binary_scalar2 self_type; + typedef typename E1::size_type size_type; + typedef typename F::result_type value_type; + typedef self_type const_closure_type; +}; + +template struct vector_binary_scalar2_traits +{ + typedef vector_binary_scalar2 result_type; +}; + +template +typename vector_binary_scalar2_traits >::result_type +operator * (vector_expression , T2) +{ +} + +template struct vector_assign_traits +{ + typedef SC storage_category; +}; + +template