mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:36:37 +00:00

Before emitting a warning message, code should check that the usage in question should be diagnosed by calling ShouldWarn(). A fair number of sites in the code do not, and can emit portability warnings unconditionally, which can confuse a user that hasn't asked for them (-pedantic) and isn't terribly concerned about portability *to* other compilers. Add calls to ShouldWarn() or IsEnabled() around messages that need them, and add -pedantic to tests that now require it to test their portability messages, and add more expected message lines to those tests when -pedantic causes other diagnostics to fire.
21 lines
602 B
Fortran
21 lines
602 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
|
|
module m
|
|
!PORTABILITY: Specific procedure 'sin' of generic interface 'yintercept' should not be INTRINSIC
|
|
intrinsic sin
|
|
interface yIntercept
|
|
procedure sin
|
|
end interface
|
|
!PORTABILITY: Specific procedure 'cos' of generic interface 'xintercept' should not be INTRINSIC
|
|
intrinsic cos
|
|
generic :: xIntercept => cos
|
|
end module
|
|
|
|
subroutine foo
|
|
interface slope
|
|
procedure tan
|
|
end interface
|
|
!ERROR: Specific procedure 'tan' of generic interface 'slope' may not be a statement function
|
|
tan(x) = sin(x) / cos(x)
|
|
end subroutine
|
|
|