diff options
author | Tom de Vries <tdevries@suse.de> | 2021-09-04 10:44:10 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-09-04 10:44:10 +0200 |
commit | 10f3fbece94463282d293305de5ac7381c326e3b (patch) | |
tree | f7532012ff626b69a4f1e5eaff7266e12b724cc3 /gdb/testsuite/gdb.arch/i386-avx.exp | |
parent | e994f4ef451c83cd6c851c015433daa23566e2d9 (diff) | |
download | gdb-10f3fbece94463282d293305de5ac7381c326e3b.zip gdb-10f3fbece94463282d293305de5ac7381c326e3b.tar.gz gdb-10f3fbece94463282d293305de5ac7381c326e3b.tar.bz2 |
[gdb/testsuite] Check avx support in gdb.arch/amd64-disp-step-avx.exp
On a machine on Open Build Service I'm running into a SIGILL for test-case
gdb.arch/amd64-disp-step-avx.exp:
...
Program received signal SIGILL, Illegal instruction.^M
test_rip_vex2 () at gdb.arch/amd64-disp-step-avx.S:40^M
40 vmovsd ro_var(%rip),%xmm0^M
(gdb) FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: \
continue to test_rip_vex2_end
...
The SIGILL happens when trying to execute the first avx instruction in the
executable.
I can't directly access the machine, but looking at the log for test-case
gdb.arch/i386-avx.exp, it seems that there's no avx support:
...
Breakpoint 1, main (argc=1, argv=0x7fffffffd6b8) at gdb.arch/i386-avx.c:68^M
68 if (have_avx ())^M
(gdb) print have_avx ()^M
$1 = 0^M
...
Fix this by:
- adding a gdb_caching_proc have_avx, similar to have_mpx, using the have_avx
function from gdb.arch/i386-avx.c
- using proc have_avx in both gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
and gdb/testsuite/gdb.arch/i386-avx.exp.
Tested on my x86_64-linux laptop with avx support, where both test-cases pass.
gdb/testsuite/ChangeLog:
2021-09-04 Tom de Vries <tdevries@suse.de>
PR testsuite/26950
* gdb/testsuite/gdb.arch/i386-avx.c (main): Remove call to have_avx.
(have_avx): Move ...
* gdb/testsuite/lib/gdb.exp (have_avx): ... here. New proc.
* gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp: Use have_avx.
* gdb/testsuite/gdb.arch/i386-avx.exp: Same.
Diffstat (limited to 'gdb/testsuite/gdb.arch/i386-avx.exp')
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-avx.exp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.arch/i386-avx.exp b/gdb/testsuite/gdb.arch/i386-avx.exp index 06a5ef0..93e86ee 100644 --- a/gdb/testsuite/gdb.arch/i386-avx.exp +++ b/gdb/testsuite/gdb.arch/i386-avx.exp @@ -24,6 +24,11 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { return } +if { ![have_avx] } { + verbose "Skipping x86 AVX tests." + return +} + standard_testfile .c if [get_compiler_info] { @@ -47,23 +52,6 @@ if ![runto_main] then { return 0 } -send_gdb "print have_avx ()\r" -gdb_expect { - -re ".. = 1\r\n$gdb_prompt " { - pass "check whether processor supports AVX" - } - -re ".. = 0\r\n$gdb_prompt " { - verbose "processor does not support AVX; skipping AVX tests" - return - } - -re ".*$gdb_prompt $" { - fail "check whether processor supports AVX" - } - timeout { - fail "check whether processor supports AVX (timeout)" - } -} - gdb_test "break [gdb_get_line_number "first breakpoint here"]" \ "Breakpoint .* at .*i386-avx.c.*" \ "set first breakpoint in main" |