xref: /llvm-project/offload/test/offloading/lone_target_exit_data.c (revision 330d8983d25d08580fc1642fea48b2473f47a9da)
1*330d8983SJohannes Doerfert // Check that a target exit data directive behaves correctly when the runtime
2*330d8983SJohannes Doerfert // has not yet been initialized.
3*330d8983SJohannes Doerfert 
4*330d8983SJohannes Doerfert // RUN: %libomptarget-compile-run-and-check-generic
5*330d8983SJohannes Doerfert 
6*330d8983SJohannes Doerfert #include <stdio.h>
7*330d8983SJohannes Doerfert 
main()8*330d8983SJohannes Doerfert int main() {
9*330d8983SJohannes Doerfert   // CHECK: x = 98
10*330d8983SJohannes Doerfert   int x = 98;
11*330d8983SJohannes Doerfert #pragma omp target exit data map(from : x)
12*330d8983SJohannes Doerfert   printf("x = %d\n", x);
13*330d8983SJohannes Doerfert   return 0;
14*330d8983SJohannes Doerfert }
15