brintos

brintos / llvm-project-archived public Read only

0
0
Text · 986 B · 78dff0c Raw
35 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s3// REQUIRES: ompt4// GCC generates code that does not call the runtime for the flush construct5// XFAIL: gcc6// clang-format on7 8#include "callback.h"9#include <omp.h>10 11int main() {12#pragma omp parallel num_threads(2)13  {14    int tid = omp_get_thread_num();15 16#pragma omp flush17    print_current_address(1);18  }19 20  return 0;21}22// clang-format off23// Check if libomp supports the callbacks for this test.24// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_flush'25 26// CHECK: 0: NULL_POINTER=[[NULL:.*$]]27// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_flush:28// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]]29// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]30//31// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_flush:32// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]]33// CHECK: {{^}}[[THREAD_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]34// clang-format on35