mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:16:36 +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.
16 lines
402 B
Fortran
16 lines
402 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
|
|
!ERROR: Some modules in this compilation unit form one or more cycles of dependence
|
|
module m1
|
|
use m2
|
|
end
|
|
|
|
!PORTABILITY: A USE statement referencing module 'm2' appears earlier in this compilation unit
|
|
module m2
|
|
use m3
|
|
end
|
|
|
|
!PORTABILITY: A USE statement referencing module 'm3' appears earlier in this compilation unit
|
|
module m3
|
|
use m1
|
|
end
|