| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-gimple" } */ |
| 3 |
|
| 4 |
/* Check that no host-to-device pointer conversion happens for a nullptr |
| 5 |
argument. */ |
| 6 |
|
| 7 |
#include <cstddef> |
| 8 |
|
| 9 |
int variant_fn(int *, int * = NULL); |
| 10 |
|
| 11 |
#pragma omp declare variant(variant_fn) match(construct={dispatch}) adjust_args(need_device_ptr : x, y) |
| 12 |
int bar(int *x, int *y = NULL); |
| 13 |
|
| 14 |
void sub(int *a, int *b) |
| 15 |
{ |
| 16 |
int x; |
| 17 |
#pragma omp dispatch |
| 18 |
x = bar(a); |
| 19 |
} |
| 20 |
|
| 21 |
/* { dg-final { scan-tree-dump-times "__builtin_omp_get_mapped_ptr" 1 "gimple" } } */ |
| 22 |
/* { dg-final { scan-tree-dump-not "__builtin_omp_get_mapped_ptr \\(OB" "gimple" } } */ |