Skip to content

Commit c3c542d

Browse files
committed
Wrote test to check polymorphic array handling in where construct
1 parent 4e93cc9 commit c3c542d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
! RUN: bbc -emit-fir %s -o - | FileCheck %s
2+
3+
! Checks that no fir store is present with fir.class<none> as the first operand.
4+
! Regression test for bug: FIR lowering failure on polymorphic assignment.
5+
6+
! CHECK-NOT: fir.store{{.*}}!fir.class<none>
7+
module m1
8+
type x
9+
end type x
10+
logical,parameter::t=.true.,f=.false.
11+
logical::mask(3)=[t,f,t]
12+
end module m1
13+
14+
subroutine s1
15+
use m1
16+
class(*),allocatable::v(:),u(:)
17+
allocate(x::v(3))
18+
allocate(x::u(3))
19+
where(mask)
20+
u=v
21+
end where
22+
end subroutine s1
23+
24+
program main
25+
call s1
26+
print *,'pass'
27+
end program main

0 commit comments

Comments
 (0)