Replacing Hello World example Plugin with one that counts and prints the names of functions and subroutines. This involves changing the `PluginParseTreeAction` Plugin base class to inherit from `PrescanAndSemaAction` class to get access to the Parse Tree so that the Plugin can walk it. Additionally, there are tests of this new Plugin to check it prints the correct things in different circumstances. Depends on: D106137 Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D107089
27 lines
879 B
Fortran
27 lines
879 B
Fortran
! Check the Flang Print Function Names example plugin doesn't count/print Functions/Subroutines in interfaces
|
|
! (It should only count definitions, which will appear elsewhere for interfaced functions/subroutines)
|
|
! This requires that the examples are built (FLANG_BUILD_EXAMPLES=ON) to access flangPrintFunctionNames.so
|
|
|
|
! REQUIRES: plugins, examples, shell
|
|
|
|
! RUN: %flang_fc1 -load %llvmshlibdir/flangPrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s
|
|
|
|
!-----------------------------
|
|
! EXPECTED OUTPUT: Counts == 0
|
|
!-----------------------------
|
|
! CHECK: ==== Functions: 0 ====
|
|
! CHECK-NEXT: ==== Subroutines: 0 ====
|
|
|
|
!--------------------------
|
|
! INPUT
|
|
!--------------------------
|
|
program main
|
|
interface
|
|
function interface_func()
|
|
end function
|
|
|
|
subroutine interface_subr()
|
|
end subroutine
|
|
end interface
|
|
end program main
|