| 1 |
/* { dg-options "-fopenmp -O2" } */ |
| 2 |
/* { dg-additional-options "-fopenmp-target-simd-clone=any -fdump-ipa-simdclone-details" } */ |
| 3 |
|
| 4 |
/* Test that simd clones are not generated for functions with |
| 5 |
"declare target" but unsuitable arguments. */ |
| 6 |
|
| 7 |
struct s { |
| 8 |
int a; |
| 9 |
int b; |
| 10 |
}; |
| 11 |
|
| 12 |
#pragma omp declare target |
| 13 |
__attribute__ ((__noinline__)) int addit (struct s x) |
| 14 |
{ |
| 15 |
return x.a + x.b; |
| 16 |
} |
| 17 |
#pragma omp end declare target |
| 18 |
|
| 19 |
void callit (struct s *ss, int *c) |
| 20 |
{ |
| 21 |
int i; |
| 22 |
#pragma omp for simd |
| 23 |
for (i = 0; i < 16; i++) |
| 24 |
c[i] = addit (ss[i]); |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-ipa-dump "argument type fails sniff test" "simdclone" { target x86_64-*-* } } } */ |
| 28 |
/* { dg-final { scan-ipa-dump-not "Generated .* clone" "simdclone" { target x86_64-*-* } } } */ |