aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-06 23:18:08 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-14 15:41:33 +0100
commit25242ed8eb93613af6f296785da2d4ece816b7d6 (patch)
treee4cabccd400293251ddd29e724049f4cde033ea7 /libgomp/testsuite
parent9349aefa1df7ae36714b7b9f426ad46e314892d1 (diff)
downloadgcc-25242ed8eb93613af6f296785da2d4ece816b7d6.zip
gcc-25242ed8eb93613af6f296785da2d4ece816b7d6.tar.gz
gcc-25242ed8eb93613af6f296785da2d4ece816b7d6.tar.bz2
Fix 'char' initialization, copy, check in 'libgomp.oacc-fortran/acc-memcpy.f90'
Our dear friend '-Wuninitialized' reported: [...]/libgomp.oacc-fortran/acc-memcpy.f90:18:27: 18 | char(j) = int (j, int8) | ^ Warning: ā€˜jā€™ may be used uninitialized [-Wmaybe-uninitialized] [...]/libgomp.oacc-fortran/acc-memcpy.f90:14:20: 14 | integer(int8) :: j | ^ note: ā€˜jā€™ was declared here ..., but actually there were other issues. libgomp/ * testsuite/libgomp.oacc-fortran/acc-memcpy.f90: Fix 'char' initialization, copy, check.
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/acc-memcpy.f908
1 files changed, 3 insertions, 5 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/acc-memcpy.f90 b/libgomp/testsuite/libgomp.oacc-fortran/acc-memcpy.f90
index 670dc50..844d08a 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/acc-memcpy.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/acc-memcpy.f90
@@ -11,15 +11,14 @@ program main
integer(int8), allocatable :: char(:)
type(c_ptr) :: dptr
integer(c_intptr_t) :: i
- integer(int8) :: j
allocate(char(-128:127))
do i = -128, 127
- char(j) = int (j, int8)
+ char(i) = int (i, int8)
end do
dptr = acc_malloc (256_c_size_t)
- call acc_memcpy_to_device (dptr, char, 255_c_size_t)
+ call acc_memcpy_to_device (dptr, char, 256_c_size_t)
do i = 0, 255
if (acc_is_present (transfer (transfer(char, i) + i, dptr), 1)) &
@@ -31,8 +30,7 @@ program main
call acc_memcpy_from_device (char, dptr, 256_c_size_t)
do i = -128, 127
- char(i) = int (j, int8)
- if (char(i) /= j) &
+ if (char(i) /= i) &
stop 2
end do