2 ! { dg-options "-std=f95 -Wintrinsics-std -fdump-tree-original" }
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
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.
13 SUBROUTINE no_implicit
15 REAL :: asinh ! { dg-warning "Fortran 2008" }
17 ! abort is a GNU extension
18 CALL abort () ! { dg-warning "extension" }
20 ! ASINH is an intrinsic of F2008
21 ! The warning should be issued in the declaration above where it is declared
23 WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
24 END SUBROUTINE no_implicit
26 SUBROUTINE implicit_type
27 ! acosh has implicit type
29 WRITE (*,*) ACOSH (1.) ! { dg-warning "Fortran 2008" }
30 WRITE (*,*) ACOSH (1.) ! { dg-bogus "Fortran 2008" }
31 END SUBROUTINE implicit_type
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
39 SUBROUTINE intrinsic_decl
41 INTRINSIC :: atanh ! { dg-error "Fortran 2008" }
42 INTRINSIC :: abort ! { dg-error "extension" }
43 END SUBROUTINE intrinsic_decl
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" } }