| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-gimple" } */ |
| 3 |
|
| 4 |
extern int foo_p (int); |
| 5 |
extern int bar; |
| 6 |
extern int omp_get_default_device (void); |
| 7 |
|
| 8 |
int f01 (int); |
| 9 |
int f02 (int); |
| 10 |
int f03 (int); |
| 11 |
int f04 (int); |
| 12 |
#pragma omp declare variant (f01) match (target_device={device_num(omp_get_default_device()), isa("avx512f")}) /* 4 */ |
| 13 |
#pragma omp declare variant (f02) match (user={condition(score(6):0)}) |
| 14 |
#pragma omp declare variant (f03) match (user={condition(score(5):foo_p (bar))}) |
| 15 |
#pragma omp declare variant (f04) match (user={condition(score(3):0)}) |
| 16 |
int f05 (int); |
| 17 |
|
| 18 |
int |
| 19 |
test1 (int x) |
| 20 |
{ |
| 21 |
return f05 (x); |
| 22 |
} |
| 23 |
|
| 24 |
/* f01 and f03 are the dynamic selectors, the fall-through is f05. |
| 25 |
f02 and f04 are static selectors and do not match. */ |
| 26 |
/* { dg-final { scan-tree-dump "f01 \\\(x" "gimple" } } */ |
| 27 |
/* { dg-final { scan-tree-dump "f03 \\\(x" "gimple" } } */ |
| 28 |
/* { dg-final { scan-tree-dump "f05 \\\(x" "gimple" } } */ |
| 29 |
/* { dg-final { scan-tree-dump-not "f02 \\\(x" "gimple" } } */ |
| 30 |
/* { dg-final { scan-tree-dump-not "f04 \\\(x" "gimple" } } */ |