-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[flang] Implement lowering for the PAUSE statement (Fixes #166821) #167115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sathvikreddy853
wants to merge
10
commits into
llvm:main
Choose a base branch
from
sathvikreddy853:flang/fix-pause-lowering
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+73
−6
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
faf6544
[flang] Lower PAUSE statement with code and message operands
sathvikreddy853 8914d5e
[flang] add check for number of inputs and remove unreachable block code
sathvikreddy853 99974a0
[flang] Update pause-statement testcase
Adityanath-madishetti e616985
Merge branch 'main' into flang/fix-pause-lowering
sathvikreddy853 5faab4d
Merge branch 'main' into flang/fix-pause-lowering
sathvikreddy853 fd9d218
Merge branch 'main' into flang/fix-pause-lowering
sathvikreddy853 0e8d546
[flang] Address review feedback
sathvikreddy853 18b7e8f
[flang] Add missing argument to pause_code test and clean up PAUSE lo…
sathvikreddy853 cd29c0e
Merge branch 'main' into flang/fix-pause-lowering
sathvikreddy853 b73c6c7
[flang] Fix pause-statement testcase
sathvikreddy853 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,31 @@ | ||
| ! RUN: bbc %s -emit-fir --canonicalize -o - | FileCheck %s | ||
| ! RUN: bbc %s -emit-fir -hlfir=false --canonicalize -o - | FileCheck %s | ||
sathvikreddy853 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ! CHECK-LABEL: pause_test | ||
| subroutine pause_test() | ||
| pause | ||
| ! CHECK: fir.call @_Fortran{{.*}}PauseStatement() | ||
| ! CHECK-NEXT: return | ||
| pause | ||
| end subroutine | ||
|
|
||
| ! CHECK-LABEL: pause_code | ||
| subroutine pause_code() | ||
| pause 42 | ||
| ! CHECK: %[[c42:.*]] = arith.constant 42 : i32 | ||
| ! CHECK: fir.call @_Fortran{{.*}}PauseStatementInt(%[[c42]]) | ||
| ! CHECK-NEXT: return | ||
| end subroutine | ||
|
|
||
| ! CHECK-LABEL: pause_msg | ||
| subroutine pause_msg() | ||
| pause 'hello' | ||
| ! CHECK-DAG: %[[five:.*]] = arith.constant 5 : index | ||
| ! CHECK-DAG: %[[lit:.*]] = fir.address_of(@_QQ{{.*}}) : !fir.ref<!fir.char<1,5>> | ||
| ! CHECK-DAG: %[[buff:.*]] = fir.convert %[[lit]] : (!fir.ref<!fir.char<1,5>>) -> !fir.ref<i8> | ||
| ! CHECK-DAG: %[[len:.*]] = fir.convert %[[five]] : (index) -> i64 | ||
| ! CHECK: fir.call @_Fortran{{.*}}PauseStatementText(%[[buff]], %[[len]]) | ||
| ! CHECK-NEXT: return | ||
| end subroutine | ||
|
|
||
| ! CHECK-DAG: func private @_Fortran{{.*}}PauseStatement | ||
| ! CHECK-DAG: func private @_Fortran{{.*}}PauseStatementInt | ||
| ! CHECK-DAG: func private @_Fortran{{.*}}PauseStatementText | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.