1 // RUN: %libomp-compile-and-run
3 // Linking fails for icc 18/19
4 // UNSUPPORTED: icc-18, icc-19
7 #include "omp_testsuite.h"
9 int test_omp_pause_resource() {
10 int fails
, nthreads
, my_dev
;
14 my_dev
= omp_get_initial_device();
18 nthreads
= omp_get_num_threads();
20 if (omp_pause_resource(omp_pause_soft
, my_dev
))
23 #pragma omp parallel shared(nthreads)
25 nthreads
= omp_get_num_threads();
29 if (omp_pause_resource(omp_pause_hard
, my_dev
))
33 #pragma omp parallel shared(nthreads)
35 nthreads
= omp_get_num_threads();
39 if (omp_pause_resource_all(omp_pause_soft
))
43 #pragma omp parallel shared(nthreads)
45 nthreads
= omp_get_num_threads();
56 for (i
= 0; i
< REPETITIONS
; i
++) {
57 if (!test_omp_pause_resource()) {