Automatic date update in version.in
[binutils-gdb.git] / gdb / testsuite / gdb.btrace / tsx.exp
blobd312b15027ca467d65e0ab2f3064ec1f936cce40
1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2015-2024 Free Software Foundation, Inc.
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.
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.
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/>.
18 require allow_btrace_pt_tests allow_tsx_tests
20 standard_testfile .c x86-tsx.S
21 if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
22     return -1
25 if ![runto_main] {
26     return -1
29 # record the test
30 gdb_test_no_output "record btrace pt"
31 gdb_test "next"
33 # look at the instruction trace
34 set 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     ]
40 set 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     ]
46 set 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     ]
53 set 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\]*"]
59 set test "speculation indication"
60 gdb_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     }
67     -re -wrap "$abort_3.*" {
68         pass $gdb_test_name
69     }
70     -re  "$begin_to_end.*$gdb_prompt $" {
71         pass $test
72     }