xref: /llvm-project/flang/test/Lower/OpenMP/wsloop-reduction-max-2-byref.f90 (revision 74a87548e5b62881108e6cd1fd63b45580fc3097)
1! RUN: bbc -emit-hlfir -fopenmp --force-byref-reduction -o - %s 2>&1 | FileCheck %s
2! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --force-byref-reduction -o - %s 2>&1 | FileCheck %s
3
4! CHECK: omp.wsloop reduction(byref @max_byref_i32
5! CHECK: arith.cmpi sgt
6! CHECK: arith.select
7
8module m1
9  intrinsic max
10end module m1
11program 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'
20end program main
21