Fix ifunc detection in target-supports.exp file.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / simd5.f90
blob7a5efecac069741b94da6885697133807e0b4367
1 ! { dg-do run }
2 ! { dg-additional-options "-msse2" { target sse2_runtime } }
3 ! { dg-additional-options "-mavx" { target avx_runtime } }
5 integer :: i, j, b, c
6 c = 0
7 i = 4
8 j = 4
9 b = 7
10 !$omp simd linear(b:2) reduction(+:c)
11 do i = 0, 63
12 c = c + b - (7 + 2 * i)
13 b = b + 2
14 end do
15 if (c /= 0 .or. i /= 64 .or. b /= 7 + 64 * 2) call abort
16 i = 4
17 j = 4
18 b = 7
19 !$omp simd linear(b:3) reduction(+:c)
20 do i = 0, 63, 4
21 c = c + b - (7 + i / 4 * 3)
22 b = b + 3
23 end do
24 if (c /= 0 .or. i /= 64 .or. b /= 7 + 16 * 3) call abort
25 i = 4
26 j = 4
27 b = 7
28 !$omp simd linear(i) linear(b:2) reduction(+:c)
29 do i = 0, 63
30 c = c + b - (7 + 2 * i)
31 b = b + 2
32 end do
33 if (c /= 0 .or. i /= 64 .or. b /= 7 + 64 * 2) call abort
34 i = 4
35 j = 4
36 b = 7
37 !$omp simd linear(i:4) linear(b:3) reduction(+:c)
38 do i = 0, 63, 4
39 c = c + b - (7 + i / 4 * 3)
40 b = b + 3
41 end do
42 if (c /= 0 .or. i /= 64 .or. b /= 7 + 16 * 3) call abort
43 i = 4
44 j = 4
45 b = 7
46 !$omp simd collapse(2) linear(b:2) reduction(+:c)
47 do i = 0, 7
48 do j = 0, 7
49 c = c + b - (7 + 2 * j + 2 * 8 * i)
50 b = b + 2
51 end do
52 end do
53 if (c /= 0 .or. i /= 8 .or. j /= 8 .or. b /= 7 + 64 * 2) call abort
54 i = 4
55 j = 4
56 b = 7
57 !$omp simd collapse(2) linear(b:2) reduction(+:c) lastprivate (i, j)
58 do i = 0, 7
59 do j = 0, 7
60 c = c + b - (7 + 2 * j + 2 * 8 * i)
61 b = b + 2
62 end do
63 end do
64 if (c /= 0 .or. i /= 8 .or. j /= 8 .or. b /= 7 + 64 * 2) call abort
65 i = 4
66 j = 4
67 b = 7
68 !$omp parallel do simd schedule (static, 4) linear(b:2) reduction(+:c)
69 do i = 0, 63
70 c = c + b - (7 + 2 * i)
71 b = b + 2
72 end do
73 if (c /= 0 .or. i /= 64 .or. b /= 7 + 64 * 2) call abort
74 i = 4
75 j = 4
76 b = 7
77 !$omp parallel do simd schedule (static, 4) linear(b:3) reduction(+:c)
78 do i = 0, 63, 4
79 c = c + b - (7 + i / 4 * 3)
80 b = b + 3
81 end do
82 if (c /= 0 .or. i /= 64 .or. b /= 7 + 16 * 3) call abort
83 i = 4
84 j = 4
85 b = 7
86 !$omp parallel do simd schedule (static, 4) linear(i) linear(b:2) reduction(+:c)
87 do i = 0, 63
88 c = c + b - (7 + 2 * i)
89 b = b + 2
90 end do
91 if (c /= 0 .or. i /= 64 .or. b /= 7 + 64 * 2) call abort
92 i = 4
93 j = 4
94 b = 7
95 !$omp parallel do simd schedule (static, 4) linear(i:4) linear(b:3) reduction(+:c)
96 do i = 0, 63, 4
97 c = c + b - (7 + i / 4 * 3)
98 b = b + 3
99 end do
100 if (c /= 0 .or. i /= 64 .or. b /= 7 + 16 * 3) call abort
101 i = 4
102 j = 4
103 b = 7
104 !$omp parallel do simd schedule (static, 4) collapse(2) linear(b:2) reduction(+:c)
105 do i = 0, 7
106 do j = 0, 7
107 c = c + b - (7 + 2 * j + 2 * 8 * i)
108 b = b + 2
109 end do
110 end do
111 if (c /= 0 .or. i /= 8 .or. j /= 8 .or. b /= 7 + 64 * 2) call abort
112 i = 4
113 j = 4
114 b = 7
115 !$omp parallel do simd schedule (static, 4) collapse(2) linear(b:2) &
116 !$omp & reduction(+:c) lastprivate (i, j)
117 do i = 0, 7
118 do j = 0, 7
119 c = c + b - (7 + 2 * j + 2 * 8 * i)
120 b = b + 2
121 end do
122 end do
123 if (c /= 0 .or. i /= 8 .or. j /= 8 .or. b /= 7 + 64 * 2) call abort