2011-02-15 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / pure_dummy_length_1.f90
blobc1bc17224311d281366e9a43ac0a5f731d6f3a35
1 ! { dg-do compile }
2 ! Tests fix for PR26107 in which an ICE would occur after the second
3 ! error message below. This resulted from a spurious attempt to
4 ! produce the third error message, without the name of the function.
6 ! This is an expanded version of the testcase in the PR.
8 pure function equals(self, & ! { dg-error "must be INTENT" }
9 string, ignore_case) result(same)
10 character(*), intent(in) :: string
11 integer(4), intent(in) :: ignore_case
12 integer(4) :: same
13 if (len (self) < 1) return ! { dg-error "must be CHARACTER" }
14 same = 1
15 end function
17 function impure(self) result(ival)
18 character(*), intent(in) :: self
19 ival = 1
20 end function
22 pure function purity(self, string, ignore_case) result(same)
23 character(*), intent(in) :: self
24 character(*), intent(in) :: string
25 integer(4), intent(in) :: ignore_case
26 integer i
27 if (end > impure (self)) & ! { dg-error "non-PURE procedure" }
28 return
29 end function