1! { dg-do run }
2! { dg-options "-O1" }
3! Checks the fix for PR34896 which was a regression that prevented max
4! and min from being interchanged by the USE statement below.  It is further
5! checked by libgomp/testsuite/libgomp.fortran/reduction5.f90
6!
7! Reported by H.J. Lu <hjl.tools@gmail.com>
8!
9module reduction5
10  intrinsic min, max
11end module reduction5
12
13program reduction_5_regression
14  call test2
15contains
16  subroutine test2
17    use reduction5, min => max, max => min
18    integer a, b
19    a = max (1,5)
20    b = min (1,5)
21    if (a .ne. 1) STOP 1
22    if (b .ne. 5) STOP 2
23  end subroutine test2
24end
25