summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr27291.C
blob: b8b5e136a4645c5a1fdc111fdb56d8b1a3913942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
/* { dg-do compile } */
/* { dg-options "-O2" } */

namespace std
{
  template < class _T1, class _T2 > struct pair
  {
  };
}
extern "C"
{
  extern "C"
  {
    typedef int int32_t __attribute__ ((__mode__ (__SI__)));
    struct _pthread_fastlock
    {
    }
    pthread_mutexattr_t;
  }
}
namespace std
{
  struct __numeric_limits_base
  {
  };
    template < typename _Tp >
    struct numeric_limits:public __numeric_limits_base
  {
    static const bool is_integer = true;
  };
};
typedef unsigned int uint32_t;
namespace std
{
  template < typename _Alloc > class allocator;
  template < class _CharT > struct char_traits;
    template < typename _CharT, typename _Traits =
    char_traits < _CharT >, typename _Alloc =
    allocator < _CharT > >class basic_string;
  typedef basic_string < char >string;
}
namespace __gnu_cxx
{
  template < typename _Tp > class new_allocator
  {
  };
}
namespace std
{
  template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
    _Tp >
  {
  };
  template < typename _CharT, typename _Traits,
    typename _Alloc > class basic_string
  {
  public:inline basic_string ();
    basic_string (const _CharT * __s, const _Alloc & __a = _Alloc ());
  };
}
namespace boost
{
  template < class T > class integer_traits:public std::numeric_limits < T >
  {
  };
  namespace detail
  {
    template < class T, T min_val, T max_val > class integer_traits_base
    {
    };
  }
  template <> class integer_traits < int >:public std::numeric_limits < int >,
    public detail::integer_traits_base < int, (-2147483647 - 1), 2147483647 >
  {
  };
  namespace random
  {
    template < class IntType, IntType m > class const_mod
    {
    public:static IntType add (IntType x, IntType c)
      {
      }
      static IntType mult (IntType a, IntType x)
      {
	return mult_schrage (a, x);
      }
      static IntType mult_add (IntType a, IntType x, IntType c)
      {
	return add (mult (a, x), c);
      }
      static IntType mult_schrage (IntType a, IntType value)
      {
	for (;;)
	  {
	    if (value > 0)
	      break;
	    value += m;
	  }
      }
    };
    template < class IntType, IntType a, IntType c, IntType m,
      IntType val > class linear_congruential
    {
    public:typedef IntType result_type;
      static const IntType modulus = m;
    explicit linear_congruential (IntType x0 = 1):_modulus (modulus),
	_x (_modulus ? (x0 % _modulus) :
	    x0)
      {
      }
      IntType operator    () ()
      {
	_x = const_mod < IntType, m >::mult_add (a, _x, c);
      }
    private:IntType _modulus;
      IntType _x;
    };
  }
  typedef random::linear_congruential < int32_t, 16807, 0, 2147483647,
    1043618065 > minstd_rand0;
  namespace random
  {
    namespace detail
    {
      template < class T > struct ptr_helper
      {
	typedef T value_type;
	typedef T & reference_type;
	typedef const T & rvalue_type;
	static reference_type ref (T & r)
	{
	}
      };
        template < class T > struct ptr_helper <T & >
      {
	typedef T value_type;
	typedef T & rvalue_type;
      };
    }
  }
  template < class UniformRandomNumberGenerator, class RealType =
    double >class uniform_01
  {
  public:typedef UniformRandomNumberGenerator base_type;
    typedef RealType result_type;
    explicit uniform_01 (base_type rng):_rng (rng),
      _factor (result_type (1) /
	       (result_type ((_rng.max) () - (_rng.min) ()) +
		result_type (std::numeric_limits <
			     base_result >::is_integer ? 1 : 0)))
    {
    }
    result_type operator    () ()
    {
      return result_type (_rng () - (_rng.min) ()) * _factor;
    }
  private:typedef typename base_type::result_type base_result;
    base_type _rng;
    result_type _factor;
  };
  namespace random
  {
    namespace detail
    {
      template < class UniformRandomNumberGenerator >
	class pass_through_engine
      {
      private:typedef ptr_helper < UniformRandomNumberGenerator >
	  helper_type;
      public:typedef typename helper_type::value_type base_type;
	typedef typename base_type::result_type result_type;
	explicit pass_through_engine (UniformRandomNumberGenerator
				      rng):_rng (static_cast <
						 typename helper_type::
						 rvalue_type > (rng))
	{
	}
	result_type min () const
	{
	}
	result_type max () const
	{
	}
	base_type & base ()
	{
	}
	result_type operator    () ()
	{
	  return base ()();
	}
      private:UniformRandomNumberGenerator _rng;
      };
    }
    template < class RealType, int w, unsigned int p,
      unsigned int q > class lagged_fibonacci_01
    {
    public:typedef RealType result_type;
      static const unsigned int long_lag = p;
        lagged_fibonacci_01 ()
      {
	seed ();
      }
    public:void seed (uint32_t value = 331u)
      {
	minstd_rand0 intgen (value);
	seed (intgen);
      }
      template < class Generator > void seed (Generator & gen)
      {
	typedef detail::pass_through_engine < Generator & >ref_gen;
	uniform_01 < ref_gen, RealType > gen01 =
	  uniform_01 < ref_gen, RealType > (ref_gen (gen));
	for (unsigned int j = 0; j < long_lag; ++j)
	  x[j] = gen01 ();
      }
      RealType x[long_lag];
    };
  }
  typedef random::lagged_fibonacci_01 < double, 48, 607,
    273 > lagged_fibonacci607;
  namespace random
  {
    namespace detail
    {
      template < bool have_int, bool want_int > struct engine_helper;
        template <> struct engine_helper <true, true >
      {
	template < class Engine, class DistInputType > struct impl
	{
	  typedef pass_through_engine < Engine > type;
	};
      };
    }
  }
  template < class Engine, class Distribution > class variate_generator
  {
  private:typedef random::detail::pass_through_engine < Engine >
      decorated_engine;
  public:typedef typename decorated_engine::base_type engine_value_type;
    typedef Distribution distribution_type;
  variate_generator (Engine e, Distribution d):_eng (decorated_engine (e)),
      _dist (d)
    {
    }
  private:enum
    {
      have_int =
	std::numeric_limits <
	typename decorated_engine::result_type >::is_integer, want_int =
	std::numeric_limits < typename Distribution::input_type >::is_integer
    };
    typedef typename random::detail::engine_helper < have_int,
      want_int >::template impl < decorated_engine,
      typename Distribution::input_type >::type internal_engine_type;
    internal_engine_type _eng;
    distribution_type _dist;
  };
  template < class RealType = double >class uniform_real
  {
  public:typedef RealType input_type;
  };
}
namespace alps
{
  class BufferedRandomNumberGeneratorBase
  {
  };
    template < class RNG >
    class BufferedRandomNumberGenerator:public
    BufferedRandomNumberGeneratorBase
  {
  public: BufferedRandomNumberGenerator ():rng_ (), gen_ (rng_,
		   boost::
		   uniform_real <> ())
    {
    }
  protected:  RNG rng_;
    boost::variate_generator < RNG &, boost::uniform_real <> >gen_;
  };
}
namespace boost
{
  namespace detail
  {
    class sp_counted_base
    {
    };
    class shared_count
    {
    private:sp_counted_base * pi_;
    public:shared_count ():pi_ (0)
      {
      }
      template < class Y > explicit shared_count (Y * p):pi_ (0)
      {
      }
    };
  }
  template < class T > class shared_ptr
  {
  public:typedef T element_type;
  template < class Y > explicit shared_ptr (Y * p):px (p), pn (p)
    {
    }
    T *px;
    detail::shared_count pn;
  };
}
namespace std
{
  template < typename _Key, typename _Tp, typename _Compare =
    std::allocator < std::pair < const _Key, _Tp > > > class map
  {
  public:typedef _Key key_type;
    typedef _Tp mapped_type;
      mapped_type & operator[] (const key_type & __k)
    {
    }
  };
}
namespace alps
{
  namespace detail
  {
    template < class BASE > class abstract_creator
    {
    public:typedef BASE base_type;
      virtual base_type *create () const = 0;
    };
      template < class BASE,
      class T > class creator:public abstract_creator < BASE >
    {
    public:typedef BASE base_type;
      base_type *create () const
      {
	return new T ();
      }
    };
  }
  template < class KEY, class BASE > class factory
  {
  public:typedef BASE base_type;
    typedef KEY key_type;
    typedef boost::shared_ptr < detail::abstract_creator < base_type >
      >pointer_type;
    template < class T > bool register_type (key_type k)
    {
      creators_[k] = pointer_type (new detail::creator < BASE, T > ());
    }
  private:typedef std::map < key_type, pointer_type > map_type;
    map_type creators_;
  };
  class RNGFactory:public factory < std::string,
    BufferedRandomNumberGeneratorBase >
  {
  public:RNGFactory ();
  };
}
alps::RNGFactory::RNGFactory ()
{
  register_type < BufferedRandomNumberGenerator < boost::lagged_fibonacci607 >
    >("lagged_fibonacci607");
}