diff options
author | Bernhard Heckel <bernhard.heckel@intel.com> | 2016-04-07 10:28:14 +0200 |
---|---|---|
committer | Bernhard Heckel <bernhard.heckel@intel.com> | 2016-04-18 14:04:07 +0200 |
commit | 0c13f7e559afe5f973a59311b0e401296c48d96c (patch) | |
tree | 4fc302505cf6e4d513b87b24e6ba272141ba4802 /gdb/testsuite/lib/fortran.exp | |
parent | 9b9b09e9020aa32ade1a86461804a1950d967abb (diff) | |
download | gdb-0c13f7e559afe5f973a59311b0e401296c48d96c.zip gdb-0c13f7e559afe5f973a59311b0e401296c48d96c.tar.gz gdb-0c13f7e559afe5f973a59311b0e401296c48d96c.tar.bz2 |
fortran: Testsuite, fix different type naming across compilers.
Gfortran and ifort have different names for data types. Encapsulate
type names in a library to increase number of supported compilers.
gfortran -4.2 : int4
gfortran>=4.3 : integer(kind=4)
ifort : INTEGER(4)
2016-04-18 Bernhard Heckel <bernhard.heckel@intel.com>
gdb/testsuite/Changelog:
* gdb.fortran/common-block.exp: Use type naming defined in lib fortran.
* gdb.fortran/derived-type.exp: Use type naming defined in lib fortran.
* gdb.fortran/multi-dim.exp: Use type naming defined in lib fortran.
* gdb.fortran/vla-datatypes.exp: Use type naming defined in lib fortran.
* gdb.fortran/vla-ptype-sub.exp: Use type naming defined in lib fortran.
* gdb.fortran/vla-ptype.exp: Use type naming defined in lib fortran.
* gdb.fortran/whatis_type.exp: Use type naming defined in lib fortran.
* lib/fortran.exp (fortran_int4): New procedure.
(fortran_real4, fortran_real8, fortran_complex4): Likewise.
(fortran_logical4): Likewise.
Diffstat (limited to 'gdb/testsuite/lib/fortran.exp')
-rw-r--r-- | gdb/testsuite/lib/fortran.exp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/fortran.exp b/gdb/testsuite/lib/fortran.exp index 04011b9..872d99d 100644 --- a/gdb/testsuite/lib/fortran.exp +++ b/gdb/testsuite/lib/fortran.exp @@ -28,3 +28,63 @@ proc set_lang_fortran {} { } return 1 } + +proc fortran_int4 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "int4" + } elseif {[test_compiler_info {gcc-*}]} { + return "integer\\(kind=4\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "INTEGER\\(4\\)" + } else { + return "unknown" + } +} + +proc fortran_real4 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "real4" + } elseif {[test_compiler_info {gcc-*}]} { + return "real\\(kind=4\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "REAL\\(4\\)" + } else { + return "unknown" + } +} + +proc fortran_real8 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "real8" + } elseif {[test_compiler_info {gcc-*}]} { + return "real\\(kind=8\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "REAL\\(8\\)" + } else { + return "unknown" + } +} + +proc fortran_complex4 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "complex4" + } elseif {[test_compiler_info {gcc-*}]} { + return "complex\\(kind=4\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "COMPLEX\\(4\\)" + } else { + return "unknown" + } +} + +proc fortran_logical4 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "logical4" + } elseif {[test_compiler_info {gcc-*}]} { + return "logical\\(kind=4\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "LOGICAL\\(4\\)" + } else { + return "unknown" + } +} |