LLVM OpenMP 22.0.0git
critical.c
Go to the documentation of this file.
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
9int main() {
10#pragma omp critical
11 {
13 print_ids(0);
14 }
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_critical: 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_critical: wait_id=[[WAIT_ID]], codeptr_ra=[[RETURN_ADDRESS]]
28 // CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
29 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_release_critical: 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}
static void print_ids(int level)
Definition: callback.h:187
#define print_current_address(id)
Definition: callback.h:255
int main()
Definition: critical.c:9