LLVM OpenMP 20.0.0git
bug_set_schedule_0.c
Go to the documentation of this file.
1// RUN: %libomp-compile-and-run
2
3#include <stdio.h>
4#include <omp.h>
5#include "omp_testsuite.h"
6
7/* Test that the chunk size is set to default (1) when
8 chunk size <= 0 is specified */
9int a = 0;
10
12{
13 int i;
14 a = 0;
16
17 #pragma omp parallel
18 {
19 #pragma omp for schedule(runtime)
20 for(i = 0; i < 10; i++) {
21 #pragma omp atomic
22 a++;
23 if(a > 10)
24 exit(1);
25 }
26 }
27 return a==10;
28}
29
30int main()
31{
32 int i;
33 int num_failed=0;
34
35 for(i = 0; i < REPETITIONS; i++) {
36 if(!test_set_schedule_0()) {
37 num_failed++;
38 }
39 }
40 return num_failed;
41}
int a
int test_set_schedule_0()
int main()
@ omp_sched_dynamic
Definition: kmp.h:4505
#define i
Definition: kmp_stub.cpp:87
#define omp_set_schedule
Definition: kmp_stub.cpp:30
#define REPETITIONS
Definition: omp_testsuite.h:13