1 // RUN: %libomp-compile && env OMP_CANCELLATION=true %libomp-run | %sort-threads | FileCheck %s
3 // Current GOMP interface implementation does not support cancellation; icc 16 does not distinguish between sections and loops
12 #pragma omp parallel num_threads(2)
17 for(i
= 0; i
< 2; i
++)
22 OMPT_SIGNAL(condition
);
23 #pragma omp cancel for
28 OMPT_WAIT(condition
,1);
30 #pragma omp cancellation point for
34 #pragma omp parallel num_threads(2)
40 OMPT_SIGNAL(condition
);
41 #pragma omp cancel sections
45 OMPT_WAIT(condition
,2);
47 #pragma omp cancellation point sections
53 // Check if libomp supports the callbacks for this test.
54 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
55 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel'
57 // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
58 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_initial_task_begin: parallel_id={{[0-9]+}}, task_id={{[0-9]+}}, actual_parallelism=1, index=1, flags=1
60 // cancel for and sections
61 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_loop|ompt_cancel_activated=20, codeptr_ra={{0x[0-f]*}}
62 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_sections|ompt_cancel_{{activated=18|detected=34}}, codeptr_ra={{0x[0-f]*}}
63 // CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_loop|ompt_cancel_detected=36, codeptr_ra={{0x[0-f]*}}
64 // CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_data=[[TASK_ID:[0-9]+]], flags=ompt_cancel_sections|ompt_cancel_{{activated=18|detected=34}}, codeptr_ra={{0x[0-f]*}}