URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/g++.dg/graphite
- from Rev 301 to Rev 338
- ↔ Reverse comparison
Rev 301 → Rev 338
/pr41305.C
0,0 → 1,332
// { dg-do compile } |
// { dg-options "-O3 -floop-interchange -Wno-conversion-null" } |
|
void __throw_bad_alloc (); |
|
template <typename _Tp> void |
swap (_Tp & __a, _Tp __b) |
{ |
__a = __b; |
} |
|
template <typename _Category> struct iterator |
{ |
typedef _Category iterator_category; |
}; |
|
template <typename _Tp> struct allocator |
{ |
typedef __SIZE_TYPE__ size_type; |
typedef _Tp pointer; |
pointer allocate (size_type) |
{ |
__throw_bad_alloc (); |
return __null; |
} |
}; |
|
template <class T, class = allocator <T> >class unbounded_array; |
template <class T, class = unbounded_array <T> >class vector; |
template <class = int> class scalar_vector; |
template <class IC> struct random_access_iterator_base : public iterator <IC> |
{ |
}; |
|
template <class X, class> struct promote_traits |
{ |
typedef __typeof__ ((X ())) promote_type; |
}; |
|
template <class T> struct scalar_traits |
{ |
typedef T const_reference; |
typedef T reference; |
}; |
|
template <class T> struct type_traits : scalar_traits <T> |
{ |
}; |
|
struct dense_proxy_tag |
{ |
}; |
|
template <class> struct iterator_base_traits; |
|
template <> struct iterator_base_traits <dense_proxy_tag> |
{ |
template <class, class> struct iterator_base |
{ |
typedef random_access_iterator_base <dense_proxy_tag> type; |
}; |
}; |
|
template <class I1, class> struct iterator_restrict_traits |
{ |
typedef I1 iterator_category; |
}; |
|
template <class> class storage_array |
{ |
}; |
|
template <class T, class ALLOC> struct unbounded_array : public storage_array <unbounded_array <ALLOC> > |
{ |
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 <class T1, class T2> struct scalar_binary_functor |
{ |
typedef typename promote_traits <T1, T2>::promote_type result_type; |
}; |
|
template <class T1, class T2> struct scalar_plus : public scalar_binary_functor <T1, T2> |
{ |
}; |
|
template <class T1, class T2> struct scalar_multiplies : public scalar_binary_functor <T1, T2> |
{ |
}; |
|
template <class T1, class T2> struct scalar_binary_assign_functor |
{ |
typedef typename type_traits <T1>::reference argument1_type; |
typedef typename type_traits <T2>::const_reference argument2_type; |
}; |
|
template <class T1, class T2> struct scalar_assign : public scalar_binary_assign_functor <T1, T2> |
{ |
typedef typename scalar_binary_assign_functor <T1, T2>::argument1_type argument1_type; |
typedef typename scalar_binary_assign_functor <T1, T2>::argument2_type argument2_type; |
static const bool computed = false; |
static void |
apply (argument1_type t1, argument2_type t2) |
{ |
t1 = t2; |
} |
}; |
|
template <class E> struct vector_expression |
{ |
typedef E expression_type; |
const expression_type & |
operator () () const |
{ |
return *static_cast <const expression_type *>(this); |
} |
}; |
|
template <class C> class vector_container : public vector_expression <C> |
{ |
}; |
|
template <class E> struct vector_reference : public vector_expression <vector_reference <E> > |
{ |
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 <class E1, class E2, class F> struct vector_binary : public vector_expression <vector_binary <E1, E2, F> > |
{ |
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 <typename E1::size_type, typename E2::size_type>::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 <typename iterator_restrict_traits <typename E1::const_iterator::iterator_category, const_iterator>::iterator_category>::template iterator_base <const_iterator, value_type>::type |
{ |
}; |
expression1_closure_type e1_; |
expression2_closure_type e2_; |
}; |
|
template <class E1, class E2, class F> struct vector_binary_traits |
{ |
typedef vector_binary <E1, E2, F> expression_type; |
typedef expression_type result_type; |
}; |
|
template <class E1, class E2> typename vector_binary_traits <E1, E2, scalar_plus <typename E1::value_type, typename E2::value_type> >::result_type |
operator + (vector_expression <E1> &e1, const vector_expression <E2> &e2) |
{ |
typedef typename vector_binary_traits <E1, E2, scalar_plus <typename E1::value_type, typename E2::value_type> >::expression_type expression_type; |
return expression_type (e1 (), e2 ()); |
} |
|
template <class E1, class E2, class F> struct vector_binary_scalar2 : public vector_expression <vector_binary_scalar2 <E1, E2, F> > |
{ |
typedef vector_binary_scalar2 <E1, E2, F> self_type; |
typedef typename E1::size_type size_type; |
typedef typename F::result_type value_type; |
typedef self_type const_closure_type; |
}; |
|
template <class E1, class E2, class F> struct vector_binary_scalar2_traits |
{ |
typedef vector_binary_scalar2 <E1, E2, F> result_type; |
}; |
|
template <class E1, class T2> |
typename vector_binary_scalar2_traits <E1, T2, scalar_multiplies <typename E1::value_type, T2> >::result_type |
operator * (vector_expression <E1>, T2) |
{ |
} |
|
template <class SC> struct vector_assign_traits |
{ |
typedef SC storage_category; |
}; |
|
template <template <class, class> class F, class V, class E> void |
indexing_vector_assign (V & v, vector_expression <E>) |
{ |
typedef F <typename V::reference, typename E::value_type> functor_type; |
typedef typename V::size_type size_type; |
size_type size (v.size ()); |
for (size_type i; i <size; ++i) |
functor_type::apply (v (i), (i)); |
} |
|
template <template <class, class> class F, class V, class E> void |
vector_assign (V & v, const vector_expression <E> &e, dense_proxy_tag) |
{ |
indexing_vector_assign <F> (v, e); |
} |
|
template <template <class, class> class F, class V, class E> void |
vector_assign (V & v, const vector_expression <E> &e) |
{ |
typedef typename vector_assign_traits <typename V::storage_category>::storage_category storage_category; |
vector_assign <F> (v, e, storage_category ()); |
} |
|
template <class T, class A> struct vector : public vector_container <vector <T> > |
{ |
typedef vector <T> self_type; |
typedef typename A::size_type size_type; |
typedef T value_type; |
typedef typename type_traits <T>::const_reference const_reference; |
typedef T &reference; |
typedef A array_type; |
typedef vector_reference <const self_type> const_closure_type; |
typedef dense_proxy_tag storage_category; |
vector (size_type size):vector_container <self_type> (), data_ (size) |
{ |
} |
vector (size_type size, value_type):vector_container <self_type> (), data_ (size) |
{ |
} |
template <class AE> vector (const vector_expression <AE> &ae) : vector_container <self_type> (), data_ (ae ().size ()) |
{ |
vector_assign <scalar_assign> (*this, ae); |
} |
size_type |
size () const |
{ |
return data_.size (); |
} |
array_type & |
data () |
{ |
return data_; |
} |
reference |
operator () (size_type i) |
{ |
return data ()[i]; |
} |
template <class AE> vector operator += (const vector_expression <AE> &ae) |
{ |
self_type temporary (*this + ae); |
data_.swap (temporary.data ()); |
return *this; |
} |
class const_iterator : public random_access_iterator_base <dense_proxy_tag> |
{ |
}; |
array_type data_; |
}; |
|
template <class T> struct scalar_vector : public vector_container <scalar_vector <> > |
{ |
typedef scalar_vector self_type; |
typedef __SIZE_TYPE__ size_type; |
typedef T value_type; |
typedef T const_reference; |
typedef vector_reference <self_type> const_closure_type; |
}; |
|
void |
bar (vector <double>) |
{ |
} |
|
void |
foo (int n_samp) |
{ |
vector <double> xi (n_samp, 0); |
for (int n = 0; n <n_samp; ++n) |
{ |
vector <double> cos_w_n (n_samp); |
xi += cos_w_n * 6.0; |
} |
vector <double> cos_wd (n_samp); |
xi += cos_wd; |
bar (xi + scalar_vector <> ()); |
} |
pr41305.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr43026.C
===================================================================
--- pr43026.C (nonexistent)
+++ pr43026.C (revision 338)
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+template class vector { };
+
+template class Tensor;
+
+template class Tensor<1,dim> {
+public:
+ Tensor (const Tensor<1,dim> &);
+private:
+ double values[(dim != 0) ? (dim) : 1];
+};
+
+template
+#ifdef NOINLINE
+// declaring this noinline prevents the ICE
+__attribute__ ((noinline))
+#endif
+Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
+{
+ for (unsigned int i = 0; i < dim; ++i)
+ values[i] = p.values[i];
+}
+
+template
+class Tensor {
+ Tensor subtensor[dim];
+};
+
+template class Base {
+public:
+ const unsigned int npoints;
+ const unsigned int dofs;
+ const Tensor<2,dim> &s2d (const unsigned int fno,
+ const unsigned int pno) const;
+ void getf2d (vector >& d2) const;
+};
+
+template
+void Base:: getf2d
+ (vector > &d2) const
+{
+ unsigned int point, sf;
+
+ for (point = 0; point < npoints; ++point)
+ for (sf = 0; sf < dofs; ++sf)
+ Tensor<2,dim> tmp = s2d (sf, point);
+}
+
+template void Base<3>::getf2d (vector > &) const;
pr43026.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr42930.C
===================================================================
--- pr42930.C (nonexistent)
+++ pr42930.C (revision 338)
@@ -0,0 +1,55 @@
+/* { dg-options "-O1 -floop-block" } */
+
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef unsigned char uint8;
+namespace Common {
+class NonCopyable {
+};
+template
+Out copy(In first, In last, Out dst) {
+ while (first != last)
+ *dst++ = *first++;
+}
+template
+class Array {
+ uint _size;
+ T *_storage;
+public:
+ Array& operator=(const Array &array) {
+ copy(array._storage, array._storage + _size, _storage);
+ }
+};
+}
+namespace Graphics {
+struct PixelFormat {
+ inline PixelFormat() {
+ }
+ inline PixelFormat(byte BytesPerPixel,
+ byte RBits, byte GBits, byte BBits, byte ABits,
+ byte RShift, byte GShift, byte BShift, byte AShift) {
+ }
+};
+};
+namespace Cine {
+static const Graphics::PixelFormat kLowPalFormat(2, 3, 3, 3, 0, 8, 4, 0, 0);
+class Palette {
+public:
+ struct Color {
+ uint8 r, g, b;
+ };
+ Palette(const Graphics::PixelFormat format = Graphics::PixelFormat(), const uint numColors = 0);
+ bool empty() const;
+ bool isValid() const;
+ Common::Array _colors;
+};
+class FWRenderer : public Common::NonCopyable {
+ Cine::Palette _activePal;
+ void drawCommand();
+};
+void FWRenderer::drawCommand() {
+ if (!_activePal.isValid() || _activePal.empty()) {
+ _activePal = Cine::Palette(kLowPalFormat, 16);
+ }
+}
+}
pr42930.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr42681.C
===================================================================
--- pr42681.C (nonexistent)
+++ pr42681.C (revision 338)
@@ -0,0 +1,17 @@
+/* { dg-options "-O1 -fgraphite-identity -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine" } */
+
+typedef __SIZE_TYPE__ size_t;
+inline void* operator new(size_t, void* __p) throw() { return __p; }
+
+struct A {
+ int i, j;
+ A() : i(0) {}
+};
+
+void Init(A *a)
+{
+ for (int i = 0; i < 20; i++) {
+ new (&a[i]) A;
+ a[i].j = 0;
+ }
+}
pr42681.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: id-1.C
===================================================================
--- id-1.C (nonexistent)
+++ id-1.C (revision 338)
@@ -0,0 +1,39 @@
+#include
+
+template class Tensor;
+template
+class Tensor<1,dim>
+{
+ public:
+ explicit Tensor (const bool initialize = true);
+ Tensor (const Tensor<1,dim> &);
+ double values[(dim!=0) ? (dim) : 1];
+};
+template
+Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
+{
+ for (unsigned int i=0; i
+class KellyErrorEstimator
+{
+ struct PerThreadData
+ {
+ std::vector > > > psi;
+ PerThreadData (const unsigned int n_solution_vectors,
+ const unsigned int n_components,
+ const unsigned int n_q_points);
+ };
+};
+template
+KellyErrorEstimator::PerThreadData::
+PerThreadData (const unsigned int n_solution_vectors,
+ const unsigned int n_components,
+ const unsigned int n_q_points)
+{
+ for (unsigned int i=0; i;
id-1.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr42130.C
===================================================================
--- pr42130.C (nonexistent)
+++ pr42130.C (revision 338)
@@ -0,0 +1,19 @@
+/* { dg-options "-O2 -fgraphite-identity -fno-tree-ch" } */
+#include
+
+using std::vector;
+
+vector & __attribute__((noinline, noclone)) foo(unsigned n)
+{
+ vector *vv = new vector(n, 0u);
+ return *vv;
+}
+
+int main()
+{
+ foo(0);
+ return 0;
+}
+
+/* { dg-do run } */
+
pr42130.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: pr39447.C
===================================================================
--- pr39447.C (nonexistent)
+++ pr39447.C (revision 338)
@@ -0,0 +1,34 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+struct Point
+{
+ int line, col;
+
+ Point( int l = -1, int c = 0 ) throw() : line( l ), col( c ) {}
+ bool operator==( const Point & p ) const throw()
+ { return ( line == p.line && col == p.col ); }
+ bool operator<( const Point & p ) const throw()
+ { return ( line < p.line || ( line == p.line && col < p.col ) ); }
+};
+
+class Buffer
+{
+public:
+ int characters( const int line ) const throw();
+ int pgetc( Point & p ) const throw();
+ Point eof() const throw() { return Point( 0, 0 ); }
+ bool pisvalid( const Point & p ) const throw()
+ { return ( ( p.col >= 0 && p.col < characters( p.line ) ) || p == eof() );
+ }
+ bool save( Point p1 = Point(), Point p2 = Point() ) const;
+};
+
+bool Buffer::save( Point p1, Point p2 ) const
+{
+ if( !this->pisvalid( p1 ) ) p1 = eof();
+ if( !this->pisvalid( p2 ) ) p2 = eof();
+ for( Point p = p1; p < p2; ) { pgetc( p ); }
+ return true;
+}
+
+
pr39447.C
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: graphite.exp
===================================================================
--- graphite.exp (nonexistent)
+++ graphite.exp (revision 338)
@@ -0,0 +1,71 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# .
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib g++-dg.exp
+
+if ![check_effective_target_fgraphite] {
+ return
+}
+
+# Remove VALUE from LIST_VARIABLE.
+proc lremove {list_variable value} {
+ upvar 1 $list_variable var
+ set idx [lsearch -exact $var $value]
+ set var [lreplace $var $idx $idx]
+}
+
+# The default action for a test is 'compile'. Save current default.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+# Initialize `dg'.
+dg-init
+
+set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.C ] ]
+set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.C ] ]
+set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.C ] ]
+set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.C ] ]
+set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.C ] ]
+set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.C ] ]
+
+# Tests to be compiled.
+set dg-do-what-default compile
+dg-runtest $scop_files "" "-O2 -fgraphite -fdump-tree-graphite-all"
+dg-runtest $id_files "" "-O2 -fgraphite-identity -ffast-math"
+
+# Tests to be run.
+set dg-do-what-default run
+dg-runtest $run_id_files "" "-O2 -fgraphite-identity"
+dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
+dg-runtest $block_files "" "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
+
+# The default action for the rest of the files is 'compile'.
+set dg-do-what-default compile
+foreach f $scop_files {lremove wait_to_run_files $f}
+foreach f $id_files {lremove wait_to_run_files $f}
+foreach f $run_id_files {lremove wait_to_run_files $f}
+foreach f $interchange_files {lremove wait_to_run_files $f}
+foreach f $block_files {lremove wait_to_run_files $f}
+dg-runtest $wait_to_run_files "" "-ansi -pedantic-errors"
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish