| 1 |
// clang-format off |
| 2 |
// RUN: %libomp-compile-and-run | FileCheck %s |
| 3 |
// RUN: %libomp-compile -DNOWAIT && %libomp-run | FileCheck %s |
| 4 |
// REQUIRES: ompt |
| 5 |
// UNSUPPORTED: gcc |
| 6 |
// clang-format on |
| 7 |
#include "callback.h" |
| 8 |
#include <omp.h> |
| 9 |
|
| 10 |
#ifdef NOWAIT |
| 11 |
#define FOR_CLAUSE nowait |
| 12 |
#else |
| 13 |
#define FOR_CLAUSE |
| 14 |
#endif |
| 15 |
|
| 16 |
int main() { |
| 17 |
int sum = 0; |
| 18 |
int i; |
| 19 |
#pragma omp parallel num_threads(1) |
| 20 |
#pragma omp for reduction(+ : sum) FOR_CLAUSE |
| 21 |
for (i = 0; i < 10000; i++) { |
| 22 |
sum += i; |
| 23 |
} |
| 24 |
|
| 25 |
// clang-format off |
| 26 |
// 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 on |
| 40 |
|
| 41 |
return 0; |
| 42 |
} |