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