| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target vect_simd_clones } */ |
| 3 |
|
| 4 |
int __attribute__ ((__simd__, const)) fn (int); |
| 5 |
|
| 6 |
void test (int * __restrict__ a, int * __restrict__ b, int n) |
| 7 |
{ |
| 8 |
for (int i = 0; i < n; ++i) |
| 9 |
{ |
| 10 |
int a_; |
| 11 |
if (b[i] > 0) |
| 12 |
a_ = fn (b[i]); |
| 13 |
else |
| 14 |
a_ = b[i] + 5; |
| 15 |
a[i] = a_; |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
/* { dg-final { scan-tree-dump-not {loop contains function calls or data references} "vect" } } */ |
| 20 |
|
| 21 |
/* The LTO test produces two dump files and we scan the wrong one. */ |
| 22 |
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ |