|
| 1 | +! RUN: %python %S/test_errors.py %s %flang_fc1 |
| 2 | +module m |
| 3 | + interface operator(-) |
| 4 | + !ERROR: OPERATOR(-) function 'f1' conflicts with intrinsic operator |
| 5 | + function f1(x) |
| 6 | + real, intent(in) :: x |
| 7 | + end |
| 8 | + !ERROR: OPERATOR(-) function 'f2' conflicts with intrinsic operator |
| 9 | + attributes(device) function f2(x) |
| 10 | + real, intent(in), device :: x(:) |
| 11 | + end |
| 12 | + function f3(x) ! ok |
| 13 | + real, intent(in), device :: x(:,:) |
| 14 | + end |
| 15 | + !ERROR: OPERATOR(-) function 'f4' conflicts with intrinsic operator |
| 16 | + attributes(device) function f4(x) |
| 17 | + real, intent(in) :: x(:,:,:) |
| 18 | + end |
| 19 | + !ERROR: OPERATOR(-) function 'f5' conflicts with intrinsic operator |
| 20 | + function f5(x) |
| 21 | + real, intent(in), unified :: x(:,:,:,:) |
| 22 | + end |
| 23 | + !ERROR: OPERATOR(-) function 'f6' conflicts with intrinsic operator |
| 24 | + attributes(device) function f6(x) |
| 25 | + real, intent(in), managed :: x(:,:,:,:,:) |
| 26 | + end |
| 27 | + end interface |
| 28 | + interface operator(*) |
| 29 | + !ERROR: OPERATOR(*) function 'f11' conflicts with intrinsic operator |
| 30 | + function f11(x, y) |
| 31 | + real, intent(in) :: x, y |
| 32 | + end |
| 33 | + !ERROR: OPERATOR(*) function 'f12' conflicts with intrinsic operator |
| 34 | + attributes(device) function f12(x, y) |
| 35 | + real, intent(in), device :: x, y(:) |
| 36 | + end |
| 37 | + !ERROR: OPERATOR(*) function 'f13' conflicts with intrinsic operator |
| 38 | + attributes(device) function f13(x, y) |
| 39 | + real, intent(in) :: x(:), y |
| 40 | + end |
| 41 | + function f14a(x, y) ! ok |
| 42 | + real, intent(in), device :: x(:) |
| 43 | + real, intent(in) :: y(:) |
| 44 | + end |
| 45 | + function f14b(x, y) ! ok |
| 46 | + real, intent(in) :: x |
| 47 | + real, intent(in), device :: y(:,:) |
| 48 | + end |
| 49 | + !ERROR: OPERATOR(*) function 'f15' conflicts with intrinsic operator |
| 50 | + function f15(x, y) |
| 51 | + real, intent(in) :: x(:,:) |
| 52 | + real, intent(in), unified :: y |
| 53 | + end |
| 54 | + !ERROR: OPERATOR(*) function 'f16' conflicts with intrinsic operator |
| 55 | + attributes(device) function f16(x, y) |
| 56 | + real, intent(in), device :: x(:,:) |
| 57 | + real, intent(in), managed :: y(:,:) |
| 58 | + end |
| 59 | + end interface |
| 60 | + interface assignment(=) |
| 61 | + !ERROR: Defined assignment subroutine 's1' conflicts with intrinsic assignment |
| 62 | + subroutine s1(x, y) |
| 63 | + real, intent(in out) :: x |
| 64 | + real, intent(in) :: y |
| 65 | + end |
| 66 | + !ERROR: Defined assignment subroutine 's2' conflicts with intrinsic assignment |
| 67 | + attributes(device) subroutine s2(x, y) |
| 68 | + real, intent(in out), device :: x(:) |
| 69 | + real, intent(in), device :: y |
| 70 | + end |
| 71 | + !ERROR: Defined assignment subroutine 's3' conflicts with intrinsic assignment |
| 72 | + attributes(device) subroutine s3(x, y) |
| 73 | + real, intent(in out) :: x(:) |
| 74 | + real, intent(in) :: y(:) |
| 75 | + end |
| 76 | + subroutine s4a(x, y) ! ok |
| 77 | + real, intent(in out), device :: x(:,:) |
| 78 | + real, intent(in) :: y |
| 79 | + end |
| 80 | + subroutine s4b(x, y) ! ok |
| 81 | + real, intent(in out) :: x(:,:) |
| 82 | + real, intent(in), device :: y(:,:) |
| 83 | + end |
| 84 | + !ERROR: Defined assignment subroutine 's5' conflicts with intrinsic assignment |
| 85 | + subroutine s5(x, y) |
| 86 | + real, intent(in out) :: x(:,:,:) |
| 87 | + real, intent(in), unified :: y |
| 88 | + end |
| 89 | + !ERROR: Defined assignment subroutine 's6' conflicts with intrinsic assignment |
| 90 | + attributes(device) subroutine s6(x, y) |
| 91 | + real, intent(in out), device :: x(:,:,:) |
| 92 | + real, intent(in), managed :: y(:,:,:) |
| 93 | + end |
| 94 | + end interface |
| 95 | +end |
0 commit comments