Stuart Ellis | 520e5db | 2021-08-19 08:07:45 +0000 | [diff] [blame] | 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 |
Slava Zakharin | 1c5d121 | 2023-03-13 14:50:13 -0700 | [diff] [blame] | 3 | ! This requires that the examples are built (LLVM_BUILD_EXAMPLES=ON) to access flangPrintFunctionNames.so |
Stuart Ellis | 520e5db | 2021-08-19 08:07:45 +0000 | [diff] [blame] | 4 | |
| 5 | ! REQUIRES: plugins, examples, shell |
| 6 | |
| 7 | ! RUN: %flang_fc1 -load %llvmshlibdir/flangPrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s |
| 8 | |
Stuart Ellis | 520e5db | 2021-08-19 08:07:45 +0000 | [diff] [blame] | 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 | |
Stuart Ellis | 520e5db | 2021-08-19 08:07:45 +0000 | [diff] [blame] | 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 |