Revert "[InstCombine] Support gep nuw in icmp folds" (#118698)
[llvm-project.git] / openmp / runtime / test / ompt / misc / pause_stop_tool.c
blobc93913793244582fbd0d6fe643f7381ee1f455da
1 // RUN: %libomp-compile-and-run | FileCheck %s
2 // REQUIRES: ompt
3 #include "callback.h"
4 #include <omp.h>
5 int main() {
6 int x = 0;
7 int ret = 0;
8 #pragma omp parallel
9 #pragma omp single
10 x++;
11 // Expected to fail; omp_pause_stop_tool must not be specified
12 ret = omp_pause_resource(omp_pause_stop_tool, omp_get_initial_device());
13 printf("omp_pause_resource %s\n", ret ? "failed" : "succeeded");
14 #pragma omp parallel
15 #pragma omp single
16 x++;
17 // Expected to succeed
18 ret = omp_pause_resource_all(omp_pause_stop_tool);
19 printf("omp_pause_resource_all %s\n", ret ? "failed" : "succeeded");
20 #pragma omp parallel
21 #pragma omp single
22 x++;
23 printf("x = %d\n", x);
24 return 0;
26 // Check if
27 // -- omp_pause_resource/resource_all returns expected code
28 // -- OMPT interface is shut down as expected
30 // CHECK-NOT: {{^}}0: Could not register callback
31 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
33 // CHECK: ompt_event_parallel_begin
34 // CHECK: ompt_event_parallel_end
36 // CHECK: omp_pause_resource failed
38 // CHECK: ompt_event_parallel_begin
39 // CHECK: ompt_event_parallel_end
41 // CHECK: omp_pause_resource_all succeeded
43 // CHECK-NOT: ompt_event