udr11.f90 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ! { dg-do run }
  2. module udr11
  3. type dt
  4. integer :: x = 0
  5. end type
  6. end module udr11
  7. use udr11, only : dt
  8. !$omp declare reduction(+:dt:omp_out%x=omp_out%x+omp_in%x)
  9. !$omp declare reduction(-:dt:omp_out%x=omp_out%x+omp_in%x)
  10. !$omp declare reduction(*:dt:omp_out%x=omp_out%x+omp_in%x)
  11. !$omp declare reduction(.and.:dt:omp_out%x=omp_out%x+omp_in%x)
  12. !$omp declare reduction(.or.:dt:omp_out%x=omp_out%x+3*omp_in%x)
  13. !$omp declare reduction(.eqv.:dt:omp_out%x=omp_out%x+omp_in%x)
  14. !$omp declare reduction(.neqv.:dt:omp_out%x=omp_out%x+omp_in%x)
  15. !$omp declare reduction(min:dt:omp_out%x=omp_out%x+omp_in%x)
  16. !$omp declare reduction(max:dt:omp_out%x=omp_out%x+omp_in%x)
  17. !$omp declare reduction(iand:dt:omp_out%x=omp_out%x+omp_in%x)
  18. !$omp declare reduction(ior:dt:omp_out%x=omp_out%x+omp_in%x)
  19. !$omp declare reduction(ieor:dt:omp_out%x=omp_out%x+omp_in%x)
  20. interface operator(.and.)
  21. function addme1 (x, y)
  22. use udr11, only : dt
  23. type (dt), intent (in) :: x, y
  24. type(dt) :: addme1
  25. end function addme1
  26. end interface
  27. interface operator(.or.)
  28. function addme2 (x, y)
  29. use udr11, only : dt
  30. type (dt), intent (in) :: x, y
  31. type(dt) :: addme2
  32. end function addme2
  33. end interface
  34. interface operator(.eqv.)
  35. function addme3 (x, y)
  36. use udr11, only : dt
  37. type (dt), intent (in) :: x, y
  38. type(dt) :: addme3
  39. end function addme3
  40. end interface
  41. interface operator(.neqv.)
  42. function addme4 (x, y)
  43. use udr11, only : dt
  44. type (dt), intent (in) :: x, y
  45. type(dt) :: addme4
  46. end function addme4
  47. end interface
  48. interface operator(+)
  49. function addme5 (x, y)
  50. use udr11, only : dt
  51. type (dt), intent (in) :: x, y
  52. type(dt) :: addme5
  53. end function addme5
  54. end interface
  55. interface operator(-)
  56. function addme6 (x, y)
  57. use udr11, only : dt
  58. type (dt), intent (in) :: x, y
  59. type(dt) :: addme6
  60. end function addme6
  61. end interface
  62. interface operator(*)
  63. function addme7 (x, y)
  64. use udr11, only : dt
  65. type (dt), intent (in) :: x, y
  66. type(dt) :: addme7
  67. end function addme7
  68. end interface
  69. type(dt) :: j, k, l, m, n, o, p, q, r, s, t, u
  70. integer :: i
  71. !$omp parallel do reduction(.and.:j) reduction(.or.:k) &
  72. !$omp & reduction(.eqv.:l) reduction(.neqv.:m) &
  73. !$omp & reduction(min:n) reduction(max:o) &
  74. !$omp & reduction(iand:p) reduction(ior:q) reduction (ieor:r) &
  75. !$omp & reduction(+:s) reduction(-:t) reduction(*:u)
  76. do i = 1, 100
  77. j%x = j%x + i
  78. k%x = k%x + 2 * i
  79. l%x = l%x + 3 * i
  80. m%x = m%x + i
  81. n%x = n%x + 2 * i
  82. o%x = o%x + 3 * i
  83. p%x = p%x + i
  84. q%x = q%x + 2 * i
  85. r%x = r%x + 3 * i
  86. s%x = s%x + i
  87. t%x = t%x + 2 * i
  88. u%x = u%x + 3 * i
  89. end do
  90. if (j%x /= 5050 .or. k%x /= 30300 .or. l%x /= 15150) call abort
  91. if (m%x /= 5050 .or. n%x /= 10100 .or. o%x /= 15150) call abort
  92. if (p%x /= 5050 .or. q%x /= 10100 .or. r%x /= 15150) call abort
  93. if (s%x /= 5050 .or. t%x /= 10100 .or. u%x /= 15150) call abort
  94. end