Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libompd / test / openmp_examples / example_4.c
blob66ec53f3526b552488cbeba38aaac01c7fdde825
1 // RUN: %gdb-compile-and-run 2>&1 | tee %t.out | FileCheck %s
3 #include "../ompt_plugin.h"
4 #include <omp.h>
5 #include <pthread.h>
6 #include <stdio.h>
7 #include <unistd.h>
9 int main() {
10 printf("Application: Process %d started.\n", getpid());
11 omp_set_num_threads(3);
12 omp_set_max_active_levels(10);
14 #pragma omp parallel // parallel region begins
16 printf("Outer region - thread_ID: %d\n", omp_get_thread_num());
18 #pragma omp parallel num_threads(2) // nested parallel region 1
20 printf("Inner region - thread_ID: %d\n", omp_get_thread_num());
22 #pragma omp parallel num_threads(2) // nested parallel region 2
24 int i;
25 #pragma omp for
26 for (i = 0; i < 4; i++)
27 printf("Thread %i of %i working on %i\n", omp_get_thread_num(),
28 omp_get_max_threads(), 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.