[flang][cuda] Allow STOP in device context (#120625)

STOP statement is allowed in device procedure
This commit is contained in:
Valentin Clement (バレンタイン クレメン) 2024-12-19 12:41:09 -08:00 committed by GitHub
parent 6e7312bda6
commit 7009b06993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -350,6 +350,7 @@ private:
void Check(const parser::ActionStmt &stmt, const parser::CharBlock &source) {
common::visit(
common::visitors{
[&](const common::Indirection<parser::StopStmt> &) { return; },
[&](const common::Indirection<parser::PrintStmt> &) {},
[&](const common::Indirection<parser::WriteStmt> &x) {
if (x.value().format) { // Formatted write to '*' or '6'

View File

@ -49,6 +49,11 @@ module m
i = threadIdx%x
a(i) = c(10) ! ok, a is device and c is constant
end subroutine
attributes(global) subroutine stoptest()
print*,threadIdx%x
stop ! ok
end subroutine
end
program main