brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 5cf927d Raw
40 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s3// REQUIRES: ompt4// Some compilers generate code that does not distinguish between sections and loops5// XFAIL: gcc, clang-3, clang-4, clang-5, icc-16, icc-176// UNSUPPORTED: icc-187// clang-format on8 9#include "callback.h"10#include <omp.h>11 12int main() {13#pragma omp parallel sections num_threads(2)14  {15#pragma omp section16    {17      printf("%lu: section 1\n", ompt_get_thread_data()->value);18    }19#pragma omp section20    {21      printf("%lu: section 2\n", ompt_get_thread_data()->value);22    }23  }24 25  // clang-format off26  // Check if libomp supports the callbacks for this test.27  // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work'28 29  // CHECK: 0: NULL_POINTER=[[NULL:.*$]]30 31  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_sections_begin: parallel_id=[[PARALLEL_ID:[0-f]+]], task_id=[[TASK_ID:[0-f]+]], codeptr_ra=[[SECT_BEGIN:(0x)?[0-f]+]], count=232  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-f]+}}, codeptr_ra=[[SECT_END:(0x)?[0-f]+]]33 34  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_sections_begin: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-f]+]], codeptr_ra=[[SECT_BEGIN]], count=235  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-f]+}}, codeptr_ra=[[SECT_END]]36  // clang-format on37 38  return 0;39}40