aboutsummaryrefslogtreecommitdiff
path: root/openmp/runtime/test/misc_bugs/omp_nothing.c
blob: e50d32d147ec9bc338740ffffcd9110eb08f8ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %libomp-compile
// RUN: %libomp-run | FileCheck %s --check-prefix OMP-CHECK

#include <stdio.h>

void foo(int x) {
  printf("foo");
  return;
}

int main() {
  int x = 4;
  // should call foo()
  if (x % 2 == 0)
#pragma omp nothing
    foo(x);

  // should not call foo()
  x = 3;
  if (x % 2 == 0)
#pragma omp nothing
    foo(x);

  // OMP-CHECK: foo
  // OMP-CHECK-NOT: foo
  return 0;
}