[clang][Driver] Support simplified triple versions for config files (#111387)
[llvm-project.git] / openmp / runtime / test / ompt / synchronization / test_nest_lock.c
blob3c65a96a1fd48a6dc424bd5511d8eaec45b7c423
1 // RUN: %libomp-compile-and-run | FileCheck %s
2 // REQUIRES: ompt
4 #include "callback.h"
5 #include <omp.h>
7 int main()
9 omp_nest_lock_t nest_lock;
10 omp_init_nest_lock(&nest_lock);
12 omp_test_nest_lock(&nest_lock);
13 omp_unset_nest_lock(&nest_lock);
15 omp_set_nest_lock(&nest_lock);
16 omp_test_nest_lock(&nest_lock);
17 omp_unset_nest_lock(&nest_lock);
18 omp_unset_nest_lock(&nest_lock);
20 omp_destroy_nest_lock(&nest_lock);
22 // Check if libomp supports the callbacks for this test.
23 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquire'
24 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquired'
25 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_released'
26 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_nest_lock'
28 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
30 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_init_nest_lock: wait_id=[[WAIT_ID:[0-9]+]], hint=0, impl={{[0-9]+}}, codeptr_ra={{0x[0-f]+}}
31 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_test_nest_lock: wait_id=[[WAIT_ID]], hint=0, impl={{[0-9]+}}, codeptr_ra={{0x[0-f]+}}
32 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_acquired_test_nest_lock_first: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
33 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_release_nest_lock_last: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
34 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_nest_lock: wait_id=[[WAIT_ID]], hint=0, impl={{[0-9]+}}, codeptr_ra={{0x[0-f]+}}
35 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_acquired_nest_lock_first: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
36 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_test_nest_lock: wait_id=[[WAIT_ID]], hint=0, impl={{[0-9]+}}, codeptr_ra={{0x[0-f]+}}
37 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_acquired_nest_lock_next: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
38 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_release_nest_lock_prev: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
39 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_release_nest_lock_last: wait_id=[[WAIT_ID]], codeptr_ra={{0x[0-f]+}}
41 return 0;