Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libompd / test / openmp_examples / example_2.c
blob45a88743a034c0a401d29625e363d68d33da7c86
1 // RUN: %gdb-compile 2>&1 | tee %t.compile
2 // RUN: env OMP_SCHEDULE=static,5 %gdb-run 2>&1 | tee %t.out | FileCheck %s
4 #include "../ompt_plugin.h"
5 #include <omp.h>
6 #include <pthread.h>
7 #include <stdio.h>
8 #include <unistd.h>
10 int main() {
11 printf("Application: Process %d started.\n", getpid());
13 omp_set_num_threads(3);
14 omp_set_max_active_levels(10);
16 #pragma omp parallel // parallel region begins
18 printf("Outer region - thread_ID: %d\n", omp_get_thread_num());
20 #pragma omp parallel num_threads(2) // nested parallel region 1
22 printf("Inner region - thread_ID: %d\n", omp_get_thread_num());
24 #pragma omp parallel num_threads(2) // nested parallel region 2
26 int i;
27 #pragma omp for
28 for (i = 0; i < 10; i++)
29 ompd_tool_test(0);
34 return 0;
37 // CHECK-NOT: OMPT-OMPD mismatch
38 // CHECK-NOT: Python Exception
39 // CHECK-NOT: The program is not being run.