1 // RUN: %libomptarget-compile-generic -fopenmp-version=51
2 // RUN: %libomptarget-run-generic | %fcheck-generic
3 // RUN: %libomptarget-compileopt-generic -fopenmp-version=51
4 // RUN: %libomptarget-run-generic | %fcheck-generic
8 int square(int x
) { return x
* x
; }
9 #pragma omp declare target indirect to(square)
11 typedef int (*fp_t
)(int);
17 // CHECK: host: &square =
18 printf("host: &square = %p\n", fp
);
20 #pragma omp target map(from : fp)
22 // CHECK: device: &square = [[DEV_FP:.*]]
23 printf("device: &square = %p\n", fp
);
27 #pragma omp target map(from : fp2)
29 // CHECK: device: fp2 = [[DEV_FP]]
30 printf("device: fp2 = %p\n", fp2
);
32 #pragma omp target map(from : r)
36 printf("%i*%i = %i\n", i
, i
, r
);