When there are one or more fatal error messages produced by the parser, semantic analysis is not performed. But when there are messages produced by the parser and none of them are fatal, those messages are emitted to the user before compilation continues with semantic analysis, and any messages produced by semantics are emitted after the messages from parsing. This can be confusing for the user, as the messages may no longer all be in source file location order. It also makes it difficult to write tests that check for both non-fatal messages from parsing as well as messages from semantics using inline CHECK: or other expected messages in test source code. This patch ensures that if semantic analysis is performed, and non-fatal messages were produced by the parser, that all the messages will be combined and emitted in source file order.
8 lines
265 B
Fortran
8 lines
265 B
Fortran
!RUN: %flang -fsyntax-only -pedantic -I %S/Inputs/ %s 2>&1 | FileCheck %s
|
|
!CHECK: warning: SAVE attribute was already specified on 'x'
|
|
!CHECK: portability: #include: extra stuff ignored after file name
|
|
save x
|
|
save x
|
|
#include <empty.h> crud after header name
|
|
end
|