[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / openmp / libompd / test / openmp_examples / fibonacci.c
blob3399e68cfdad311fac9808d42c22ccc0b399c91d
1 // RUN: %gdb-compile-and-run 2>&1 | tee %t.out | FileCheck %s
3 #include "../ompt_plugin.h"
4 #include <omp.h>
5 #include <stdio.h>
6 #include <stdlib.h>
8 int fib(int n) {
9 int i, j;
10 if (n < 2) {
11 ompd_tool_test(0);
12 return n;
13 } else {
14 #pragma omp task shared(i)
15 i = fib(n - 1);
16 #pragma omp task shared(j)
17 j = fib(n - 2);
18 #pragma omp taskwait
19 return i + j;
23 int main(int argc, char **argv) {
24 int n = 5;
25 if (argc > 1)
26 n = atoi(argv[1]);
27 #pragma omp parallel
29 #pragma omp single
30 printf("fib(%i) = %i\n", n, fib(n));
32 return 0;
35 // CHECK-NOT: OMPT-OMPD mismatch
36 // CHECK-NOT: Python Exception
37 // CHECK-NOT: The program is not being run.