LLVM OpenMP
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
8static int Count;
9
10static 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
17int 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
#define i
Definition kmp_stub.cpp:88
static void flatten(int Lower, int Upper)
int main(void)
static int Count