OSDN Git Service

2010-10-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / bessel_4.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=f2008" }
3 !
4 ! PR fortran/36158 - Transformational BESSEL_JN/YN
5 ! PR fortran/33197 - F2008 math functions
6 !
7 implicit none
8 ! OK, elemental function:
9  print *, bessel_yn(1, [1.0, 2.0])
10  print *, bessel_yn([1, 2], 2.0)
11
12 ! Wrong, transformational function:
13 ! Does not pass check.c -- thus regarded as wrong generic function
14 ! and thus rejected with a slightly misleading error message
15  print *, bessel_yn(1, 2, [2.0, 3.0]) ! { dg-error "Too many arguments" }
16
17 ! Wrong in F2008: Negative argument, ok as GNU extension
18  print *, bessel_yn(-1, 3.0) ! { dg-error "Extension: Negative argument N " }
19
20 ! Wrong in F2008: Negative argument -- and no need for a GNU extension
21 ! Does not pass check.c -- thus regarded as wrong generic function
22 ! and thus rejected with a slightly misleading error message
23  print *, bessel_yn(-1, 2, 3.0) ! { dg-error "Too many arguments" }
24 end