1*330d8983SJohannes Doerfert // clang-format off 2*330d8983SJohannes Doerfert // RUN: %clang-generic -fPIC -shared %S/../Inputs/declare_indirect_func.c -o %T/libslfm.so -fopenmp-version=51 3*330d8983SJohannes Doerfert // RUN: %libomptarget-compile-generic -rpath %T -L %T -l slfm -o %t -fopenmp-version=51 4*330d8983SJohannes Doerfert // RUN: env LIBOMPTARGET_INFO=32 %t 2>&1 | %fcheck-generic 5*330d8983SJohannes Doerfert // clang-format on 6*330d8983SJohannes Doerfert 7*330d8983SJohannes Doerfert #include <stdio.h> 8*330d8983SJohannes Doerfert 9*330d8983SJohannes Doerfert extern int func(); // Provided in liba.so, returns 42 10*330d8983SJohannes Doerfert typedef int (*fp_t)(); 11*330d8983SJohannes Doerfert main()12*330d8983SJohannes Doerfertint main() { 13*330d8983SJohannes Doerfert int x = 0; 14*330d8983SJohannes Doerfert fp_t fp = &func; 15*330d8983SJohannes Doerfert printf("TARGET\n"); 16*330d8983SJohannes Doerfert #pragma omp target map(from : x) 17*330d8983SJohannes Doerfert x = fp(); 18*330d8983SJohannes Doerfert // CHECK: Copying data from device to host, {{.*}} Size=8 19*330d8983SJohannes Doerfert // CHECK: Copying data from device to host, {{.*}} Size=4 20*330d8983SJohannes Doerfert // CHECK: 42 21*330d8983SJohannes Doerfert printf("%i\n", x); 22*330d8983SJohannes Doerfert } 23