Skip to content

[flang] Enhance PAUSE functionality #166821

@eugeneepshteyn

Description

@eugeneepshteyn

Currently (as of LLVM commit ee0818a) flang parses PAUSE, PAUSE <code>, and PAUSE 'message', but only generic PAUSE is hooked up:

program pause_test
  pause ! default
  pause 12 ! with a status code
  pause "pause message" ! with a message
end program pause_test

Execution with flang:

$ flang pause.f90 && ./a.out
Fortran PAUSE: hit RETURN to continue:
Fortran PAUSE: hit RETURN to continue:
Fortran PAUSE: hit RETURN to continue:

Need to hook up handling of PAUSE <code> and PAUSE 'message' in lowering.

Output with gfortran:

PAUSE 
To resume execution, type go.  Other input will terminate the job.
go
RESUMED
PAUSE 12
To resume execution, type go.  Other input will terminate the job.
go
RESUMED
PAUSE pause message
To resume execution, type go.  Other input will terminate the job.
go
RESUMED

Output with ifx:

FORTRAN PAUSE
PAUSE prompt> 
12
PAUSE prompt> 
pause message
PAUSE prompt> 

Metadata

Metadata

Labels

enhancementImproving things as opposed to bug fixing, e.g. new or missing featureflangFlang issues not falling into any other categorygood first issuehttps://github.com/llvm/llvm-project/contribute

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions