[clang][Driver] Support simplified triple versions for config files (#111387)
[llvm-project.git] / openmp / runtime / test / ompt / synchronization / masked.c
blob3eb45d9592d8029e405d8523864dbc3dc87b0158
1 // RUN: %libomp-compile-and-run | FileCheck %s
2 // REQUIRES: ompt
3 // GCC generates code that does not call the runtime for the master construct
4 // XFAIL: gcc
6 #include "callback.h"
7 #include <omp.h>
9 int main() {
10 int x = 0;
11 #pragma omp parallel num_threads(2)
13 #pragma omp master
15 print_fuzzy_address(1);
16 x++;
18 print_current_address(2);
21 printf("%" PRIu64 ": x=%d\n", ompt_get_thread_data()->value, x);
23 return 0;
26 // Check if libomp supports the callbacks for this test.
27 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_masked'
29 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
31 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_masked_begin:
32 // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]],
33 // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
34 // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]
35 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_masked_end:
36 // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]],
37 // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS_END:0x[0-f]+]]
38 // CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS_END]]