]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix atomic_capture-1.f90 testcase
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 11 Nov 2020 12:50:34 +0000 (12:50 +0000)
committerAndrew Stubbs <ams@codesourcery.com>
Wed, 25 Nov 2020 13:55:45 +0000 (13:55 +0000)
The testcase had invalid assumptions about which loop iterations would run
first and last.

libgomp/ChangeLog

* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90 (main): Adjust
expected results.

libgomp/testsuite/libgomp.oacc-fortran/atomic_capture-1.f90

index 536b3f0030c0b2fa61f4db4d40aa1d7169c1d387..0b923d5c5bfbb5eaf2709beb867300433f722bac 100644 (file)
@@ -299,7 +299,7 @@ program main
   ! At most one iarr element can be 0.
   do i = 1, N
      if ((iarr(i) == 0 .and. i /= itmp) &
-         .or. iarr(i) < 0 .or. iarr(i) >= N) STOP 35
+         .or. iarr(i) < 0 .or. iarr(i) > N) STOP 35
   end do
   if (igot /= iexp) STOP 36
 
@@ -336,7 +336,7 @@ program main
 
   !$acc parallel loop copy (igot, itmp)
     do i = 0, N - 1
-      iexpr = ibclr (-2, i)
+      iexpr = ibclr (-1, i)
   !$acc atomic capture
       iarr(i) = igot
       igot = iand (igot, iexpr)
@@ -345,7 +345,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) < 0)) STOP 39
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 39
   end do
   if (igot /= iexp) STOP 40
 
@@ -363,7 +363,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) >= 0)) STOP 41
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 41
   end do
   if (igot /= iexp) STOP 42
 
@@ -381,7 +381,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) < 0)) STOP 43
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 43
   end do
   if (igot /= iexp) STOP 44
 
@@ -398,7 +398,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (1 <= iarr(i) .and. iarr(i) < iexp)) STOP 45
+     if (.not. (1 <= iarr(i) .and. iarr(i) <= iexp)) STOP 45
   end do
   if (igot /= iexp) STOP 46
 
@@ -415,7 +415,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i) == 1 .or. iarr(i) == N)) STOP 47
+     if (.not. (iarr(i) >= 1 .or. iarr(i) <= N)) STOP 47
   end do
   if (igot /= iexp) STOP 48
 
@@ -424,7 +424,7 @@ program main
 
   !$acc parallel loop copy (igot, itmp)
     do i = 0, N - 1
-      iexpr = ibclr (-2, i)
+      iexpr = ibclr (-1, i)
   !$acc atomic capture
       iarr(i) = igot
       igot = iand (iexpr, igot)
@@ -433,7 +433,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) < 0)) STOP 49
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 49
   end do
   if (igot /= iexp) STOP 50
 
@@ -451,7 +451,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) >= 0)) STOP 51
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 51
   end do
   if (igot /= iexp) STOP 52
 
@@ -469,7 +469,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) < 0)) STOP 53
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 53
   end do
   if (igot /= iexp) STOP 54
 
@@ -755,7 +755,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i) == iexp)) STOP 89
+     if (.not. (iarr(i) <= i)) STOP 89
   end do
   if (igot /= iexp) STOP 90
 
@@ -773,7 +773,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) <= 0)) STOP 91
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 91
   end do
   if (igot /= iexp) STOP 92
 
@@ -791,7 +791,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) >= -1)) STOP 93
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 93
   end do
   if (igot /= iexp) STOP 94
 
@@ -809,7 +809,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) <= 0)) STOP 95
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 95
   end do
   if (igot /= iexp) STOP 96
 
@@ -843,7 +843,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i) == iexp )) STOP 99
+     if (.not. (iarr(i) <= i)) STOP 99
   end do
   if (igot /= iexp) STOP 100
 
@@ -861,7 +861,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) <= 0)) STOP 101
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 101
   end do
   if (igot /= iexp) STOP 102
 
@@ -879,7 +879,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) >= iexp)) STOP 103
+     if (.not. (popcnt(iarr(i - 1)) > 0)) STOP 103
   end do
   if (igot /= iexp) STOP 104
 
@@ -897,7 +897,7 @@ program main
   !$acc end parallel loop
 
   do i = 1, N
-     if (.not. (iarr(i - 1) <= iexp)) STOP 105
+     if (.not. (popcnt(iarr(i - 1)) < 32)) STOP 105
   end do
   if (igot /= iexp) STOP 106