flang/test/Lower/OpenMP/wsloop-reduction-max-2.f90
raw| 1 | ! RUN: bbc -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s |
| 2 | ! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s |
| 3 | |
| 4 | ! CHECK: omp.wsloop reduction(@max_i32 |
| 5 | ! CHECK: arith.cmpi sgt |
| 6 | ! CHECK: arith.select |
| 7 | |
| 8 | module m1 |
| 9 | intrinsic max |
| 10 | end module m1 |
| 11 | program main |
| 12 | use m1, ren=>max |
| 13 | n=0 |
| 14 | !$omp parallel do reduction(ren:n) |
| 15 | do i=1,100 |
| 16 | n=max(n,i) |
| 17 | end do |
| 18 | if (n/=100) print *,101 |
| 19 | print *,'pass' |
| 20 | end program main |