From 467f8eb233291031e1883c12fae9c8f41177efa2 Mon Sep 17 00:00:00 2001 From: Bhuvanendra Kumar N Date: Mon, 17 May 2021 12:22:19 +0530 Subject: [PATCH] gdb/fortran: test case modified to suit the clang behavior. As mentioned in the test case itself, depending on the fortran compiler used, class member names used in the print commands and also output of these print commands varies. Existing print commands and its output are suited for gfortran, hence they were failing with clang compiler and test case was modified accordingly for clang compiler. gdb/testsuite/ChangeLog: * gdb.base/class-allocatable-array.exp: Modified test for clang. --- gdb/testsuite/ChangeLog | 4 ++++ .../gdb.fortran/class-allocatable-array.exp | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 0a8e5b202b..5a0159ffe6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2021-05-17 Bhuvanendra Kumar N + + * gdb.base/class-allocatable-array.exp: Modified test for clang. + 2021-05-16 Weimin Pan * gdb.ctf/funcreturn.exp: New file. diff --git a/gdb/testsuite/gdb.fortran/class-allocatable-array.exp b/gdb/testsuite/gdb.fortran/class-allocatable-array.exp index d2e3064942..b98cd4fa13 100644 --- a/gdb/testsuite/gdb.fortran/class-allocatable-array.exp +++ b/gdb/testsuite/gdb.fortran/class-allocatable-array.exp @@ -38,6 +38,13 @@ gdb_continue_to_breakpoint "Break Here" # different names, or maybe a completely different approach, for # representing class like structures. The following tests are # cetainly going to fail. -gdb_test "print this" " = \\( _data = \[^\r\n\]+, _vptr = \[^\r\n\]+\\)" -gdb_test "print this%_data" " = \\(PTR TO -> \\( Type test_type \\)\\) \[^\r\n\]+" -gdb_test "print this%_data%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)" +# Hence the test case is modified for clang. +if {[test_compiler_info {clang-*}]} { + gdb_test "print this" " = \\( a = 0, b = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\) \\)" + gdb_test "print this%a" " = 0" + gdb_test "print this%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)" +} else { + gdb_test "print this" " = \\( _data = \[^\r\n\]+, _vptr = \[^\r\n\]+\\)" + gdb_test "print this%_data" " = \\(PTR TO -> \\( Type test_type \\)\\) \[^\r\n\]+" + gdb_test "print this%_data%b" " = \\(\\(1, 2, 3\\) \\(4, 5, 6\\)\\)" +} -- 2.34.1