brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 663fe4e Raw
43 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | FileCheck %s3// RUN: %libomp-compile -DNOWAIT && %libomp-run | FileCheck %s4// REQUIRES: ompt5// UNSUPPORTED: gcc6// clang-format on7#include "callback.h"8#include <omp.h>9 10#ifdef NOWAIT11#define FOR_CLAUSE nowait12#else13#define FOR_CLAUSE14#endif15 16int main() {17  int sum = 0;18  int i;19#pragma omp parallel num_threads(1)20#pragma omp for reduction(+ : sum) FOR_CLAUSE21  for (i = 0; i < 10000; i++) {22    sum += i;23  }24 25  // clang-format off26  // CHECK: 0: NULL_POINTER=[[NULL:.*$]]27 28  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:29  // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-f]+]]30  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:31  // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-f]+]]32 33  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_reduction_begin:34  // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]],35  // CHECK-SAME: codeptr_ra=36  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_reduction_end:37  // CHECK-SAME: parallel_id=[[PARALLEL_ID]],38  // CHECK-SAME: task_id=[[TASK_ID]], codeptr_ra=39  // clang-format on40 41  return 0;42}43