60 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3 4 ! For C15435 interface intFace6 !WARNING: Attribute 'MODULE' cannot be used more than once [-Wredundant-attribute]7 module pure module real function moduleFunc()8 end function moduleFunc9 end interface10 11contains12 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 is20! prefix-spec[prefix-spec]...21! 22! prefix-spec values are:23! declaration-type-spec, ELEMENTAL, IMPURE, MODULE, NON_RECURSIVE, 24! PURE, RECURSIVE25 26 !ERROR: FUNCTION prefix cannot specify the type more than once27 real pure real function realFunc()28 end function realFunc29 30 !WARNING: Attribute 'ELEMENTAL' cannot be used more than once [-Wredundant-attribute]31 elemental real elemental function elementalFunc(x)32 real, value :: x33 elementalFunc = x34 end function elementalFunc35 36 !WARNING: Attribute 'IMPURE' cannot be used more than once [-Wredundant-attribute]37 impure real impure function impureFunc()38 end function impureFunc39 40 !WARNING: Attribute 'PURE' cannot be used more than once [-Wredundant-attribute]41 pure real pure function pureFunc()42 end function pureFunc43 44 !ERROR: Attributes 'PURE' and 'IMPURE' conflict with each other45 impure real pure function impurePureFunc()46 end function impurePureFunc47 48 !WARNING: Attribute 'RECURSIVE' cannot be used more than once [-Wredundant-attribute]49 recursive real recursive function recursiveFunc()50 end function recursiveFunc51 52 !WARNING: Attribute 'NON_RECURSIVE' cannot be used more than once [-Wredundant-attribute]53 non_recursive real non_recursive function non_recursiveFunc()54 end function non_recursiveFunc55 56 !ERROR: Attributes 'RECURSIVE' and 'NON_RECURSIVE' conflict with each other57 non_recursive real recursive function non_recursiveRecursiveFunc()58 end function non_recursiveRecursiveFunc59end module m60