RISC-V: Refactor Dynamic LMUL codes
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr78619.f90
blob5fbe185cfab0dba7c5bc62bff90bc34efbdda5ee
1 ! { dg-do compile }
2 ! { dg-options "-Werror -O3" }
4 ! Tests the fix for PR78619, in which the recursive use of 'f' at line 13
5 ! caused an ICE.
7 ! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
9 print *, g(1.0) ! 'g' is OK
10 contains
11 function f(x) result(z)
12 real :: x, z
13 z = sign(1.0, f) ! { dg-error "calling itself recursively|must be the same type" }
14 end
15 real function g(x)
16 real :: x
17 g = -1
18 g = -sign(1.0, g) ! This is OK.
19 end
20 end
21 ! { dg-message "all warnings being treated as errors" "" { target *-*-* } 0 }