| 1 |
/* PR target/97682 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-fPIC -O2 -march=rv64g -mabi=lp64" } */ |
| 4 |
|
| 5 |
template <typename ab, int ac> struct g { ab b[ac]; }; |
| 6 |
long i, m; |
| 7 |
|
| 8 |
namespace std |
| 9 |
{ |
| 10 |
template <typename c> struct t |
| 11 |
{ |
| 12 |
int a; |
| 13 |
c h; |
| 14 |
}; |
| 15 |
|
| 16 |
struct ad |
| 17 |
{ |
| 18 |
enum { j }; |
| 19 |
}; |
| 20 |
|
| 21 |
template <typename k> k l(k); |
| 22 |
struct al {}; |
| 23 |
template <typename k> k aa(k); |
| 24 |
|
| 25 |
struct v |
| 26 |
{ |
| 27 |
template <typename n, typename q> static q o(n, n, q); |
| 28 |
}; |
| 29 |
|
| 30 |
template <int, typename n, typename q> void p(n z, n ao, q ap) |
| 31 |
{ |
| 32 |
v::o(z, ao, ap); |
| 33 |
} |
| 34 |
|
| 35 |
template <int ae, typename n, typename q> void r(n z, n ao, q ap) |
| 36 |
{ |
| 37 |
p<ae>(z, ao, ap); |
| 38 |
} |
| 39 |
|
| 40 |
template <int ae, typename n, typename q> void af(n z, n ao, q) |
| 41 |
{ |
| 42 |
r<ae>(aa(z), aa(ao), 0); |
| 43 |
} |
| 44 |
|
| 45 |
template <typename n, typename q> void ag(n z, n ao, q ap) |
| 46 |
{ |
| 47 |
af<ad::j>(l(z), l(ao), ap); |
| 48 |
} |
| 49 |
|
| 50 |
template <typename> class allocator; |
| 51 |
template <typename ah, typename ai, typename aj> void ak(ah, ai, aj); |
| 52 |
|
| 53 |
template <typename s> class aq |
| 54 |
{ |
| 55 |
template <typename am> struct ar { using f = am *; }; |
| 56 |
public: |
| 57 |
using an = typename ar<s>::f; |
| 58 |
}; |
| 59 |
|
| 60 |
template <typename s> class as |
| 61 |
{ |
| 62 |
public: |
| 63 |
using an = typename aq<s>::an; |
| 64 |
an operator->(); |
| 65 |
}; |
| 66 |
|
| 67 |
struct ay |
| 68 |
{ |
| 69 |
int at(); |
| 70 |
}; |
| 71 |
|
| 72 |
template <typename s, typename = allocator<s>> class vector : ay |
| 73 |
{ |
| 74 |
public: |
| 75 |
long au(); |
| 76 |
long x; |
| 77 |
void av() { _M_default_append(x); } |
| 78 |
void _M_default_append(unsigned long); |
| 79 |
void aw(); |
| 80 |
long ax(int); |
| 81 |
}; |
| 82 |
|
| 83 |
template <typename s, typename y> |
| 84 |
void vector<s, y>::_M_default_append(unsigned long z) |
| 85 |
{ |
| 86 |
long az = au(); |
| 87 |
int w = at(), bc = at(); |
| 88 |
i = ax(w); |
| 89 |
m = ax(w); |
| 90 |
if (i || m) |
| 91 |
aw(); |
| 92 |
ak(az, z, bc); |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
namespace llvm |
| 97 |
{ |
| 98 |
template <int bd> class bh |
| 99 |
{ |
| 100 |
enum { bf = bd } * bg[bf]; |
| 101 |
}; |
| 102 |
|
| 103 |
template <class> class bi; |
| 104 |
|
| 105 |
class bm |
| 106 |
{ |
| 107 |
using bj = bi<int>; |
| 108 |
std::as<bj> bk; |
| 109 |
void bl(); |
| 110 |
}; |
| 111 |
|
| 112 |
template <class> struct bn; |
| 113 |
|
| 114 |
class br |
| 115 |
{ |
| 116 |
bh<8> bo; |
| 117 |
}; |
| 118 |
|
| 119 |
class ca |
| 120 |
{ |
| 121 |
int *d; |
| 122 |
int e; |
| 123 |
}; |
| 124 |
|
| 125 |
template <class bp> class bv : std::al, br |
| 126 |
{ |
| 127 |
g<std::t<ca>, 8> b; |
| 128 |
}; |
| 129 |
|
| 130 |
template <class ab> bv<ab> bt(ab); |
| 131 |
|
| 132 |
class BlockFrequencyInfoImplBase |
| 133 |
{ |
| 134 |
public: |
| 135 |
struct FrequencyData; |
| 136 |
std::vector<FrequencyData> bu; |
| 137 |
}; |
| 138 |
|
| 139 |
template <class> struct cb { using bw = int; }; |
| 140 |
template <class bx> class bi : BlockFrequencyInfoImplBase |
| 141 |
{ |
| 142 |
using bw = typename cb<bx>::bw; |
| 143 |
public: |
| 144 |
void bl(); |
| 145 |
}; |
| 146 |
|
| 147 |
template <class bx> void bi<bx>::bl() |
| 148 |
{ |
| 149 |
const bw *by; |
| 150 |
bv<const int *> bz; |
| 151 |
ag(bz, bt(by), 0); |
| 152 |
bu.av(); |
| 153 |
} |
| 154 |
|
| 155 |
template <> struct bn<const int *> { using u = ca; }; |
| 156 |
void bm::bl() { bk->bl(); } |
| 157 |
} |
| 158 |
|
| 159 |
/* The t1 register is to initial symbol reference for call instruction. */ |
| 160 |
/* { dg-final { scan-assembler "la\tt1,.*FrequencyData.*_M_default_append.*" } } */ |