aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/spellcheck-structure.f90
blob: 929e05f21519538864f7f0a44e2ab77d9b797180 (plain)
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
! { dg-do compile }
! test levenshtein based spelling suggestions
implicit none

!!!!!!!!!!!!!! structure tests !!!!!!!!!!!!!!
type type1
   real :: radius
   integer :: i
end type type1

type type2
  integer :: myint
  type(type1) :: mytype
end type type2

type type3
  type(type2) :: type_2
end type type3
type type4
  type(type3) :: type_3
end type type4

type(type1) :: t1
t1%radiuz = .0 ! { dg-error ".radiuz. at .1. is not a member of the .type1. structure; did you mean .radius.\\?" }
t1%x = .0 ! { dg-error ".x. at .1. is not a member of the .type1. structure" }
type(type2) :: t2
t2%mytape%radius = .0 ! { dg-error ".mytape. at .1. is not a member of the .type2. structure; did you mean .mytype.\\?" }
t2%mytype%radious = .0 ! { dg-error ".radious. at .1. is not a member of the .type1. structure; did you mean .radius.\\?" }
type(type4) :: t4
t4%type_3%type_2%mytype%radium = 88.0 ! { dg-error ".radium. at .1. is not a member of the .type1. structure; did you mean .radius.\\?" }

!!!!!!!!!!!!!! symbol tests !!!!!!!!!!!!!!
integer :: iarg1
iarg2 = 1 ! { dg-error "Symbol .iarg2. at .1. has no IMPLICIT type; did you mean .iarg1.\\?" }
end