]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/powerpc-power7.exp
GDB: Add support for the new set/show disassembler-options commands.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-power7.exp
1 # Copyright 2014-2017 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # This file is part of the gdb testsuite.
17
18 # Test PowerPC instructions disassembly.
19
20 standard_testfile .s
21 set objfile [standard_output_file ${testfile}.o]
22
23 if {![istarget "powerpc*-*-*"]} then {
24 verbose "Skipping PowerPC instructions disassembly."
25 return
26 }
27
28 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
29 untested "PowerPC instructions disassembly"
30 return -1
31 }
32
33 clean_restart ${objfile}
34
35 # Disassemble the function.
36 set func ""
37
38 gdb_test "set disassembler-options power7"
39 set test "disass func"
40 gdb_test_multiple $test $test {
41 -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" {
42 set func $expect_out(1,string)
43 pass $test
44 }
45 }
46
47 proc instr_to_patt {instr} {
48 global decimal hex
49 # 0x0000000000000018 <+24>: stxvd2x vs43,r4,r5
50 return "\[ \t\]*$hex <\\+$decimal>:\[ \t\]*[string_to_regexp $instr]"
51 }
52
53 proc func_check {instr} {
54 global func
55
56 set test "found: $instr"
57 if [regexp -nocase -line [instr_to_patt $instr] $func] {
58 pass $test
59 } else {
60 fail $test
61 }
62 }
63
64 func_check "lxvd2x vs3,r4,r5"
65 func_check "lxvd2x vs43,r4,r5"
66 func_check "stxvd2x vs3,r4,r5"
67 func_check "stxvd2x vs43,r4,r5"
68 func_check "xxmrghd vs3,vs4,vs5"
69 func_check "xxmrghd vs43,vs44,vs45"
70 func_check "xxmrgld vs3,vs4,vs5"
71 func_check "xxmrgld vs43,vs44,vs45"
72 func_check "xxmrghd vs3,vs4,vs5"
73 func_check "xxmrghd vs43,vs44,vs45"
74 func_check "xxmrgld vs3,vs4,vs5"
75 func_check "xxmrgld vs43,vs44,vs45"
76 func_check "xxpermdi vs3,vs4,vs5,1"
77 func_check "xxpermdi vs43,vs44,vs45,1"
78 func_check "xxpermdi vs3,vs4,vs5,2"
79 func_check "xxpermdi vs43,vs44,vs45,2"
80 func_check "xvmovdp vs3,vs4"
81 func_check "xvmovdp vs43,vs44"
82 func_check "xvmovdp vs3,vs4"
83 func_check "xvmovdp vs43,vs44"
84 func_check "xvcpsgndp vs3,vs4,vs5"
85 func_check "xvcpsgndp vs43,vs44,vs45"
86 func_check "doze"
87 func_check "nap"
88 func_check "sleep"
89 func_check "rvwinkle"
90 func_check "prtyw r3,r4"
91 func_check "prtyd r13,r14"
92 func_check "mfcfar r10"
93 func_check "mtcfar r11"
94 func_check "cmpb r3,r4,r5"
95 func_check "lwzcix r10,r11,r12"
96 func_check "dadd f16,f17,f18"
97 func_check "daddq f20,f22,f24"
98 func_check "dss 3"
99 func_check "dssall"
100 func_check "dst r5,r4,1"
101 func_check "dstt r8,r7,0"
102 func_check "dstst r5,r6,3"
103 func_check "dststt r4,r5,2"
104 func_check "divwe r10,r11,r12"
105 func_check "divwe. r11,r12,r13"
106 func_check "divweo r12,r13,r14"
107 func_check "divweo. r13,r14,r15"
108 func_check "divweu r10,r11,r12"
109 func_check "divweu. r11,r12,r13"
110 func_check "divweuo r12,r13,r14"
111 func_check "divweuo. r13,r14,r15"
112 func_check "bpermd r7,r17,r27"
113 func_check "popcntw r10,r20"
114 func_check "popcntd r10,r20"
115 func_check "ldbrx r20,r21,r22"
116 func_check "stdbrx r20,r21,r22"
117 func_check "lfiwzx f10,0,r10"
118 func_check "lfiwzx f10,r9,r10"
119 func_check "fcfids f4,f5"
120 func_check "fcfids. f4,f5"
121 func_check "fcfidus f4,f5"
122 func_check "fcfidus. f4,f5"
123 func_check "fctiwu f4,f5"
124 func_check "fctiwu. f4,f5"
125 func_check "fctiwuz f4,f5"
126 func_check "fctiwuz. f4,f5"
127 func_check "fctidu f4,f5"
128 func_check "fctidu. f4,f5"
129 func_check "fctiduz f4,f5"
130 func_check "fctiduz. f4,f5"
131 func_check "fcfidu f4,f5"
132 func_check "fcfidu. f4,f5"
133 func_check "ftdiv cr0,f10,f11"
134 func_check "ftdiv cr7,f10,f11"
135 func_check "ftsqrt cr0,f10"
136 func_check "ftsqrt cr7,f10"
137 func_check "dcbtt r8,r9"
138 func_check "dcbtstt r8,r9"
139 func_check "dcffix f10,f12"
140 func_check "dcffix. f20,f22"
141 func_check "fre f14,f15"
142 func_check "fre. f14,f15"
143 func_check "fres f14,f15"
144 func_check "fres. f14,f15"
145 func_check "frsqrte f14,f15"
146 func_check "frsqrte. f14,f15"
147 func_check "frsqrtes f14,f15"
148 func_check "frsqrtes. f14,f15"
149 func_check "isel r2,r3,r4,28"
150 func_check "yield"
151 func_check "yield"
152 func_check "ori r2,r2,0"
153 func_check "nop"
154 func_check "nop"
155 func_check "ori r2,r2,0"
156 func_check "mdoio"
157 func_check "mdoio"
158 func_check "mdoom"
159 func_check "mdoom"
160 func_check "mfppr r10"
161 func_check "mfppr32 r11"
162 func_check "mtppr r12"
163 func_check "mtppr32 r13"
164 func_check "tlbie r10,r11"