Skip to content

Commit 735551a

Browse files
committed
[smoke-fort-fails] Add test for SWDEV-523229 and SWDEV-540611
This minimal reproducer shows the same behavior as the tickets listed in the title. A fix has already been merged into amd-staging, adding it to smoke-fort-fails first to make sure it works in the nightlies before moving to smoke-fort.
1 parent 8f25a13 commit 735551a

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include ../../Makefile.defs
2+
3+
TESTNAME = type_bound_proc_target
4+
TESTSRC_MAIN = type_bound_proc_target.f90
5+
TESTSRC_AUX =
6+
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)
7+
8+
FLANG ?= flang
9+
OMP_BIN = $(AOMP)/bin/$(FLANG)
10+
CC = $(OMP_BIN) $(VERBOSE)
11+
#-ccc-print-phases
12+
#"-\#\#\#"
13+
14+
include ../Makefile.rules
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
! Reproducer for tickets SWDEV-523229 and SWDEV-540611.
2+
! Compilation would fail while lowering to LLVM IR due to leftover host
3+
! operations in the device MLIR module.
4+
5+
module mymodule
6+
implicit none
7+
8+
type :: myclass
9+
contains
10+
procedure :: myfunc => myfunc
11+
end type myclass
12+
13+
contains
14+
subroutine myfunc(self)
15+
class(myclass) :: self
16+
end subroutine
17+
end module
18+
19+
program main
20+
use mymodule, only : myclass
21+
implicit none
22+
23+
class(myclass), allocatable :: x
24+
allocate(x)
25+
26+
call x%myfunc()
27+
!$omp target
28+
!$omp end target
29+
30+
deallocate(x)
31+
end program

0 commit comments

Comments
 (0)