Debian Codegraph @

gcc/testsuite/g++.dg/vect/vect-early-break_1.cc

raw
1 /* { dg-do compile } */
2 /* { dg-add-options vect_early_break } */
3 /* { dg-require-effective-target vect_early_break } */
4 /* { dg-require-effective-target vect_int } */
5
6
7 /* { dg-additional-options "-w -O2" } */
8
9 void fancy_abort(char *, int, const char *) __attribute__((__noreturn__));
10 template <unsigned N, typename> struct poly_int_pod { int coeffs[N]; };
11 template <unsigned N, typename> class poly_int : public poly_int_pod<N, int> {
12 public:
13 template <typename Ca> poly_int &operator+=(const poly_int_pod<N, Ca> &);
14 };
15 template <unsigned N, typename C>
16 template <typename Ca>
17 poly_int<N, C> &poly_int<N, C>::operator+=(const poly_int_pod<N, Ca> &a) {
18 for (int i = 0; i < N; i++)
19 this->coeffs[i] += a.coeffs[i];
20 return *this;
21 }
22 template <unsigned N, typename Ca, typename Cb>
23 poly_int<N, long> exact_div(poly_int_pod<N, Ca>, Cb) {
24 poly_int<N, long> r;
25 return r;
26 }
27 struct vec_prefix {
28 unsigned m_num;
29 };
30 struct vl_ptr;
31 struct va_heap {
32 typedef vl_ptr default_layout;
33 };
34 template <typename, typename A, typename = typename A::default_layout>
35 struct vec;
36 template <typename T, typename A> struct vec<T, A, int> {
37 T &operator[](unsigned);
38 vec_prefix m_vecpfx;
39 T m_vecdata[];
40 };
41 template <typename T, typename A> T &vec<T, A, int>::operator[](unsigned ix) {
42 m_vecpfx.m_num ? fancy_abort("", 9, __FUNCTION__), 0 : 0;
43 return m_vecdata[ix];
44 }
45 template <typename T> struct vec<T, va_heap> {
46 T &operator[](unsigned ix) { return m_vec[ix]; }
47 vec<T, va_heap, int> m_vec;
48 };
49 class auto_vec : public vec<poly_int<2, long>, va_heap> {};
50 template <typename> class vector_builder : public auto_vec {};
51 class int_vector_builder : public vector_builder<int> {
52 public:
53 int_vector_builder(poly_int<2, long>, int, int);
54 };
55 bool vect_grouped_store_supported() {
56 int i;
57 poly_int<2, long> nelt;
58 int_vector_builder sel(nelt, 2, 3);
59 for (i = 0; i < 6; i++)
60 sel[i] += exact_div(nelt, 2);
61 }
62