Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / runtime / test / ompt / synchronization / flush.c
blob287d035ff85117caaebb3a11b4f443b2f876a7a6
1 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
2 // REQUIRES: ompt
3 // GCC generates code that does not call the runtime for the flush construct
4 // XFAIL: gcc
6 #include "callback.h"
7 #include <omp.h>
9 int main() {
10 #pragma omp parallel num_threads(2)
12 int tid = omp_get_thread_num();
14 #pragma omp flush
15 print_current_address(1);
18 return 0;
20 // Check if libomp supports the callbacks for this test.
21 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_flush'
23 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
24 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_flush:
25 // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
26 // CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
28 // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_flush:
29 // CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
30 // CHECK: {{^}}[[THREAD_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]