[RISCV] Change func to funct in RISCVInstrInfoXqci.td. NFC (#119669)
[llvm-project.git] / openmp / runtime / test / parallel / omp_parallel_private.c
blob238e806a83119bbde8a93cd8c078201155f32986
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include "omp_testsuite.h"
6 //static int sum1 = 789;
8 int test_omp_parallel_private()
10 int sum, num_threads,sum1;
11 int known_sum;
13 sum = 0;
14 num_threads = 0;
16 #pragma omp parallel private(sum1)
18 int i;
19 sum1 = 7;
20 /*printf("sum1=%d\n",sum1);*/
21 #pragma omp for
22 for (i = 1; i < 1000; i++) {
23 sum1 = sum1 + i;
25 #pragma omp critical
27 sum = sum + sum1;
28 num_threads++;
31 known_sum = (999 * 1000) / 2 + 7 * num_threads;
32 return (known_sum == sum);
35 int main()
37 int i;
38 int num_failed=0;
40 for(i = 0; i < REPETITIONS; i++) {
41 if(!test_omp_parallel_private()) {
42 num_failed++;
45 return num_failed;