coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / minmaxval_1.f90
blobbb16d2e5f0fd17538823e26844c472ccf53399ff
1 ! { dg-do compile }
2 ! Tests the fix for PR37836 in which the specification expressions for
3 ! y were not simplified because there was no simplifier for minval and
4 ! maxval.
6 ! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
8 ! nint(exp(3.0)) is equal to 20 :-)
10 function fun4a()
11 integer fun4a
12 real y(minval([25, nint(exp(3.0)), 15]))
14 fun4a = size (y, 1)
15 end function fun4a
17 function fun4b()
18 integer fun4b
19 real y(maxval([25, nint(exp(3.0)), 15]))
20 save
22 fun4b = size (y, 1)
23 end function fun4b
25 EXTERNAL fun4a, fun4b
26 integer fun4a, fun4b
27 if (fun4a () .ne. 15) call abort
28 if (fun4b () .ne. 25) call abort
29 end