brintos

brintos / llvm-project-archived public Read only

0
0
Text · 678 B · 3399e68 Raw
38 lines · c
1// RUN: %gdb-compile-and-run 2>&1 | tee %t.out | FileCheck %s2 3#include "../ompt_plugin.h"4#include <omp.h>5#include <stdio.h>6#include <stdlib.h>7 8int 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 taskwait19    return i + j;20  }21}22 23int main(int argc, char **argv) {24  int n = 5;25  if (argc > 1)26    n = atoi(argv[1]);27#pragma omp parallel28  {29#pragma omp single30    printf("fib(%i) = %i\n", n, fib(n));31  }32  return 0;33}34 35// CHECK-NOT: OMPT-OMPD mismatch36// CHECK-NOT: Python Exception37// CHECK-NOT: The program is not being run.38