With this change, the following invocations will be treated as errors (multiple actions are specified): ``` $ flang-new -fc1 -E -fsyntax-only file.95 $ flang-new -fc1 -fsyntax-only -fdebug-dump-symbols file.95 ``` In the examples above it is not clear whether it is `-fsyntax-only` or the other action that is run (i.e. `-E` or `-fdebug-dump-symbols`). It makes sense to disallow such usage. This should also lead to cleaner and clearer tests (the `RUN` lines using `%flang_fc1` will only allow one action). This change means that `flang-new -fc1` and `clang -cc1` will behave differently when multiple action options are specified. As frontend drivers are mostly used by compiler developers, this shouldn't affect or confuse the compiler end-users. Also, `flang-new` and `clang` remain consistent. Tests are updated accordingly. More specifically, I've made sure that every test specifies only one action. I've also taken the opportunity to simplify "multiple-input-files.f90" a bit. Differential Revision: https://reviews.llvm.org/D111781
25 lines
820 B
Fortran
25 lines
820 B
Fortran
! Tests -fget-definition returning source position of symbol definition.
|
|
module m1
|
|
private :: f
|
|
contains
|
|
pure subroutine s (x, yyy) bind(c)
|
|
intent(in) :: x
|
|
intent(inout) :: yyy
|
|
contains
|
|
pure subroutine ss
|
|
end subroutine
|
|
end subroutine
|
|
recursive pure function f() result(x)
|
|
real, allocatable :: x
|
|
x = 1.0
|
|
end function
|
|
end module
|
|
|
|
! RUN and CHECK lines at the bottom as this test is sensitive to line numbers
|
|
! RUN: %flang_fc1 -fget-definition 6 17 18 %s | FileCheck --check-prefix=CHECK1 %s
|
|
! RUN: %flang_fc1 -fget-definition 7 20 23 %s | FileCheck --check-prefix=CHECK2 %s
|
|
! RUN: %flang_fc1 -fget-definition 14 3 4 %s | FileCheck --check-prefix=CHECK3 %s
|
|
! CHECK1: x:{{.*}}getdefinition01.f90, 5, 21-22
|
|
! CHECK2: yyy:{{.*}}getdefinition01.f90, 5, 24-27
|
|
! CHECK3: x:{{.*}}getdefinition01.f90, 13, 24-25
|