| 1 |
// clang-format off |
| 2 |
// RUN: %libomp-compile-and-run | FileCheck %s |
| 3 |
// REQUIRES: ompt |
| 4 |
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7 |
| 5 |
// clang-format on |
| 6 |
#include "callback.h" |
| 7 |
#include <omp.h> |
| 8 |
|
| 9 |
int main() { |
| 10 |
#pragma omp ordered |
| 11 |
{ |
| 12 |
print_current_address(1); |
| 13 |
print_ids(0); |
| 14 |
} |
| 15 |
print_current_address(2); |
| 16 |
|
| 17 |
// clang-format off |
| 18 |
// Check if libomp supports the callbacks for this test. |
| 19 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquire' |
| 20 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquired' |
| 21 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_released' |
| 22 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_nest_lock' |
| 23 |
|
| 24 |
// CHECK: 0: NULL_POINTER=[[NULL:.*$]] |
| 25 |
|
| 26 |
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_wait_ordered: wait_id=[[WAIT_ID:[0-9]+]], hint={{[0-9]+}}, impl={{[0-9]+}}, codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]] |
| 27 |
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_acquired_ordered: wait_id=[[WAIT_ID]], codeptr_ra=[[RETURN_ADDRESS]] |
| 28 |
// CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]] |
| 29 |
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_release_ordered: wait_id=[[WAIT_ID]], codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]] |
| 30 |
// CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]] |
| 31 |
// clang-format on |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |