brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 8d466b7 Raw
43 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | FileCheck %s3// REQUIRES: ompt4// GCC generates code that does not call the runtime for the master construct5// XFAIL: gcc6// clang-format on7 8#include "callback.h"9#include <omp.h>10 11int main() {12  int x = 0;13#pragma omp parallel num_threads(2)14  {15#pragma omp master16    {17      print_fuzzy_address(1);18      x++;19    }20    print_current_address(2);21  }22 23  printf("%" PRIu64 ": x=%d\n", ompt_get_thread_data()->value, x);24 25  return 0;26}27 28// clang-format off29// Check if libomp supports the callbacks for this test.30// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_masked'31 32// CHECK: 0: NULL_POINTER=[[NULL:.*$]]33 34// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_masked_begin:35// CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-f]+]], task_id=[[TASK_ID:[0-f]+]],36// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:(0x)?[0-f]+]]{{[0-f][0-f]}}37// CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]38// CHECK: {{^}}[[MASTER_ID]]: ompt_event_masked_end:39// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]],40// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS_END:(0x)?[0-f]+]]41// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS_END]]42// clang-format on43