Debian Codegraph @

openmp/runtime/test/ompt/synchronization/barrier/for_simd.c

raw
1 // clang-format off
2 // RUN: %libomp-compile-and-run | FileCheck %s
3 // REQUIRES: ompt
4 // XFAIL: gcc-4
5 // clang-format on
6
7 #include "callback.h"
8 #include <omp.h>
9
10 int main() {
11 int y[] = {0, 1, 2, 3};
12
13 int i;
14 #pragma omp for simd
15 for (i = 0; i < 4; i++) {
16 y[i]++;
17 }
18
19 // clang-format off
20 // Check if libomp supports the callbacks for this test.
21 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_sync_region'
22 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_sync_region_wait'
23
24 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
25
26 // master thread implicit barrier at simd loop end
27 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_barrier_implicit_workshare_begin: parallel_id={{[0-f]+}}, task_id={{[0-f]+}}, codeptr_ra={{(0x)?[0-f]+}}
28 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_barrier_implicit_workshare_begin: parallel_id={{[0-f]+}}, task_id={{[0-f]+}}, codeptr_ra={{(0x)?[0-f]+}}
29 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_barrier_implicit_workshare_end: parallel_id={{[0-f]+}}, task_id={{[0-f]+}}, codeptr_ra={{(0x)?[0-f]+}}
30 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_barrier_implicit_workshare_end: parallel_id={{[0-f]+}}, task_id={{[0-f]+}}, codeptr_ra={{(0x)?[0-f]+}}
31 // clang-format on
32
33 return 0;
34 }