]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.btrace/tsx.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.btrace / tsx.exp
CommitLineData
da8c46d2
MM
1# This testcase is part of GDB, the GNU debugger.
2#
1d506c26 3# Copyright 2015-2024 Free Software Foundation, Inc.
da8c46d2
MM
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
1cf897de 18require allow_btrace_pt_tests allow_tsx_tests
da8c46d2 19
da8c46d2 20standard_testfile .c x86-tsx.S
5b362f04 21if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
da8c46d2
MM
22 return -1
23}
b5ac99b0 24
da8c46d2
MM
25if ![runto_main] {
26 return -1
27}
28
29# record the test
30gdb_test_no_output "record btrace pt"
31gdb_test "next"
32
33# look at the instruction trace
77ba2a67
MM
34set begin_to_end [multi_line \
35 ".*" \
36 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
37 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
38 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txend\[^\\\r\\\n\]*" \
39 ]
40set abort_1 [multi_line \
41 ".*" \
42 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
43 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
44 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
45 ]
46set abort_2 [multi_line \
47 ".*" \
48 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
49 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
50 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
51 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
52 ]
16e7bd3b
TV
53set abort_3 \
54 [multi_line \
55 "$decimal\t $hex <main\\+$decimal>:\t\[^\\\r\\\n\]*" \
56 "$decimal\t $hex <test\\+$decimal>:\tmov\[^\\\r\\\n\]*" \
57 "$decimal\t $hex <test\\+$decimal>:\tret\[^\\\r\\\n\]*"]
77ba2a67
MM
58
59set test "speculation indication"
60gdb_test_multiple "record instruction-history" $test {
61 -re "$abort_1.*$gdb_prompt $" {
62 pass $test
63 }
64 -re "$abort_2.*$gdb_prompt $" {
65 pass $test
66 }
16e7bd3b
TV
67 -re -wrap "$abort_3.*" {
68 pass $gdb_test_name
69 }
77ba2a67
MM
70 -re "$begin_to_end.*$gdb_prompt $" {
71 pass $test
72 }
73}