OSDN Git Service

2006-09-19 Jack Howarth <howarth@bromo.med.uc.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / pure_dummy_length_1.f90
1 ! { dg-do compile }\r
2 ! Tests fix for PR26107 in which an ICE would occur after the second\r
3 ! error message below.  This resulted from a spurious attempt to\r
4 ! produce the third error message, without the name of the function.\r
5 !\r
6 ! This is an expanded version of the testcase in the PR.\r
7 !\r
8    pure function equals(self, &     ! { dg-error "must be INTENT" }\r
9                         string, ignore_case) result(same)\r
10          character(*), intent(in) :: string\r
11          integer(4), intent(in) :: ignore_case\r
12          integer(4) :: same\r
13          if (len (self) < 1) return ! { dg-error "Type of argument" }\r
14          same = 1\r
15    end function\r
16 \r
17    function impure(self) result(ival)\r
18          character(*), intent(in) :: self\r
19          ival = 1\r
20    end function\r
21 \r
22    pure function purity(self, string, ignore_case) result(same)\r
23          character(*), intent(in) :: self\r
24          character(*), intent(in) :: string\r
25          integer(4), intent(in) :: ignore_case\r
26          integer i\r
27          if (end > impure (self)) & ! { dg-error "non-PURE procedure" }\r
28            return\r
29    end function\r