2 * taskwait-depend.c -- Archer testcase
3 * derived from DRB166-taskdep4-orig-omp50-no.c in DataRaceBench
5 //===----------------------------------------------------------------------===//
7 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
9 // See tools/archer/LICENSE.txt for details.
10 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
12 //===----------------------------------------------------------------------===//
14 // RUN: %libarcher-compile-and-run | FileCheck %s
17 #include "ompt/ompt-signal.h"
23 int x
= 0, y
= 2, sem
= 0;
25 #pragma omp task depend(inout : x) shared(x, sem)
28 x
++; // 1st Child Task
31 #pragma omp task shared(y, sem)
34 y
--; // 2nd child task
38 #pragma omp taskwait depend(in : x) // 1st taskwait
42 #pragma omp taskwait // 2nd taskwait
48 #pragma omp parallel num_threads(2)
55 // CHECK-NOT: ThreadSanitizer: data race
56 // CHECK-NOT: ThreadSanitizer: reported