Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Answer comment: split cannondo new tests
Original-commit: flang-compiler/f18@7ebf7f7 Reviewed-on: flang-compiler/f18#552 Tree-same-pre-rewrite: false
- Loading branch information
1 parent
16cf494
commit 93e0516
Showing
13 changed files
with
448 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo1() | ||
do 01 k=1,2 | ||
do i=3,4 | ||
print*, i+k | ||
01 end do | ||
end subroutine |
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,37 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo0() | ||
do 01 j=1,2 | ||
if (.true.) then | ||
01 end if | ||
end subroutine |
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,42 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo2() | ||
do 01 l=1,2 | ||
do 01 m=1,2 | ||
select case (l) | ||
case default | ||
print*, "default", m, l | ||
case (1) | ||
print*, "start" | ||
01 end select | ||
end subroutine |
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,39 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo3() | ||
real :: a(10, 10), b(10, 10) = 1.0 | ||
do 01 k=1,4 | ||
associate (x=>a(k+1, 2*k), y=>b(k, 2*k-1)) | ||
x = 4*x*x + x*y -2*y | ||
01 end associate | ||
end subroutine |
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,40 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo4() | ||
real :: a(10, 10), b(10, 10) = 1.0 | ||
do 01 k=1,4 | ||
block | ||
real b | ||
b = a(k, k) | ||
a(k, k) = k*b | ||
01 end block | ||
end subroutine |
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,38 @@ | ||
! Copyright (c) 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. | ||
|
||
! Error test -- DO loop uses obsolete loop termination statement | ||
! See R1131 and C1133 | ||
|
||
! By default, this is not an error and label do are rewritten to non-label do. | ||
! A warning is generated with -Mstandard | ||
|
||
! RUN: ${F18} -funparse-with-symbols -Mstandard %s 2>&1 | ${FileCheck} %s | ||
|
||
! CHECK: end do | ||
|
||
! The following CHECK-NOT actively uses the fact that the leading zero of labels | ||
! would be removed in the unparse but not the line linked to warnings. We do | ||
! not want to see label do in the unparse only. | ||
! CHECK-NOT: do [1-9] | ||
|
||
! CHECK: A DO loop should terminate with an END DO or CONTINUE | ||
|
||
subroutine foo5() | ||
real :: a(10, 10), b(10, 10) = 1.0 | ||
do 01 k=1,4 | ||
critical | ||
b(k+1, k) = a(k, k+1) | ||
01 end critical | ||
end subroutine |
Oops, something went wrong.