Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] FindOffsetLineAndColumn also uses SourcePosition.
New tests for COMMON and BLOCK. Added CHECK-ONCE to test_any.sh. Make sure pattern only occurs once. Original-commit: flang-compiler/f18@ad82daf Reviewed-on: flang-compiler/f18#698 Tree-same-pre-rewrite: false
- Loading branch information
1 parent
2f205a5
commit 69fd49a
Showing
13 changed files
with
208 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
! Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. | ||
! | ||
! Licensed under the Apache License, Version 2.0 (the "License"); | ||
! you may not use this file except in compliance with the License. | ||
! You may obtain a copy of the License at | ||
! | ||
! http://www.apache.org/licenses/LICENSE-2.0 | ||
! | ||
! Unless required by applicable law or agreed to in writing, software | ||
! distributed under the License is distributed on an "AS IS" BASIS, | ||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
! See the License for the specific language governing permissions and | ||
! limitations under the License. | ||
|
||
! Tests -fget-definition with COMMON block with same name as variable. | ||
|
||
program main | ||
integer :: x | ||
integer :: y | ||
common /x/ y | ||
x = y | ||
end program | ||
|
||
! RUN: ${F18} -fget-definition 21 3 4 -fparse-only -fdebug-semantics %s | ${FileCheck} %s | ||
! CHECK:x:.*getdefinition04.f90, 18, 14-15 |
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
! Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. | ||
! | ||
! Licensed under the Apache License, Version 2.0 (the "License"); | ||
! you may not use this file except in compliance with the License. | ||
! You may obtain a copy of the License at | ||
! | ||
! http://www.apache.org/licenses/LICENSE-2.0 | ||
! | ||
! Unless required by applicable law or agreed to in writing, software | ||
! distributed under the License is distributed on an "AS IS" BASIS, | ||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
! See the License for the specific language governing permissions and | ||
! limitations under the License. | ||
|
||
! Tests -fget-symbols-sources with BLOCK that contains same variable name as | ||
! another in an outer scope. | ||
|
||
program main | ||
integer :: x | ||
integer :: y | ||
block | ||
integer :: x | ||
integer :: y | ||
x = y | ||
end block | ||
x = y | ||
end program | ||
|
||
!! Inner x | ||
! RUN: ${F18} -fget-definition 24 5 6 -fparse-only -fdebug-semantics %s > %t; | ||
! CHECK:x:.*getdefinition05.f90, 22, 16-17 | ||
!! Outer y | ||
! RUN: ${F18} -fget-definition 26 7 8 -fparse-only -fdebug-semantics %s >> %t; | ||
! CHECK:y:.*getdefinition05.f90, 20, 14-15 | ||
! RUN: cat %t | ${FileCheck} %s; |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
! Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. | ||
! | ||
! Licensed under the Apache License, Version 2.0 (the "License"); | ||
! you may not use this file except in compliance with the License. | ||
! You may obtain a copy of the License at | ||
! | ||
! http://www.apache.org/licenses/LICENSE-2.0 | ||
! | ||
! Unless required by applicable law or agreed to in writing, software | ||
! distributed under the License is distributed on an "AS IS" BASIS, | ||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
! See the License for the specific language governing permissions and | ||
! limitations under the License. | ||
|
||
! Tests -fget-symbols-sources with COMMON. | ||
|
||
program main | ||
integer :: x | ||
integer :: y | ||
common /x/ y | ||
x = y | ||
end program | ||
|
||
! RUN: ${F18} -fget-symbols-sources -fparse-only -fdebug-semantics %s 2>&1 | ${FileCheck} %s | ||
! CHECK:x:.*getsymbols04.f90, 18, 14-15 | ||
! CHECK:y:.*getsymbols04.f90, 19, 14-15 | ||
! CHECK:x:.*getsymbols04.f90, 20, 11-12 |
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
! Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. | ||
! | ||
! Licensed under the Apache License, Version 2.0 (the "License"); | ||
! you may not use this file except in compliance with the License. | ||
! You may obtain a copy of the License at | ||
! | ||
! http://www.apache.org/licenses/LICENSE-2.0 | ||
! | ||
! Unless required by applicable law or agreed to in writing, software | ||
! distributed under the License is distributed on an "AS IS" BASIS, | ||
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
! See the License for the specific language governing permissions and | ||
! limitations under the License. | ||
|
||
! Tests -fget-symbols-sources with COMMON. | ||
|
||
program main | ||
integer :: x | ||
integer :: y | ||
block | ||
integer :: x | ||
x = y | ||
end block | ||
x = y | ||
end program | ||
|
||
! RUN: ${F18} -fget-symbols-sources -fparse-only -fdebug-semantics %s 2>&1 | ${FileCheck} %s | ||
! CHECK:x:.*getsymbols05.f90, 18, 14-15 | ||
! CHECK:y:.*getsymbols05.f90, 19, 14-15 | ||
! CHECK:x:.*getsymbols05.f90, 21, 16-17 |
This file contains 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
Oops, something went wrong.