| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=rv64imafdc_zba_zbb_zbs_zicbom_zicbop -mabi=lp64d" } */ |
| 3 |
|
| 4 |
/* Reduced from libsanitizer::asan_allocator. */ |
| 5 |
|
| 6 |
enum a { c }; |
| 7 |
class d; |
| 8 |
struct e { |
| 9 |
long count; |
| 10 |
void *batch[]; |
| 11 |
}; |
| 12 |
template <typename> class f { |
| 13 |
public: |
| 14 |
void g() { |
| 15 |
if (e *b = h->i()) |
| 16 |
for (; b->count;) |
| 17 |
if (6 < b->count) |
| 18 |
__builtin_prefetch(b->batch[6]); |
| 19 |
} |
| 20 |
d *h; |
| 21 |
}; |
| 22 |
class d { |
| 23 |
public: |
| 24 |
e *i(); |
| 25 |
}; |
| 26 |
struct j { |
| 27 |
f<int> k; |
| 28 |
j(a); |
| 29 |
void l() { k.g(); } |
| 30 |
} a(c); |
| 31 |
void m() { a.l(); } |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler-times "prefetch.r\t0\\(\[a-x0-9\]+\\)" 1 } } */ |