| 1 |
! RUN: %python %S/../test_errors.py %s %flang -fopenacc |
| 2 |
|
| 3 |
! Check OpenACC reduction validity. |
| 4 |
|
| 5 |
program openacc_reduction_validity |
| 6 |
|
| 7 |
integer :: i |
| 8 |
real :: r |
| 9 |
complex :: c |
| 10 |
logical :: l |
| 11 |
|
| 12 |
!$acc parallel reduction(+:i) |
| 13 |
!$acc end parallel |
| 14 |
|
| 15 |
!$acc parallel reduction(*:i) |
| 16 |
!$acc end parallel |
| 17 |
|
| 18 |
!$acc parallel reduction(min:i) |
| 19 |
!$acc end parallel |
| 20 |
|
| 21 |
!$acc parallel reduction(max:i) |
| 22 |
!$acc end parallel |
| 23 |
|
| 24 |
!$acc parallel reduction(iand:i) |
| 25 |
!$acc end parallel |
| 26 |
|
| 27 |
!$acc parallel reduction(ior:i) |
| 28 |
!$acc end parallel |
| 29 |
|
| 30 |
!$acc parallel reduction(ieor:i) |
| 31 |
!$acc end parallel |
| 32 |
|
| 33 |
!ERROR: reduction operator not supported for integer type |
| 34 |
!$acc parallel reduction(.and.:i) |
| 35 |
!$acc end parallel |
| 36 |
|
| 37 |
!ERROR: reduction operator not supported for integer type |
| 38 |
!$acc parallel reduction(.or.:i) |
| 39 |
!$acc end parallel |
| 40 |
|
| 41 |
!ERROR: reduction operator not supported for integer type |
| 42 |
!$acc parallel reduction(.eqv.:i) |
| 43 |
!$acc end parallel |
| 44 |
|
| 45 |
!ERROR: reduction operator not supported for integer type |
| 46 |
!$acc parallel reduction(.neqv.:i) |
| 47 |
!$acc end parallel |
| 48 |
|
| 49 |
!$acc parallel reduction(+:r) |
| 50 |
!$acc end parallel |
| 51 |
|
| 52 |
!$acc parallel reduction(*:r) |
| 53 |
!$acc end parallel |
| 54 |
|
| 55 |
!$acc parallel reduction(min:r) |
| 56 |
!$acc end parallel |
| 57 |
|
| 58 |
!$acc parallel reduction(max:r) |
| 59 |
!$acc end parallel |
| 60 |
|
| 61 |
!ERROR: reduction operator not supported for real type |
| 62 |
!$acc parallel reduction(iand:r) |
| 63 |
!$acc end parallel |
| 64 |
|
| 65 |
!ERROR: reduction operator not supported for real type |
| 66 |
!$acc parallel reduction(ior:r) |
| 67 |
!$acc end parallel |
| 68 |
|
| 69 |
!ERROR: reduction operator not supported for real type |
| 70 |
!$acc parallel reduction(ieor:r) |
| 71 |
!$acc end parallel |
| 72 |
|
| 73 |
!ERROR: reduction operator not supported for real type |
| 74 |
!$acc parallel reduction(.and.:r) |
| 75 |
!$acc end parallel |
| 76 |
|
| 77 |
!ERROR: reduction operator not supported for real type |
| 78 |
!$acc parallel reduction(.or.:r) |
| 79 |
!$acc end parallel |
| 80 |
|
| 81 |
!ERROR: reduction operator not supported for real type |
| 82 |
!$acc parallel reduction(.eqv.:r) |
| 83 |
!$acc end parallel |
| 84 |
|
| 85 |
!ERROR: reduction operator not supported for real type |
| 86 |
!$acc parallel reduction(.neqv.:r) |
| 87 |
!$acc end parallel |
| 88 |
|
| 89 |
!$acc parallel reduction(+:c) |
| 90 |
!$acc end parallel |
| 91 |
|
| 92 |
!$acc parallel reduction(*:c) |
| 93 |
!$acc end parallel |
| 94 |
|
| 95 |
!ERROR: reduction operator not supported for complex type |
| 96 |
!$acc parallel reduction(min:c) |
| 97 |
!$acc end parallel |
| 98 |
|
| 99 |
!ERROR: reduction operator not supported for complex type |
| 100 |
!$acc parallel reduction(max:c) |
| 101 |
!$acc end parallel |
| 102 |
|
| 103 |
!ERROR: reduction operator not supported for complex type |
| 104 |
!$acc parallel reduction(iand:c) |
| 105 |
!$acc end parallel |
| 106 |
|
| 107 |
!ERROR: reduction operator not supported for complex type |
| 108 |
!$acc parallel reduction(ior:c) |
| 109 |
!$acc end parallel |
| 110 |
|
| 111 |
!ERROR: reduction operator not supported for complex type |
| 112 |
!$acc parallel reduction(ieor:c) |
| 113 |
!$acc end parallel |
| 114 |
|
| 115 |
!ERROR: reduction operator not supported for complex type |
| 116 |
!$acc parallel reduction(.and.:c) |
| 117 |
!$acc end parallel |
| 118 |
|
| 119 |
!ERROR: reduction operator not supported for complex type |
| 120 |
!$acc parallel reduction(.or.:c) |
| 121 |
!$acc end parallel |
| 122 |
|
| 123 |
!ERROR: reduction operator not supported for complex type |
| 124 |
!$acc parallel reduction(.eqv.:c) |
| 125 |
!$acc end parallel |
| 126 |
|
| 127 |
!ERROR: reduction operator not supported for complex type |
| 128 |
!$acc parallel reduction(.neqv.:c) |
| 129 |
!$acc end parallel |
| 130 |
|
| 131 |
!$acc parallel reduction(.and.:l) |
| 132 |
!$acc end parallel |
| 133 |
|
| 134 |
!$acc parallel reduction(.or.:l) |
| 135 |
!$acc end parallel |
| 136 |
|
| 137 |
!$acc parallel reduction(.eqv.:l) |
| 138 |
!$acc end parallel |
| 139 |
|
| 140 |
!$acc parallel reduction(.neqv.:l) |
| 141 |
!$acc end parallel |
| 142 |
|
| 143 |
!ERROR: reduction operator not supported for logical type |
| 144 |
!$acc parallel reduction(+:l) |
| 145 |
!$acc end parallel |
| 146 |
|
| 147 |
!ERROR: reduction operator not supported for logical type |
| 148 |
!$acc parallel reduction(*:l) |
| 149 |
!$acc end parallel |
| 150 |
|
| 151 |
!ERROR: reduction operator not supported for logical type |
| 152 |
!$acc parallel reduction(min:l) |
| 153 |
!$acc end parallel |
| 154 |
|
| 155 |
!ERROR: reduction operator not supported for logical type |
| 156 |
!$acc parallel reduction(max:l) |
| 157 |
!$acc end parallel |
| 158 |
|
| 159 |
!ERROR: reduction operator not supported for logical type |
| 160 |
!$acc parallel reduction(iand:l) |
| 161 |
!$acc end parallel |
| 162 |
|
| 163 |
!ERROR: reduction operator not supported for logical type |
| 164 |
!$acc parallel reduction(ior:l) |
| 165 |
!$acc end parallel |
| 166 |
|
| 167 |
!ERROR: reduction operator not supported for logical type |
| 168 |
!$acc parallel reduction(ieor:l) |
| 169 |
!$acc end parallel |
| 170 |
|
| 171 |
|
| 172 |
end program |