Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flang/lib/Semantics/check-cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ struct FindHostArray
return (*this)(x.base());
}
Result operator()(const Symbol &symbol) const {
if (symbol.IsFuncResult()) {
return nullptr;
}
if (const auto *details{
symbol.GetUltimate().detailsIf<semantics::ObjectEntityDetails>()}) {
if (details->IsArray() &&
Expand Down
6 changes: 6 additions & 0 deletions flang/test/Semantics/cuf09.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ module m
if (i .le. N) a(i) = m(i)
end subroutine

attributes(device) function devfct(r1, r2) result(res)
real(4), intent(in) :: r1(3), r2(3)
real(4) :: res(3)
res = r1 - r2 ! Do not error on function result
end function

attributes(global) subroutine hostparameter(a)
integer :: a(*)
i = threadIdx%x
Expand Down