LLVM OpenMP 20.0.0git
issue-79416.c
Go to the documentation of this file.
1// RUN: %libomp-compile-and-run
2#include <stdio.h>
3#include <stdlib.h>
4
5int a;
6
7void run(int nteams, int nth) {
8 a = 0;
9#pragma omp teams num_teams(nteams)
10 {
11#pragma omp parallel num_threads(nth)
12 {
13#pragma omp task
14 {
15#pragma omp atomic
16 a++;
17 }
18 }
19 }
20 if (a == 0)
21 exit(EXIT_FAILURE);
22}
23
24int main() {
25 int i, nteams, nth;
26 for (nteams = 1; nteams <= 2; ++nteams)
27 for (nth = 1; nth <= 3; ++nth)
28 for (i = 0; i < 10; ++i) {
29 printf("run(%d, %d)\n", nteams, nth);
30 run(nteams, nth);
31 }
32 return EXIT_SUCCESS;
33}
void run(int nteams, int nth)
Definition: issue-79416.c:7
int a
Definition: issue-79416.c:5
int main()
Definition: issue-79416.c:24
#define i
Definition: kmp_stub.cpp:87