Files
llvm-project/flang/test/Semantics/bug2359.f90
Peter Klausler 440a5b570f [flang] Fix SELECT TYPE in OpenACC construct (#186511)
A routine in Semantics/resolve-directives.cpp was overwriting a symbol
table pointer in a parse tree Name, thereby removing the AssocEntity
with the correct type for a TYPE IS or CLASS IS clause that had been
placed there. I don't really understand why resolve-directives has to
overwrite symbol table pointers in the first place, but it definitely
shouldn't be replacing these.
2026-03-13 15:50:51 -07:00

34 lines
748 B
Fortran

! RUN: %python %S/test_symbols.py %s %flang_fc1 -fopenacc
!DEF: /MAIN MainProgram
program MAIN
!DEF: /MAIN/t ABSTRACT DerivedType
type, abstract :: t
end type
!REF: /MAIN/t
!DEF: /MAIN/t2 DerivedType
type, extends(t) :: t2
!DEF: /MAIN/t2/y ObjectEntity REAL(4)
real :: y
end type
contains
!DEF: /MAIN/s (Subroutine) Subprogram
!DEF: /MAIN/s/d ObjectEntity CLASS(t)
subroutine s (d)
!REF: /MAIN/t
!REF: /MAIN/s/d
class(t) :: d
!DEF: /MAIN/s/a ObjectEntity REAL(4)
real a
!$acc data create(a)
!REF: /MAIN/s/d
select type (d)
!REF: /MAIN/t2
class is (t2)
!DEF: /MAIN/s/OpenACCConstruct1/OtherConstruct1/d AssocEntity CLASS(t2)
!REF: /MAIN/t2/y
d%y = 1.
end select
!$acc end data
end subroutine
end program