OSDN Git Service

ChangeLogs fixed, again.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / intrinsic_std_1.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=f95 -Wintrinsics-std -fdump-tree-original" }
3
4 ! PR fortran/33141
5 ! Check for the expected behaviour when an intrinsic function/subroutine is
6 ! called that is not available in the defined standard or that is a GNU
7 ! extension:
8 ! There should be a warning emitted on the call, and the reference should be
9 ! treated like an external call.
10 ! For declaring a non-standard intrinsic INTRINSIC, a hard error should be
11 ! generated, of course.
12
13 SUBROUTINE no_implicit
14   IMPLICIT NONE
15   REAL :: asinh ! { dg-warning "Fortran 2008" }
16
17   ! abort is a GNU extension
18   CALL abort () ! { dg-warning "extension" }
19
20   ! ASINH is an intrinsic of F2008
21   ! The warning should be issued in the declaration above where it is declared
22   ! EXTERNAL.
23   WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
24 END SUBROUTINE no_implicit
25
26 SUBROUTINE implicit_type
27   ! acosh has implicit type
28
29   WRITE (*,*) ACOSH (1.) ! { dg-warning "Fortran 2008" }
30   WRITE (*,*) ACOSH (1.) ! { dg-bogus "Fortran 2008" }
31 END SUBROUTINE implicit_type
32
33 SUBROUTINE specification_expression
34   CHARACTER(KIND=selected_char_kind("ascii")) :: x
35 ! { dg-error "specification function" "" { target "*-*-*" } 34 }
36 ! { dg-warning "Fortran 2003" "" { target "*-*-*" } 34 }
37 END SUBROUTINE specification_expression
38
39 SUBROUTINE intrinsic_decl
40   IMPLICIT NONE
41   INTRINSIC :: atanh ! { dg-error "Fortran 2008" }
42   INTRINSIC :: abort ! { dg-error "extension" }
43 END SUBROUTINE intrinsic_decl
44
45 ! Scan that really external functions are called.
46 ! { dg-final { scan-tree-dump " abort " "original" } }
47 ! { dg-final { scan-tree-dump " asinh " "original" } }
48 ! { dg-final { scan-tree-dump " acosh " "original" } }
49 ! { dg-final { cleanup-tree-dump "original" } }