aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgomp/testsuite/libgomp.fortran/udr11.f90
blob: 61fb196105d5057b2e209f5260056527bbadbfd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
! { dg-do run }

module udr11
  type dt
    integer :: x = 0
  end type
end module udr11
  use udr11, only : dt
!$omp declare reduction(+:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(-:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(*:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(.and.:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(.or.:dt:omp_out%x=omp_out%x+3*omp_in%x)
!$omp declare reduction(.eqv.:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(.neqv.:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(min:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(max:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(iand:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(ior:dt:omp_out%x=omp_out%x+omp_in%x)
!$omp declare reduction(ieor:dt:omp_out%x=omp_out%x+omp_in%x)
  interface operator(.and.)
    function addme1 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme1
    end function addme1
  end interface
  interface operator(.or.)
    function addme2 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme2
    end function addme2
  end interface
  interface operator(.eqv.)
    function addme3 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme3
    end function addme3
  end interface
  interface operator(.neqv.)
    function addme4 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme4
    end function addme4
  end interface
  interface operator(+)
    function addme5 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme5
    end function addme5
  end interface
  interface operator(-)
    function addme6 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme6
    end function addme6
  end interface
  interface operator(*)
    function addme7 (x, y)
      use udr11, only : dt
      type (dt), intent (in) :: x, y
      type(dt) :: addme7
    end function addme7
  end interface
  type(dt) :: j, k, l, m, n, o, p, q, r, s, t, u
  integer :: i
!$omp parallel do reduction(.and.:j) reduction(.or.:k) &
!$omp & reduction(.eqv.:l) reduction(.neqv.:m) &
!$omp & reduction(min:n) reduction(max:o) &
!$omp & reduction(iand:p) reduction(ior:q) reduction (ieor:r) &
!$omp & reduction(+:s) reduction(-:t) reduction(*:u)
  do i = 1, 100
    j%x = j%x + i
    k%x = k%x + 2 * i
    l%x = l%x + 3 * i
    m%x = m%x + i
    n%x = n%x + 2 * i
    o%x = o%x + 3 * i
    p%x = p%x + i
    q%x = q%x + 2 * i
    r%x = r%x + 3 * i
    s%x = s%x + i
    t%x = t%x + 2 * i
    u%x = u%x + 3 * i
  end do
  if (j%x /= 5050 .or. k%x /= 30300 .or. l%x /= 15150) call abort
  if (m%x /= 5050 .or. n%x /= 10100 .or. o%x /= 15150) call abort
  if (p%x /= 5050 .or. q%x /= 10100 .or. r%x /= 15150) call abort
  if (s%x /= 5050 .or. t%x /= 10100 .or. u%x /= 15150) call abort
end