Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / runtime / test / tasking / omp_task_priority3.c
blobfc540518ecd0bd6eca1a96b472e81d91614f5269
1 // RUN: %libomp-compile && env OMP_MAX_TASK_PRIORITY=42 %libomp-run
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <omp.h>
7 int a = 0;
9 int main(void) {
10 int i;
11 int max_task_priority = omp_get_max_task_priority();
12 if (max_task_priority != 42) {
13 fprintf(stderr,
14 "error: omp_get_max_task_priority() returned %d instead of 42\n",
15 max_task_priority);
16 exit(EXIT_FAILURE);
19 for (i = 0; i < 250; ++i) {
20 #pragma omp parallel
22 #pragma omp task priority(42)
24 #pragma omp atomic
25 a++;
30 printf("a = %d\n", a);
32 return EXIT_SUCCESS;