xref: /llvm-project/openmp/runtime/test/transform/reverse/intfor.c (revision 80865c01e1b8d3a6bea308fda7bbc53047dcc2e7)
1*80865c01SMichael Kruse // RUN: %libomp-compile-and-run | FileCheck %s --match-full-lines
2*80865c01SMichael Kruse 
3*80865c01SMichael Kruse #ifndef HEADER
4*80865c01SMichael Kruse #define HEADER
5*80865c01SMichael Kruse 
6*80865c01SMichael Kruse #include <stdlib.h>
7*80865c01SMichael Kruse #include <stdio.h>
8*80865c01SMichael Kruse 
9*80865c01SMichael Kruse int main() {
10*80865c01SMichael Kruse   printf("do\n");
11*80865c01SMichael Kruse #pragma omp reverse
12*80865c01SMichael Kruse   for (int i = 7; i < 19; i += 3)
13*80865c01SMichael Kruse     printf("i=%d\n", i);
14*80865c01SMichael Kruse   printf("done\n");
15*80865c01SMichael Kruse   return EXIT_SUCCESS;
16*80865c01SMichael Kruse }
17*80865c01SMichael Kruse 
18*80865c01SMichael Kruse #endif /* HEADER */
19*80865c01SMichael Kruse 
20*80865c01SMichael Kruse // CHECK:      do
21*80865c01SMichael Kruse // CHECK-NEXT: i=16
22*80865c01SMichael Kruse // CHECK-NEXT: i=13
23*80865c01SMichael Kruse // CHECK-NEXT: i=10
24*80865c01SMichael Kruse // CHECK-NEXT: i=7
25*80865c01SMichael Kruse // CHECK-NEXT: done
26