File: call30.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (57 lines) | stat: -rw-r--r-- 2,949 bytes parent folder | download | duplicates (3)
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
54
55
56
57
! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic
! This test is responsible for checking the fix for passing non-variables as
! actual arguments to subroutines/functions whose corresponding dummy argument
! expects a VOLATILE variable
! c.f. llvm-project GitHub issue #58973

module m
  contains
  subroutine vol_dum_int(my_int)
    integer, volatile :: my_int
  end subroutine vol_dum_int

  subroutine vol_dum_real(my_real)
    real, volatile :: my_real
  end subroutine vol_dum_real

  subroutine vol_dum_complex(my_complex)
    complex, volatile :: my_complex
  end subroutine vol_dum_complex

  subroutine vol_dum_int_arr(my_int_arr)
    integer, dimension(2,2), volatile :: my_int_arr
  end subroutine vol_dum_int_arr

  subroutine test_all_subprograms()
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int=' is not a variable
    call vol_dum_int(6)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int=' is not a variable
    call vol_dum_int(6+12)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int=' is not a variable
    call vol_dum_int(6*12)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int=' is not a variable
    call vol_dum_int(-6/2)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_real=' is not a variable
    call vol_dum_real(3.141592653)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_real=' is not a variable
    call vol_dum_real(3.141592653 + (-10.6e-11))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_real=' is not a variable
    call vol_dum_real(3.141592653 * 10.6e-11)
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_real=' is not a variable
    call vol_dum_real(3.141592653 / (-10.6e-11))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_complex=' is not a variable
    call vol_dum_complex((1., 3.2))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_complex=' is not a variable
    call vol_dum_complex((1., 3.2) + (-2., 3.14))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_complex=' is not a variable
    call vol_dum_complex((1., 3.2) * (-2., 3.14))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_complex=' is not a variable
    call vol_dum_complex((1., 3.2) / (-2., 3.14))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not a variable
    call vol_dum_int_arr((/ 1, 2, 3, 4 /))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not a variable
    call vol_dum_int_arr(reshape((/ 1, 2, 3, 4 /), (/ 2, 2/)))
    !WARNING: actual argument associated with VOLATILE dummy argument 'my_int_arr=' is not a variable
    call vol_dum_int_arr((/ 1, 2, 3, 4 /))
  end subroutine test_all_subprograms
end module m