[llvm] Stop including unordered_map (NFC)
[llvm-project.git] / openmp / runtime / test / tasking / task_reduction4.c
blob9b686ab9f4b9b03551afd393b245b1b6b1a34e6f
1 // RUN: %libomp-compile-and-run
3 // XFAIL: icc
4 // UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
5 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8
7 #include <stdio.h>
8 #include <stdlib.h>
10 int a = 0, b = 1;
12 int main(int argc, char **argv) {
14 #pragma omp parallel reduction(task, +:a) reduction(task, *:b)
16 #pragma omp single
18 int i;
19 for (i = 1; i <= 5; ++i) {
20 #pragma omp task in_reduction(+: a) in_reduction(*: b)
22 a += i;
23 b *= i;
29 if (a != 15) {
30 fprintf(stderr, "error: a != 15. Instead a = %d\n", a);
31 exit(EXIT_FAILURE);
33 if (b != 120) {
34 fprintf(stderr, "error: b != 120. Instead b = %d\n", b);
35 exit(EXIT_FAILURE);
38 return EXIT_SUCCESS;