Skip to content

Commit cdbdf7f

Browse files
committed
Addition of a test that triggers an error with GFortran 11 and 12
1 parent b8fbb3c commit cdbdf7f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/bitsets/test_stdlib_bitset_64.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ subroutine test_initialization(error)
231231

232232
type(bitset_64) :: set4, set5
233233

234+
!The following block triggers an issue in gfortran 11 and 12
235+
block
236+
type(bitset_64) :: set6
237+
call check(error, set6 % bits(), 0, &
238+
'set6 % bits() returned non-zero value '//&
239+
'even though set6 was not initialized.')
240+
if (allocated(error)) return
241+
end block
242+
234243
set5 = log1
235244
call check(error, set5%bits(), 64, &
236245
'initialization with logical(int8) failed to set the right size.')

test/bitsets/test_stdlib_bitset_large.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,15 @@ subroutine test_initialization(error)
345345
logical(int64), allocatable :: log8(:)
346346
type(bitset_large) :: set4, set5
347347

348+
!The following triggers an issue in gfortran 11 and 12
349+
block
350+
type(bitset_large) :: set6
351+
call check(error, set6 % bits(), 0, &
352+
'set6 % bits() returned non-zero value '//&
353+
'even though set6 was not initialized.')
354+
if (allocated(error)) return
355+
end block
356+
348357
set5 = log1
349358
call check(error, set5 % bits(), 64, &
350359
' initialization with logical(int8) failed to set' // &

0 commit comments

Comments
 (0)