OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [graphite/] [pr41305.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-O3 -floop-interchange -Wno-conversion-null" }
3
 
4
void __throw_bad_alloc ();
5
 
6
template  void
7
swap (_Tp & __a, _Tp __b)
8
{
9
  __a = __b;
10
}
11
 
12
template  struct iterator
13
{
14
  typedef _Category iterator_category;
15
};
16
 
17
template  struct allocator
18
{
19
  typedef __SIZE_TYPE__ size_type;
20
  typedef _Tp pointer;
21
  pointer allocate (size_type)
22
  {
23
    __throw_bad_alloc ();
24
    return __null;
25
  }
26
};
27
 
28
template  >class unbounded_array;
29
template  >class vector;
30
template  class scalar_vector;
31
template  struct random_access_iterator_base : public iterator 
32
{
33
};
34
 
35
template  struct promote_traits
36
{
37
  typedef __typeof__ ((X ())) promote_type;
38
};
39
 
40
template  struct scalar_traits
41
{
42
  typedef T const_reference;
43
  typedef T reference;
44
};
45
 
46
template  struct type_traits : scalar_traits 
47
{
48
};
49
 
50
struct dense_proxy_tag
51
{
52
};
53
 
54
template  struct iterator_base_traits;
55
 
56
template <> struct iterator_base_traits 
57
{
58
  template  struct iterator_base
59
  {
60
    typedef random_access_iterator_base  type;
61
  };
62
};
63
 
64
template  struct iterator_restrict_traits
65
{
66
  typedef I1 iterator_category;
67
};
68
 
69
template  class storage_array
70
{
71
};
72
 
73
template  struct unbounded_array : public storage_array  >
74
{
75
  typedef typename ALLOC::size_type size_type;
76
  typedef T & reference;
77
  typedef T *pointer;
78
  unbounded_array (size_type size, ALLOC = ALLOC ()) : alloc_ (), size_ (size)
79
  {
80
    alloc_.allocate (size_);
81
  }
82
  ~unbounded_array ()
83
  {
84
    if (size_)
85
      for (;;);
86
  }
87
  size_type
88
  size () const
89
  {
90
    return size_;
91
  }
92
  reference
93
  operator[] (size_type i)
94
  {
95
    return data_[i];
96
  }
97
  void
98
  swap (unbounded_array & a)
99
  {
100
    ::swap (size_, a.size_);
101
  }
102
  ALLOC alloc_;
103
  size_type size_;
104
  pointer data_;
105
};
106
 
107
template  struct scalar_binary_functor
108
{
109
  typedef typename promote_traits ::promote_type result_type;
110
};
111
 
112
template  struct scalar_plus : public scalar_binary_functor 
113
{
114
};
115
 
116
template  struct scalar_multiplies : public scalar_binary_functor 
117
{
118
};
119
 
120
template  struct scalar_binary_assign_functor
121
{
122
  typedef typename type_traits ::reference argument1_type;
123
  typedef typename type_traits ::const_reference argument2_type;
124
};
125
 
126
template  struct scalar_assign : public scalar_binary_assign_functor 
127
{
128
  typedef typename scalar_binary_assign_functor ::argument1_type argument1_type;
129
  typedef typename scalar_binary_assign_functor ::argument2_type argument2_type;
130
  static const bool computed = false;
131
  static void
132
  apply (argument1_type t1, argument2_type t2)
133
  {
134
    t1 = t2;
135
  }
136
};
137
 
138
template  struct vector_expression
139
{
140
  typedef E expression_type;
141
  const expression_type &
142
  operator () () const
143
  {
144
    return *static_cast (this);
145
  }
146
};
147
 
148
template  class vector_container : public vector_expression 
149
{
150
};
151
 
152
template  struct vector_reference : public vector_expression  >
153
{
154
  typedef typename E::size_type size_type;
155
  typename E::const_reference const_reference;
156
  typedef E referred_type;
157
  vector_reference (referred_type & e) : e_ (e)
158
  {
159
  }
160
  size_type
161
  size () const
162
  {
163
    return expression ().size ();
164
  }
165
  referred_type &
166
  expression () const
167
  {
168
    return e_;
169
  }
170
  referred_type &e_;
171
};
172
 
173
template  struct vector_binary : public vector_expression  >
174
{
175
  typedef E1 expression1_type;
176
  typedef E2 expression2_type;
177
  typedef typename E1::const_closure_type expression1_closure_type;
178
  typedef typename E2::const_closure_type expression2_closure_type;
179
  typedef typename promote_traits ::promote_type size_type;
180
  typedef typename F::result_type value_type;
181
 
182
  vector_binary (const expression1_type & e1, expression2_type e2) : e1_ (e1), e2_ (e2)
183
  {
184
  }
185
 
186
  size_type
187
  size () const
188
  {
189
    return e1_.size ();
190
  }
191
 
192
  class const_iterator : public iterator_base_traits ::iterator_category>::template iterator_base ::type
193
  {
194
  };
195
  expression1_closure_type e1_;
196
  expression2_closure_type e2_;
197
};
198
 
199
template  struct vector_binary_traits
200
{
201
  typedef vector_binary  expression_type;
202
  typedef expression_type result_type;
203
};
204
 
205
template  typename vector_binary_traits  >::result_type
206
operator + (vector_expression  &e1, const vector_expression  &e2)
207
{
208
  typedef typename vector_binary_traits  >::expression_type expression_type;
209
  return expression_type (e1 (), e2 ());
210
}
211
 
212
template  struct vector_binary_scalar2 : public vector_expression  >
213
{
214
  typedef vector_binary_scalar2  self_type;
215
  typedef typename E1::size_type size_type;
216
  typedef typename F::result_type value_type;
217
  typedef self_type const_closure_type;
218
};
219
 
220
template  struct vector_binary_scalar2_traits
221
{
222
  typedef vector_binary_scalar2  result_type;
223
};
224
 
225
template 
226
typename vector_binary_scalar2_traits  >::result_type
227
operator * (vector_expression , T2)
228
{
229
}
230
 
231
template  struct vector_assign_traits
232
{
233
  typedef SC storage_category;
234
};
235
 
236
template