| 1 |
// clang-format off |
| 2 |
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s |
| 3 |
// REQUIRES: ompt |
| 4 |
// GCC generates code that does not call the runtime for the flush construct |
| 5 |
// XFAIL: gcc |
| 6 |
// clang-format on |
| 7 |
|
| 8 |
#include "callback.h" |
| 9 |
#include <omp.h> |
| 10 |
|
| 11 |
int main() { |
| 12 |
#pragma omp parallel num_threads(2) |
| 13 |
{ |
| 14 |
int tid = omp_get_thread_num(); |
| 15 |
|
| 16 |
#pragma omp flush |
| 17 |
print_current_address(1); |
| 18 |
} |
| 19 |
|
| 20 |
return 0; |
| 21 |
} |
| 22 |
// clang-format off |
| 23 |
// Check if libomp supports the callbacks for this test. |
| 24 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_flush' |
| 25 |
|
| 26 |
// CHECK: 0: NULL_POINTER=[[NULL:.*$]] |
| 27 |
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_flush: |
| 28 |
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]] |
| 29 |
// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]] |
| 30 |
// |
| 31 |
// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_flush: |
| 32 |
// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]] |
| 33 |
// CHECK: {{^}}[[THREAD_ID]]: current_address={{.*}}[[RETURN_ADDRESS]] |
| 34 |
// clang-format on |