Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve83.f90
blobe9d53dd6bd81d946d6df50914f6adde2d534ae97
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m
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
11 contains
13 ! C1543 A prefix shall contain at most one of each prefix-spec.
15 ! R1535 subroutine-stmt is
16 ! [prefix] SUBROUTINE subroutine-name [ ( [dummy-arg-list] )
17 ! [proc-language-binding-spec] ]
19 ! R1526 prefix is
20 ! prefix-spec[prefix-spec]...
22 ! prefix-spec values are:
23 ! declaration-type-spec, ELEMENTAL, IMPURE, MODULE, NON_RECURSIVE,
24 ! PURE, RECURSIVE
26 !ERROR: FUNCTION prefix cannot specify the type more than once
27 real pure real function realFunc()
28 end function realFunc
30 !WARNING: Attribute 'ELEMENTAL' cannot be used more than once
31 elemental real elemental function elementalFunc(x)
32 real, value :: x
33 elementalFunc = x
34 end function elementalFunc
36 !WARNING: Attribute 'IMPURE' cannot be used more than once
37 impure real impure function impureFunc()
38 end function impureFunc
40 !WARNING: Attribute 'PURE' cannot be used more than once
41 pure real pure function pureFunc()
42 end function pureFunc
44 !ERROR: Attributes 'PURE' and 'IMPURE' conflict with each other
45 impure real pure function impurePureFunc()
46 end function impurePureFunc
48 !WARNING: Attribute 'RECURSIVE' cannot be used more than once
49 recursive real recursive function recursiveFunc()
50 end function recursiveFunc
52 !WARNING: Attribute 'NON_RECURSIVE' cannot be used more than once
53 non_recursive real non_recursive function non_recursiveFunc()
54 end function non_recursiveFunc
56 !ERROR: Attributes 'RECURSIVE' and 'NON_RECURSIVE' conflict with each other
57 non_recursive real recursive function non_recursiveRecursiveFunc()
58 end function non_recursiveRecursiveFunc
59 end module m