Debian Codegraph @

gcc/testsuite/gfortran.dg/c-interop/c535b-3.f90

raw
1 ! PR 101334
2 ! { dg-do compile }
3 ! { dg-additional-options "-fcoarray=single" }
4 !
5 ! TS 29113
6 ! C535b An assumed-rank variable name shall not appear in a designator
7 ! or expression except as an actual argument corresponding to a dummy
8 ! argument that is assumed-rank, the argument of the C_LOC function
9 ! in the ISO_C_BINDING intrinsic module, or the first argument in a
10 ! reference to an intrinsic inquiry function.
11 !
12 ! This has been renamed C838 in the Fortran 2018 standard, with C_SIZEOF
13 ! and SELECT_RANK additionally added.
14 !
15 ! This tests various forms of the 2-argument associated intrinsic.
16
17 function test_associated2 (a, b)
18 implicit none
19 integer, pointer :: a(..)
20 integer, target :: b(..)
21 logical :: test_associated2
22
23 test_associated2 = associated (a, b) ! { dg-error "Assumed.rank" }
24 end function
25
26 function test_associated3 (a, b)
27 implicit none
28 integer, pointer :: a(..)
29 integer, target :: b
30 logical :: test_associated3
31
32 test_associated3 = associated (a, b) ! { dg-bogus "must be of rank -1" "pr101334" }
33 end function
34
35 function test_associated4 (a, b)
36 implicit none
37 integer, pointer :: a(..)
38 integer, target :: b(:)
39 logical :: test_associated4
40
41 test_associated4 = associated (a, b) ! { dg-bogus "must be of rank -1" "pr101334" }
42 end function
43
44 function test_associated5 (a, b)
45 implicit none
46 integer, pointer :: a(..)
47 integer, target :: b(20)
48 logical :: test_associated5
49
50 test_associated5 = associated (a, b) ! { dg-bogus "must be of rank -1" "pr101334" }
51 end function
52
53 function test_associated6 (a, b)
54 implicit none
55 integer, pointer :: a(..)
56 integer, pointer :: b(..)
57 logical :: test_associated6
58
59 test_associated6 = associated (a, b) ! { dg-error "Assumed.rank" }
60 end function
61
62 function test_associated7 (a, b)
63 implicit none
64 integer, pointer :: a(..)
65 integer, pointer :: b
66 logical :: test_associated7
67
68 test_associated7 = associated (a, b) ! { dg-bogus "must be of rank -1" "pr101334" }
69 end function
70
71 function test_associated8 (a, b)
72 implicit none
73 integer, pointer :: a(..)
74 integer, pointer :: b(:)
75 logical :: test_associated8
76
77 test_associated8 = associated (a, b) ! { dg-bogus "must be of rank -1" "pr101334" }
78 end function
79