| 1 |
! Check the Flang Print Function Names example plugin prints and counts function/subroutine definitions |
| 2 |
! This includes internal and external Function/Subroutines, but not Statement Functions |
| 3 |
! This requires that the examples are built (LLVM_BUILD_EXAMPLES=ON) to access flangPrintFunctionNames.so |
| 4 |
|
| 5 |
! REQUIRES: plugins, examples, shell |
| 6 |
|
| 7 |
! RUN: %flang_fc1 -load %llvmshlibdir/flangPrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s |
| 8 |
|
| 9 |
! CHECK: Function: external_func1 |
| 10 |
! CHECK-NEXT: Function: external_func2 |
| 11 |
! CHECK-NEXT: Subroutine: external_subr |
| 12 |
! CHECK-NEXT: Function: internal_func |
| 13 |
! CHECK-NEXT: Subroutine: internal_subr |
| 14 |
! CHECK-EMPTY: |
| 15 |
! CHECK-NEXT: ==== Functions: 3 ==== |
| 16 |
! CHECK-NEXT: ==== Subroutines: 2 ==== |
| 17 |
|
| 18 |
function external_func1() |
| 19 |
end function |
| 20 |
|
| 21 |
function external_func2() |
| 22 |
end function |
| 23 |
|
| 24 |
subroutine external_subr |
| 25 |
end subroutine |
| 26 |
|
| 27 |
program main |
| 28 |
contains |
| 29 |
function internal_func() |
| 30 |
end function |
| 31 |
|
| 32 |
subroutine internal_subr |
| 33 |
end subroutine |
| 34 |
end program main |