• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: %S/test_errors.sh %s %t %f18
2module m
3
4  ! For C1543
5  interface intFace
6    !WARNING: Attribute 'MODULE' cannot be used more than once
7    module pure module real function moduleFunc()
8    end function moduleFunc
9  end interface
10
11contains
12
13! C1543 A prefix shall contain at most one of each prefix-spec.
14!
15! R1535 subroutine-stmt is
16!   [prefix] SUBROUTINE subroutine-name [ ( [dummy-arg-list] )
17!   [proc-language-binding-spec] ]
18!
19! R1526  prefix is
20!   prefix-spec[prefix-spec]...
21!
22!   prefix-spec values are:
23!      declaration-type-spec, ELEMENTAL, IMPURE, MODULE, NON_RECURSIVE,
24!      PURE, RECURSIVE
25
26    !ERROR: FUNCTION prefix cannot specify the type more than once
27    real pure real function realFunc()
28    end function realFunc
29
30    !WARNING: Attribute 'ELEMENTAL' cannot be used more than once
31    elemental real elemental function elementalFunc()
32    end function elementalFunc
33
34    !WARNING: Attribute 'IMPURE' cannot be used more than once
35    impure real impure function impureFunc()
36    end function impureFunc
37
38    !WARNING: Attribute 'PURE' cannot be used more than once
39    pure real pure function pureFunc()
40    end function pureFunc
41
42    !ERROR: Attributes 'PURE' and 'IMPURE' conflict with each other
43    impure real pure function impurePureFunc()
44    end function impurePureFunc
45
46    !WARNING: Attribute 'RECURSIVE' cannot be used more than once
47    recursive real recursive function recursiveFunc()
48    end function recursiveFunc
49
50    !WARNING: Attribute 'NON_RECURSIVE' cannot be used more than once
51    non_recursive real non_recursive function non_recursiveFunc()
52    end function non_recursiveFunc
53
54    !ERROR: Attributes 'RECURSIVE' and 'NON_RECURSIVE' conflict with each other
55    non_recursive real recursive function non_recursiveRecursiveFunc()
56    end function non_recursiveRecursiveFunc
57end module m
58