annotate gcc/testsuite/gfortran.dg/no_arg_check_3.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! { dg-options "-fcoarray=single" }
kono
parents:
diff changeset
3 !
kono
parents:
diff changeset
4 ! PR fortran/39505
kono
parents:
diff changeset
5 !
kono
parents:
diff changeset
6 ! Test NO_ARG_CHECK
kono
parents:
diff changeset
7 ! Copied from assumed_type_2.f90
kono
parents:
diff changeset
8 !
kono
parents:
diff changeset
9 subroutine one(a) ! { dg-error "may not have the ALLOCATABLE, CODIMENSION, POINTER or VALUE attribute" }
kono
parents:
diff changeset
10 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
11 integer, value :: a
kono
parents:
diff changeset
12 end subroutine one
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 subroutine two(a) ! { dg-error "may not have the ALLOCATABLE, CODIMENSION, POINTER or VALUE attribute" }
kono
parents:
diff changeset
15 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
16 integer, pointer :: a
kono
parents:
diff changeset
17 end subroutine two
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 subroutine three(a) ! { dg-error "may not have the ALLOCATABLE, CODIMENSION, POINTER or VALUE attribute" }
kono
parents:
diff changeset
20 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
21 integer, allocatable :: a
kono
parents:
diff changeset
22 end subroutine three
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 subroutine four(a) ! { dg-error "may not have the ALLOCATABLE, CODIMENSION, POINTER or VALUE attribute" }
kono
parents:
diff changeset
25 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
26 integer :: a[*]
kono
parents:
diff changeset
27 end subroutine four
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 subroutine five(a) ! { dg-error "with NO_ARG_CHECK attribute shall either be a scalar or an assumed-size array" }
kono
parents:
diff changeset
30 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
31 integer :: a(3)
kono
parents:
diff changeset
32 end subroutine five
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 subroutine six()
kono
parents:
diff changeset
35 !GCC$ attributes NO_ARG_CHECK :: nodum ! { dg-error "with NO_ARG_CHECK attribute shall be a dummy argument" }
kono
parents:
diff changeset
36 integer :: nodum
kono
parents:
diff changeset
37 end subroutine six
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 subroutine seven(y)
kono
parents:
diff changeset
40 !GCC$ attributes NO_ARG_CHECK :: y
kono
parents:
diff changeset
41 integer :: y(*)
kono
parents:
diff changeset
42 call a7(y(3:5)) ! { dg-error "with NO_ARG_CHECK attribute shall not have a subobject reference" }
kono
parents:
diff changeset
43 contains
kono
parents:
diff changeset
44 subroutine a7(x)
kono
parents:
diff changeset
45 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
46 integer :: x(*)
kono
parents:
diff changeset
47 end subroutine a7
kono
parents:
diff changeset
48 end subroutine seven
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 subroutine nine()
kono
parents:
diff changeset
51 interface one
kono
parents:
diff changeset
52 subroutine okay(x)
kono
parents:
diff changeset
53 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
54 integer :: x
kono
parents:
diff changeset
55 end subroutine okay
kono
parents:
diff changeset
56 end interface
kono
parents:
diff changeset
57 interface two
kono
parents:
diff changeset
58 subroutine ambig1(x) ! { dg-error "Ambiguous interfaces" }
kono
parents:
diff changeset
59 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
60 integer :: x
kono
parents:
diff changeset
61 end subroutine ambig1
kono
parents:
diff changeset
62 subroutine ambig2(x) ! { dg-error "Ambiguous interfaces" }
kono
parents:
diff changeset
63 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
64 integer :: x(*)
kono
parents:
diff changeset
65 end subroutine ambig2
kono
parents:
diff changeset
66 end interface
kono
parents:
diff changeset
67 interface three
kono
parents:
diff changeset
68 subroutine ambig3(x) ! { dg-error "Ambiguous interfaces" }
kono
parents:
diff changeset
69 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
70 integer :: x
kono
parents:
diff changeset
71 end subroutine ambig3
kono
parents:
diff changeset
72 subroutine ambig4(x) ! { dg-error "Ambiguous interfaces" }
kono
parents:
diff changeset
73 integer :: x
kono
parents:
diff changeset
74 end subroutine ambig4
kono
parents:
diff changeset
75 end interface
kono
parents:
diff changeset
76 end subroutine nine
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 subroutine ten()
kono
parents:
diff changeset
79 interface
kono
parents:
diff changeset
80 subroutine bar()
kono
parents:
diff changeset
81 end subroutine
kono
parents:
diff changeset
82 end interface
kono
parents:
diff changeset
83 type t
kono
parents:
diff changeset
84 contains
kono
parents:
diff changeset
85 procedure, nopass :: proc => bar
kono
parents:
diff changeset
86 end type
kono
parents:
diff changeset
87 type(t) :: xx
kono
parents:
diff changeset
88 call sub(xx) ! { dg-error "is of derived type with type-bound or FINAL procedures" }
kono
parents:
diff changeset
89 contains
kono
parents:
diff changeset
90 subroutine sub(a)
kono
parents:
diff changeset
91 !GCC$ attributes NO_ARG_CHECK :: a
kono
parents:
diff changeset
92 integer :: a
kono
parents:
diff changeset
93 end subroutine sub
kono
parents:
diff changeset
94 end subroutine ten
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 subroutine eleven(x)
kono
parents:
diff changeset
97 external bar
kono
parents:
diff changeset
98 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
99 integer :: x
kono
parents:
diff changeset
100 call bar(x) ! { dg-error "Assumed-type argument x at .1. requires an explicit interface" }
kono
parents:
diff changeset
101 end subroutine eleven
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 subroutine twelf(x)
kono
parents:
diff changeset
104 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
105 integer :: x
kono
parents:
diff changeset
106 call bar(x) ! { dg-error "Type mismatch in argument" }
kono
parents:
diff changeset
107 contains
kono
parents:
diff changeset
108 subroutine bar(x)
kono
parents:
diff changeset
109 integer :: x
kono
parents:
diff changeset
110 end subroutine bar
kono
parents:
diff changeset
111 end subroutine twelf
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 subroutine thirteen(x, y)
kono
parents:
diff changeset
114 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
115 integer :: x
kono
parents:
diff changeset
116 integer :: y(:)
kono
parents:
diff changeset
117 print *, ubound(y, dim=x) ! { dg-error "Variable with NO_ARG_CHECK attribute at .1. is only permitted as argument to the intrinsic functions C_LOC and PRESENT" }
kono
parents:
diff changeset
118 end subroutine thirteen
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 subroutine fourteen(x)
kono
parents:
diff changeset
121 !GCC$ attributes NO_ARG_CHECK :: x
kono
parents:
diff changeset
122 integer :: x
kono
parents:
diff changeset
123 x = x ! { dg-error "with NO_ARG_CHECK attribute may only be used as actual argument" }
kono
parents:
diff changeset
124 end subroutine fourteen