gdb/fortran: Allow Flang MAIN_ in Fortran testing
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Sun, 10 May 2020 19:12:00 +0000 (00:42 +0530)
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Sun, 10 May 2020 19:18:10 +0000 (00:48 +0530)
commit86cd6bc8f69613d81a2024d7d3436b774a4039cd
tree2340ab048b5afbd1eea54458f035b89fa2861b1e
parent1ea1aee1ed295d27a6aab933c3bd9d83af1b2cc5
gdb/fortran: Allow Flang MAIN_ in Fortran testing

Name of fortran main function for Flang compiler is MAIN_ while
for gfortran it is MAIN__ . In test cases MAIN__ is hardcoded for
the purpose of inserting breakpoint.

New proc is added to detect main function name depending on the
compiler used.
Fortran specific version of runto_main named fortran_runto_main
is added.

This commit adds support for Flang main function, there should be
no change for gfortran.

gdb/testsuite/ChangeLog

* lib/fortran.exp (fortran_main): New Proc, handle flang MAIN_,
(fortran_runto_main): New Proc, fortran version of runto_main.
* gdb.fortran/array-bounds-high.exp: Handle flang MAIN_.
* gdb.fortran/array-bounds.exp: Likewise.
* gdb.fortran/array-slices.exp: Likewise.
* gdb.fortran/block-data.exp: Likewise.
* gdb.fortran/charset.exp: Likewise.
* gdb.fortran/common-block.exp: Likewise.
* gdb.fortran/complex.exp: Likewise.
* gdb.fortran/derived-type-function.exp: Likewise.
* gdb.fortran/derived-type.exp: Likewise.
* gdb.fortran/info-modules.exp: Likewise.
* gdb.fortran/info-types.exp: Likewise.
* gdb.fortran/intrinsics.exp: Likewise.
* gdb.fortran/library-module.exp: Likewise.
* gdb.fortran/logical.exp: Likewise.
* gdb.fortran/max-depth.exp: Likewise.
* gdb.fortran/module.exp: Likewise.
* gdb.fortran/multi-dim.exp: Likewise.
* gdb.fortran/nested-funcs.exp: Likewise.
* gdb.fortran/print-formatted.exp: Likewise.
* gdb.fortran/print_type.exp: Likewise.
* gdb.fortran/printing-types.exp: Likewise.
* gdb.fortran/ptr-indentation.exp: Likewise.
* gdb.fortran/ptype-on-functions.exp: Likewise.
* gdb.fortran/subarray.exp: Likewise.
* gdb.fortran/vla-alloc-assoc.exp: Likewise.
* gdb.fortran/vla-datatypes.exp: Likewise.
* gdb.fortran/vla-history.exp: Likewise.
* gdb.fortran/vla-ptr-info.exp: Likewise.
* gdb.fortran/vla-ptype-sub.exp: Likewise.
* gdb.fortran/vla-ptype.exp: Likewise.
* gdb.fortran/vla-sizeof.exp: Likewise.
* gdb.fortran/vla-type.exp: Likewise.
* gdb.fortran/vla-value-sub-arbitrary.exp: Likewise.
* gdb.fortran/vla-value-sub-finish.exp: Likewise.
* gdb.fortran/vla-value-sub.exp: Likewise.
* gdb.fortran/vla-value.exp: Likewise.
* gdb.fortran/whatis_type.exp: Likewise.
* gdb.mi/mi-var-child-f.exp: Likewise.
40 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/array-bounds-high.exp
gdb/testsuite/gdb.fortran/array-bounds.exp
gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/block-data.exp
gdb/testsuite/gdb.fortran/charset.exp
gdb/testsuite/gdb.fortran/common-block.exp
gdb/testsuite/gdb.fortran/complex.exp
gdb/testsuite/gdb.fortran/derived-type-function.exp
gdb/testsuite/gdb.fortran/derived-type.exp
gdb/testsuite/gdb.fortran/info-modules.exp
gdb/testsuite/gdb.fortran/info-types.exp
gdb/testsuite/gdb.fortran/intrinsics.exp
gdb/testsuite/gdb.fortran/library-module.exp
gdb/testsuite/gdb.fortran/logical.exp
gdb/testsuite/gdb.fortran/max-depth.exp
gdb/testsuite/gdb.fortran/module.exp
gdb/testsuite/gdb.fortran/multi-dim.exp
gdb/testsuite/gdb.fortran/nested-funcs.exp
gdb/testsuite/gdb.fortran/print-formatted.exp
gdb/testsuite/gdb.fortran/print_type.exp
gdb/testsuite/gdb.fortran/printing-types.exp
gdb/testsuite/gdb.fortran/ptr-indentation.exp
gdb/testsuite/gdb.fortran/ptype-on-functions.exp
gdb/testsuite/gdb.fortran/subarray.exp
gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp
gdb/testsuite/gdb.fortran/vla-datatypes.exp
gdb/testsuite/gdb.fortran/vla-history.exp
gdb/testsuite/gdb.fortran/vla-ptr-info.exp
gdb/testsuite/gdb.fortran/vla-ptype-sub.exp
gdb/testsuite/gdb.fortran/vla-ptype.exp
gdb/testsuite/gdb.fortran/vla-sizeof.exp
gdb/testsuite/gdb.fortran/vla-type.exp
gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp
gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp
gdb/testsuite/gdb.fortran/vla-value-sub.exp
gdb/testsuite/gdb.fortran/vla-value.exp
gdb/testsuite/gdb.fortran/whatis_type.exp
gdb/testsuite/gdb.mi/mi-var-child-f.exp
gdb/testsuite/lib/fortran.exp