LLVM OpenMP
runtime
test
transform
flatten
overflow-empty.c
Go to the documentation of this file.
1
// RUN: %libomp-compile -fopenmp-version=61 && %libomp-run \
2
// RUN: | FileCheck %s --match-full-lines
3
4
#include <limits.h>
5
#include <stdio.h>
6
#include <stdlib.h>
7
8
static
int
Count
;
9
10
static
void
flatten
(
int
Lower,
int
Upper) {
11
#pragma omp flatten
12
for
(
int
i
= Lower;
i
< Upper; ++
i
)
13
for
(
int
j
= 0;
j
< 2; ++
j
)
14
++
Count
;
15
}
16
17
int
main
(
void
) {
18
// The trip-count expression may overflow or wrap for these bounds. The
19
// original loop condition is false, so flatten must not evaluate that count
20
// and must execute no iterations.
21
flatten
(INT_MAX, INT_MIN);
22
printf(
"count=%d\n"
,
Count
);
23
return
EXIT_SUCCESS;
24
}
25
26
// CHECK: count=0
i
#define i
Definition
kmp_stub.cpp:88
j
int j
Definition
omp_single_copyprivate.c:6
flatten
static void flatten(int Lower, int Upper)
Definition
overflow-empty.c:10
main
int main(void)
Definition
overflow-empty.c:17
Count
static int Count
Definition
overflow-empty.c:8
Generated on
for LLVM OpenMP by
1.14.0