Bug 29053 - [m32] FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('array_1d_4bytes_overflow') expression
Summary: [m32] FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('a...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: fortran (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 13.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-13 04:19 UTC by Tom de Vries
Modified: 2022-05-10 13:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2022-04-13 04:19:09 UTC
With target board unix/-m32, I run into:
...
FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('array_1d_4bytes_overflow') expression
FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of ubound ('array_1d_4bytes_overflow') expression
FAIL: gdb.fortran/lbound-ubound.exp: test 12: lbounds match
FAIL: gdb.fortran/lbound-ubound.exp: test 12: ubounds match
FAIL: gdb.fortran/lbound-ubound.exp: p lbound(array_1d_4bytes_overflow, 1, 8)
...

In more detail:
...
(gdb) p lbound (array_1d_4bytes_overflow)^M
$71 = (2147483644)^M
(gdb) FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('array_1d_4bytes_overflow') expression
p ubound (array_1d_4bytes_overflow)^M
$72 = (-2147483637)^M
(gdb) FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of ubound ('array_1d_4bytes_overflow') expression
...

With native instead I get:
...
(gdb) p lbound (array_1d_4bytes_overflow)^M
$71 = (2147483644)^M
(gdb) PASS: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('array_1d_4bytes_overflow') expression
p ubound (array_1d_4bytes_overflow)^M
$72 = (-2147483637)^M
(gdb) PASS: gdb.fortran/lbound-ubound.exp: test 12: check value of ubound ('array_1d_4bytes_overflow') expression
...

Hmm, that's the same output, so the difference is in the expected value.  Let's annotate that in the test name:
...
diff --git a/gdb/testsuite/gdb.fortran/lbound-ubound.exp b/gdb/testsuite/gdb.fortran/lbound
-ubound.exp
index 334713666e0..f4093092a11 100644
--- a/gdb/testsuite/gdb.fortran/lbound-ubound.exp
+++ b/gdb/testsuite/gdb.fortran/lbound-ubound.exp
@@ -137,10 +137,10 @@ while { $test_count < 500 } {
        # lower bounds for an array.
        set pattern [string_to_regexp " = $expected_lbound"]
        gdb_test "p lbound ($array_name)" "$pattern" \
-           "check value of lbound ('$array_name') expression"
+           "check value of lbound ('$array_name') expression, expected: $expected_lbound"

        set pattern [string_to_regexp " = $expected_ubound"]
        gdb_test "p ubound ($array_name)" "$pattern" \
-           "check value of ubound ('$array_name') expression"
+           "check value of ubound ('$array_name') expression, expected: $expected_ubound"

 
        # Now ask for each bound in turn and check it against the
        # expected results.
...

That's a mismatch indeed:
...
(gdb) p lbound (array_1d_4bytes_overflow)^M
$71 = (2147483644)^M
(gdb) FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of lbound ('array_1d_4bytes_overflow') expression, expected: (1)
p ubound (array_1d_4bytes_overflow)^M
$72 = (-2147483637)^M
(gdb) FAIL: gdb.fortran/lbound-ubound.exp: test 12: check value of ubound ('array_1d_4bytes_overflow') expression, expected: (0)
...
Comment 2 Kempke, Nils-Christian 2022-05-10 13:34:50 UTC
The referenced patch was reviewed and was pushed to master. This should close the ticket.
Comment 3 Tom de Vries 2022-05-10 13:39:28 UTC
Fixed, thanks.