Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Handle unsupported warning flags
This PR makes flang emit a warning when the user passes an unsupported gfortran warning flag in as a CLI arg. This PR also checks each `-W` argument instead of just looking at the last one passed in. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D143301
- Loading branch information
1 parent
ae2322a
commit ce3a1c5
Showing
8 changed files
with
124 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
! RUN: %flang -std=f2018 -Wextra -Waliasing -Wampersand -Warray-bounds -Wc-binding-type \ | ||
! RUN: -Wcharacter-truncation -Wconversion -Wdo-subscript -Wfunction-elimination \ | ||
! RUN: -Wimplicit-interface -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only \ | ||
! RUN: -Wintrinsics-std -Wline-truncation -Wno-align-commons -Wno-overwrite-recursive \ | ||
! RUN: -Wno-tabs -Wreal-q-constant -Wsurprising -Wunderflow -Wunused-parameter \ | ||
! RUN: -Wrealloc-lhs -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime %s \ | ||
! RUN: 2>&1 | FileCheck %s | ||
|
||
! CHECK: The warning option '-Wextra' is not supported | ||
! CHECK-NEXT: The warning option '-Waliasing' is not supported | ||
! CHECK-NEXT: The warning option '-Wampersand' is not supported | ||
! CHECK-NEXT: The warning option '-Warray-bounds' is not supported | ||
! CHECK-NEXT: The warning option '-Wc-binding-type' is not supported | ||
! CHECK-NEXT: The warning option '-Wcharacter-truncation' is not supported | ||
! CHECK-NEXT: The warning option '-Wconversion' is not supported | ||
! CHECK-NEXT: The warning option '-Wdo-subscript' is not supported | ||
! CHECK-NEXT: The warning option '-Wfunction-elimination' is not supported | ||
! CHECK-NEXT: The warning option '-Wimplicit-interface' is not supported | ||
! CHECK-NEXT: The warning option '-Wimplicit-procedure' is not supported | ||
! CHECK-NEXT: The warning option '-Wintrinsic-shadow' is not supported | ||
! CHECK-NEXT: The warning option '-Wuse-without-only' is not supported | ||
! CHECK-NEXT: The warning option '-Wintrinsics-std' is not supported | ||
! CHECK-NEXT: The warning option '-Wline-truncation' is not supported | ||
! CHECK-NEXT: The warning option '-Wno-align-commons' is not supported | ||
! CHECK-NEXT: The warning option '-Wno-overwrite-recursive' is not supported | ||
! CHECK-NEXT: The warning option '-Wno-tabs' is not supported | ||
! CHECK-NEXT: The warning option '-Wreal-q-constant' is not supported | ||
! CHECK-NEXT: The warning option '-Wsurprising' is not supported | ||
! CHECK-NEXT: The warning option '-Wunderflow' is not supported | ||
! CHECK-NEXT: The warning option '-Wunused-parameter' is not supported | ||
! CHECK-NEXT: The warning option '-Wrealloc-lhs' is not supported | ||
! CHECK-NEXT: The warning option '-Wrealloc-lhs-all' is not supported | ||
! CHECK-NEXT: The warning option '-Wfrontend-loop-interchange' is not supported | ||
! CHECK-NEXT: The warning option '-Wtarget-lifetime' is not supported | ||
|
||
program m | ||
end program |
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,13 @@ | ||
! Ensures that -Werror is read regardless of whether or not other -W | ||
! flags are present in the CLI args | ||
|
||
! RUN: not %flang -std=f2018 -Werror -Wextra %s 2>&1 | FileCheck %s --check-prefix=WRONG | ||
! RUN: %flang -std=f2018 -Wextra -Wall %s 2>&1 | FileCheck %s --check-prefix=CHECK-OK | ||
|
||
! WRONG: Semantic errors in | ||
! CHECK-OK: FORALL index variable | ||
|
||
program werror_check_all | ||
integer :: a(3) | ||
forall (j=1:n) a(i) = 1 | ||
end program werror_check_all |
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,11 @@ | ||
! Ensure that supplying -Wextra into flang-new does not raise error | ||
! The first check should be changed if -Wextra is implemented | ||
|
||
! RUN: %flang -std=f2018 -Wextra %s 2>&1 | FileCheck %s --check-prefix=CHECK-OK | ||
! RUN: not %flang -std=f2018 -Wblah -Wextra %s 2>&1 | FileCheck %s --check-prefix=WRONG | ||
|
||
! CHECK-OK: The warning option '-Wextra' is not supported | ||
! WRONG: Only `-Werror` is supported currently. | ||
|
||
program wextra_ok | ||
end program wextra_ok |