File: value_3.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A12.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 959,712 kB
  • sloc: cpp: 3,275,382; ansic: 2,061,766; ada: 840,956; f90: 208,513; makefile: 76,132; asm: 73,433; xml: 50,448; exp: 34,146; sh: 32,436; objc: 15,637; fortran: 14,012; python: 11,991; pascal: 6,787; awk: 4,779; perl: 3,054; yacc: 338; ml: 285; lex: 201; haskell: 122
file content (53 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
! { dg-do compile }
! Tests the constraints in the patch for PR29642, which requested the
! implementation of the F2003 VALUE attribute for gfortran.
!
! Contributed by Paul Thomas  <pault@gcc.gnu.org> 
!
program test_value
  integer(8) :: i = 42, j   ! { dg-error "not a dummy" }
  integer(8), value :: k    ! { dg-error "not a dummy" }
  value :: j

contains
  subroutine bar_1 (i)
    integer(8) :: i
    dimension i(8)
    value :: i  ! { dg-error "conflicts with DIMENSION" }
    i = 0
  end subroutine bar_1

  subroutine bar_2 (i)
    integer(8) :: i
    pointer :: i
    value :: i  ! { dg-error "conflicts with POINTER" }
    i = 0
  end subroutine bar_2

  integer function bar_3 (i)
    integer(8) :: i
    dimension i(8)
    value :: bar_3  ! { dg-error "conflicts with FUNCTION" }
    i = 0
    bar_3 = 0
  end function bar_3

  subroutine bar_4 (i, j)
    integer(8), intent(inout) :: i
    integer(8), intent(out) :: j
    value :: i  ! { dg-error "conflicts with INTENT" }
    value :: j  ! { dg-error "conflicts with INTENT" }
    i = 0
    j = 0
  end subroutine bar_4

  integer function bar_5 ()
    integer(8) :: i
    external :: i
    integer, parameter :: j = 99
    value :: i  ! { dg-error "conflicts with EXTERNAL" }
    value :: j  ! { dg-error "PARAMETER attribute conflicts with" }
    bar_5 = 0
  end function bar_5

end program test_value