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
6 changes: 3 additions & 3 deletions flang/lib/Semantics/resolve-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8958,9 +8958,9 @@ void ResolveNamesVisitor::FinishSpecificationPart(
? currScope().symbol()->detailsIf<SubprogramDetails>()
: nullptr}) {
if (auto attrs{subp->cudaSubprogramAttrs()}) {
if (*attrs != common::CUDASubprogramAttrs::Device ||
*attrs != common::CUDASubprogramAttrs::Global ||
*attrs != common::CUDASubprogramAttrs::Grid_Global) {
if (*attrs == common::CUDASubprogramAttrs::Device ||
*attrs == common::CUDASubprogramAttrs::Global ||
*attrs == common::CUDASubprogramAttrs::Grid_Global) {
inDeviceSubprogram = true;
}
}
Expand Down
7 changes: 7 additions & 0 deletions flang/test/Semantics/modfile55.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module m
attributes(host,device) real function foo(x)
foo = x + 1.
end function
attributes(host) subroutine hostsub(a)
integer, intent(out) :: a(14)
a = 99
end subroutine
end

!Expect: m.mod
Expand All @@ -39,4 +43,7 @@ end
!real(4)::x
!real(4)::foo
!end
attributes(host)subroutinehostsub(a)
integer(4),intent(out)::a(1_8:14_8)
end
!end
Loading