aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils-Christian Kempke <nils-christian.kempke@intel.com>2022-05-31 16:43:45 +0200
committerNils-Christian Kempke <nils-christian.kempke@intel.com>2022-05-31 16:44:56 +0200
commitebad7c66133526eb9ea9b21dad2df49a65200df0 (patch)
tree6659faf8c8a34e65606b64d58867a7aa1f9db9ca
parent0df017fbca3070682ffa62a3b302a30e028adfb6 (diff)
downloadgdb-ebad7c66133526eb9ea9b21dad2df49a65200df0.zip
gdb-ebad7c66133526eb9ea9b21dad2df49a65200df0.tar.gz
gdb-ebad7c66133526eb9ea9b21dad2df49a65200df0.tar.bz2
gdb/testsuite: fixup common-block.exp for intel compilers
The order in which the variables in info common and info locals are displayed is compiler (and dwarf) dependent. While all symbols should be displayed the order is not fixed. I added a gdb_test_multiple that lets ifx and ifort pass in cases where only the order differs.
-rw-r--r--gdb/testsuite/gdb.fortran/common-block.exp38
1 files changed, 35 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp
index e6555f5..e8d7c22 100644
--- a/gdb/testsuite/gdb.fortran/common-block.exp
+++ b/gdb/testsuite/gdb.fortran/common-block.exp
@@ -54,8 +54,27 @@ gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
-gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out"
-gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out"
+gdb_test_multiple "info locals" "info locals out" {
+ # gfortran
+ -re -wrap "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" {
+ pass $gdb_test_name
+ }
+ # ifx/ifort/flang
+ -re -wrap "ix = 1\r\niy = 2\r\niz = 3\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33" {
+ pass $gdb_test_name
+ }
+}
+
+gdb_test_multiple "info common" "info common out" {
+ # gfortran
+ -re -wrap "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" {
+ pass $gdb_test_name
+ }
+ # ifx/ifort/flang
+ -re -wrap "Contents of F77 COMMON block 'foo_?':\r\nix = 1\r\niy = 2\r\niz = 3\r\n\r\nContents of F77 COMMON block 'fo_o_?':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33" {
+ pass $gdb_test_name
+ }
+}
gdb_test "ptype ix" "type = $int4" "ptype ix out"
gdb_test "ptype iy" "type = $real4" "ptype iy out"
@@ -81,7 +100,20 @@ gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "w
gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in"
gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in"
-gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in"
+gdb_test_multiple "info locals" "info locals in" {
+ # gfortran
+ -re -wrap "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" {
+ pass $gdb_test_name
+ }
+ # ifx
+ -re -wrap "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niz_z = 55\r\niy = 5" {
+ pass $gdb_test_name
+ }
+ # ifort
+ -re -wrap "iz_z = 55\r\niy = 5\r\nix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" {
+ pass $gdb_test_name
+ }
+}
gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in"
gdb_test "ptype ix" "type = $int4" "ptype ix in"