1! { dg-do run }
2!
3! { dg-options "" }
4! Do not run with -pedantic checks enabled as "check"
5! contains internal procedures which is a vendor extension
6
7program test
8  implicit none
9
10  interface check
11    procedure check_r4
12    procedure check_r8
13  end interface check
14
15  real(kind=4) :: x4
16  real(kind=8) :: x8
17
18  x8 = 1.9_8 ; x4 = 1.9_4
19
20  call check(erfc_scaled(x8), erfc_scaled(1.9_8))
21  call check(erfc_scaled(x4), erfc_scaled(1.9_4))
22
23contains
24  subroutine check_r4 (a, b)
25    real(kind=4), intent(in) :: a, b
26    if (abs(a - b) > 1.e-5 * abs(b)) STOP 1
27  end subroutine
28  subroutine check_r8 (a, b)
29    real(kind=8), intent(in) :: a, b
30    if (abs(a - b) > 1.e-7 * abs(b)) STOP 2
31  end subroutine
32end program test
33