Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libompd / test / openmp_examples / example_1.c
blob016ecc414c7eefdfaf8c6f3978c355852a56892f
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 void createPthreads() {
10 int numThreads = 2;
11 pthread_t threads[numThreads];
12 int i;
13 for (i = 0; i < numThreads; ++i)
14 pthread_create(&threads[i], NULL, ompd_tool_break, NULL);
16 for (i = 0; i < numThreads; ++i)
17 pthread_join(threads[i], NULL);
20 int main() {
21 omp_set_num_threads(4);
22 printf("Application: Process %d started.\n", getpid());
23 createPthreads(); // thread_data is set to 0x0 if called
25 // Parallel region 1
26 #pragma omp parallel
27 { ompd_tool_test(0); }
29 return 0;
32 // CHECK-NOT: OMPT-OMPD mismatch
33 // CHECK-NOT: Python Exception
34 // CHECK-NOT: The program is not being run.