]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.opencl/datatypes.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opencl / datatypes.exp
CommitLineData
213516ef 1# Copyright 2010-2023 Free Software Foundation, Inc.
f4b8a18d
KW
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# Contributed by Ken Werner <ken.werner@de.ibm.com>.
17#
18# Tests OpenCL data types.
19
f4b8a18d
KW
20load_lib opencl.exp
21
22if { [skip_opencl_tests] } {
163df4df 23 unsupported "OpenCL support not detected"
f4b8a18d
KW
24 return 0
25}
26
27set testfile "datatypes"
28set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
29
30# Compile the generic OpenCL host app
31if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
5b362f04 32 untested "failed to compile"
f4b8a18d
KW
33 return -1
34}
35
36gdb_exit
37gdb_start
38
39# Manually switch the language to opencl
9f058c10 40gdb_test_no_output "set language opencl" "no prompt when setting the language to opencl"
f4b8a18d
KW
41
42# Check OpenCL data types (GDB)
43gdb_test "whatis bool" "type = bool"
648cd113 44gdb_test "p sizeof(bool)" " = 1"
f4b8a18d
KW
45
46gdb_test "whatis char" "type = char"
47gdb_test "p sizeof(char)" " = 1"
48gdb_test "whatis char2" "type = char2"
49gdb_test "p sizeof(char2)" " = 2"
50gdb_test "whatis char3" "type = char3"
51gdb_test "p sizeof(char3)" " = 4"
52gdb_test "whatis char4" "type = char4"
53gdb_test "p sizeof(char4)" " = 4"
54gdb_test "whatis char8" "type = char8"
55gdb_test "p sizeof(char8)" " = 8"
56gdb_test "whatis char16" "type = char16"
57gdb_test "p sizeof(char16)" " = 16"
58
59gdb_test "whatis unsigned char" "type = unsigned char"
60gdb_test "p sizeof(unsigned char)" " = 1"
61gdb_test "whatis uchar" "type = uchar"
62gdb_test "p sizeof(uchar)" " = 1"
63gdb_test "whatis uchar2" "type = uchar2"
64gdb_test "p sizeof(uchar2)" " = 2"
65gdb_test "whatis uchar3" "type = uchar3"
66gdb_test "p sizeof(uchar3)" " = 4"
67gdb_test "whatis uchar4" "type = uchar4"
68gdb_test "p sizeof(uchar4)" " = 4"
69gdb_test "whatis uchar8" "type = uchar8"
70gdb_test "p sizeof(uchar8)" " = 8"
71gdb_test "whatis uchar16" "type = uchar16"
72gdb_test "p sizeof(uchar16)" " = 16"
73
74gdb_test "whatis short" "type = short"
75gdb_test "p sizeof(short)" " = 2"
76gdb_test "whatis short2" "type = short2"
77gdb_test "p sizeof(short2)" " = 4"
78gdb_test "whatis short3" "type = short3"
79gdb_test "p sizeof(short3)" " = 8"
80gdb_test "whatis short4" "type = short4"
81gdb_test "p sizeof(short4)" " = 8"
82gdb_test "whatis short8" "type = short8"
83gdb_test "p sizeof(short8)" " = 16"
84gdb_test "whatis short16" "type = short16"
85gdb_test "p sizeof(short16)" " = 32"
86
87gdb_test "whatis unsigned short" "type = unsigned short"
88gdb_test "p sizeof(unsigned short)" " = 2"
89gdb_test "whatis ushort" "type = ushort"
90gdb_test "p sizeof(ushort)" " = 2"
91gdb_test "whatis ushort2" "type = ushort2"
92gdb_test "p sizeof(ushort2)" " = 4"
93gdb_test "whatis ushort3" "type = ushort3"
94gdb_test "p sizeof(ushort3)" " = 8"
95gdb_test "whatis ushort4" "type = ushort4"
96gdb_test "p sizeof(ushort4)" " = 8"
97gdb_test "whatis ushort8" "type = ushort8"
98gdb_test "p sizeof(ushort8)" " = 16"
99gdb_test "whatis ushort16" "type = ushort16"
100gdb_test "p sizeof(ushort16)" " = 32"
101
102gdb_test "whatis int" "type = int"
103gdb_test "p sizeof(int)" " = 4"
104gdb_test "whatis int2" "type = int2"
105gdb_test "p sizeof(int2)" " = 8"
106gdb_test "whatis int3" "type = int3"
107gdb_test "p sizeof(int3)" " = 16"
108gdb_test "whatis int4" "type = int4"
109gdb_test "p sizeof(int4)" " = 16"
110gdb_test "whatis int8" "type = int8"
111gdb_test "p sizeof(int8)" " = 32"
112gdb_test "whatis int16" "type = int16"
113gdb_test "p sizeof(int16)" " = 64"
114
115gdb_test "whatis unsigned int" "type = unsigned int"
116gdb_test "p sizeof(unsigned int)" " = 4"
117gdb_test "whatis uint" "type = uint"
118gdb_test "p sizeof(uint)" " = 4"
119gdb_test "whatis uint2" "type = uint2"
120gdb_test "p sizeof(uint2)" " = 8"
121gdb_test "whatis uint3" "type = uint3"
122gdb_test "p sizeof(uint3)" " = 16"
123gdb_test "whatis uint4" "type = uint4"
124gdb_test "p sizeof(uint4)" " = 16"
125gdb_test "whatis uint8" "type = uint8"
126gdb_test "p sizeof(uint8)" " = 32"
127gdb_test "whatis uint16" "type = uint16"
128gdb_test "p sizeof(uint16)" " = 64"
129
130gdb_test "whatis long" "type = long"
131gdb_test "p sizeof(long)" " = 8"
132gdb_test "whatis long2" "type = long2"
133gdb_test "p sizeof(long2)" " = 16"
134gdb_test "whatis long3" "type = long3"
135gdb_test "p sizeof(long3)" " = 32"
136gdb_test "whatis long4" "type = long4"
137gdb_test "p sizeof(long4)" " = 32"
138gdb_test "whatis long8" "type = long8"
139gdb_test "p sizeof(long8)" " = 64"
140gdb_test "whatis long16" "type = long16"
141gdb_test "p sizeof(long16)" " = 128"
142
143gdb_test "whatis unsigned long" "type = unsigned long"
144gdb_test "p sizeof(unsigned long)" " = 8"
145gdb_test "whatis ulong" "type = ulong"
146gdb_test "p sizeof(ulong)" " = 8"
147gdb_test "whatis ulong2" "type = ulong2"
148gdb_test "p sizeof(ulong2)" " = 16"
149gdb_test "whatis ulong3" "type = ulong3"
150gdb_test "p sizeof(ulong3)" " = 32"
151gdb_test "whatis ulong4" "type = ulong4"
152gdb_test "p sizeof(ulong4)" " = 32"
153gdb_test "whatis ulong8" "type = ulong8"
154gdb_test "p sizeof(ulong8)" " = 64"
155gdb_test "whatis ulong16" "type = ulong16"
156gdb_test "p sizeof(ulong16)" " = 128"
157
158gdb_test "whatis half" "type = half"
159gdb_test "p sizeof(half)" " = 2"
160gdb_test "whatis half2" "type = half2"
161gdb_test "p sizeof(half2)" " = 4"
162gdb_test "whatis half3" "type = half3"
163gdb_test "p sizeof(half3)" " = 8"
164gdb_test "whatis half4" "type = half4"
165gdb_test "p sizeof(half4)" " = 8"
166gdb_test "whatis half8" "type = half8"
167gdb_test "p sizeof(half8)" " = 16"
168gdb_test "whatis half16" "type = half16"
169gdb_test "p sizeof(half16)" " = 32"
170
171gdb_test "whatis float" "type = float"
172gdb_test "p sizeof(float)" " = 4"
173gdb_test "whatis float2" "type = float2"
174gdb_test "p sizeof(float2)" " = 8"
175gdb_test "whatis float3" "type = float3"
176gdb_test "p sizeof(float3)" " = 16"
177gdb_test "whatis float4" "type = float4"
178gdb_test "p sizeof(float4)" " = 16"
179gdb_test "whatis float8" "type = float8"
180gdb_test "p sizeof(float8)" " = 32"
181gdb_test "whatis float16" "type = float16"
182gdb_test "p sizeof(float16)" " = 64"
183
184gdb_test "whatis double" "type = double"
185gdb_test "p sizeof(double)" " = 8"
186gdb_test "whatis double2" "type = double2"
187gdb_test "p sizeof(double2)" " = 16"
188gdb_test "whatis double3" "type = double3"
189gdb_test "p sizeof(double3)" " = 32"
190gdb_test "whatis double4" "type = double4"
191gdb_test "p sizeof(double4)" " = 32"
192gdb_test "whatis double8" "type = double8"
193gdb_test "p sizeof(double8)" " = 64"
194gdb_test "whatis double16" "type = double16"
195gdb_test "p sizeof(double16)" " = 128"
196
197# Set the language back to the default: "auto; currently c"
9f058c10
LM
198gdb_test_no_output "set language c" "no prompt when setting the language to c"
199gdb_test_no_output "set language auto" "no prompt when setting the language to auto"
f4b8a18d
KW
200
201# Load the OpenCL app
202gdb_reinitialize_dir $srcdir/$subdir
203gdb_load ${objdir}/${subdir}/${testfile}
204
205# Set breakpoint at the OpenCL kernel
b2030fb5 206gdb_test "tbreak testkernel" \
d468832a
KW
207 "" \
208 "Set pending breakpoint" \
209 ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \
210 "y"
f4b8a18d
KW
211
212gdb_run_cmd
b2030fb5 213gdb_test "" ".*reakpoint.*1.*testkernel.*" "run"
f4b8a18d 214
d468832a
KW
215# Continue to the marker
216gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"]
217gdb_continue_to_breakpoint "marker"
218
f4b8a18d
KW
219# Check if the language was switched to opencl
220gdb_test "show language" "The current source language is \"auto; currently opencl\"\."
221
222# Retrieve some information about the OpenCL version and the availability of extensions
223set opencl_version [get_integer_valueof "opencl_version" 0]
224set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0]
225set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0]
226
227# Check OpenCL data types (DWARF)
228gdb_test "whatis b" "type = bool"
648cd113 229gdb_test "p sizeof(b)" " = 1"
3dfcbbd2 230gdb_test "print b" " = (false|0)"
f4b8a18d
KW
231
232gdb_test "whatis c" "type = char"
233gdb_test "p sizeof(c)" " = 1"
234gdb_test "print/d c" " = 1"
ea5e6b0e 235gdb_test "whatis c2" "type = char2"
f4b8a18d
KW
236gdb_test "p sizeof(c2)" " = 2"
237gdb_test "print c2" " = \\{1, 2\\}"
238if { ${opencl_version} >= 110 } {
ea5e6b0e 239 gdb_test "whatis c3" "type = char3"
f4b8a18d
KW
240 gdb_test "p sizeof(c3)" " = 4"
241 gdb_test "print c3" " = \\{1, 2, 3\\}"
242}
ea5e6b0e 243gdb_test "whatis c4" "type = char4"
f4b8a18d
KW
244gdb_test "p sizeof(c4)" " = 4"
245gdb_test "print c4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 246gdb_test "whatis c8" "type = char8"
f4b8a18d
KW
247gdb_test "p sizeof(c8)" " = 8"
248gdb_test "print c8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 249gdb_test "whatis c16" "type = char16"
f4b8a18d
KW
250gdb_test "p sizeof(c16)" " = 16"
251gdb_test "print c16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
252
ea5e6b0e 253gdb_test "whatis uc" "type = uchar"
f4b8a18d
KW
254gdb_test "p sizeof(uc)" " = 1"
255gdb_test "print/d uc" " = 1"
ea5e6b0e 256gdb_test "whatis uc2" "type = uchar2"
f4b8a18d
KW
257gdb_test "p sizeof(uc2)" " = 2"
258gdb_test "print uc2" " = \\{1, 2\\}"
259if { ${opencl_version} >= 110 } {
ea5e6b0e 260 gdb_test "whatis uc3" "type = uchar3"
3dfcbbd2 261 gdb_test "p sizeof(uc3)" " = 4"
f4b8a18d
KW
262 gdb_test "print uc3" " = \\{1, 2, 3\\}"
263}
ea5e6b0e 264gdb_test "whatis uc4" "type = uchar4"
f4b8a18d
KW
265gdb_test "p sizeof(uc4)" " = 4"
266gdb_test "print uc4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 267gdb_test "whatis uc8" "type = uchar8"
f4b8a18d
KW
268gdb_test "p sizeof(uc8)" " = 8"
269gdb_test "print uc8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 270gdb_test "whatis uc16" "type = uchar16"
f4b8a18d
KW
271gdb_test "p sizeof(uc16)" " = 16"
272gdb_test "print uc16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
273
274gdb_test "whatis s" "type = short"
275gdb_test "p sizeof(s)" " = 2"
276gdb_test "print s" " = -1"
ea5e6b0e 277gdb_test "whatis s2" "type = short2"
f4b8a18d
KW
278gdb_test "p sizeof(s2)" " = 4"
279gdb_test "print s2" " = \\{-1, -2\\}"
280if { ${opencl_version} >= 110 } {
ea5e6b0e 281 gdb_test "whatis s3" "type = short3"
f4b8a18d
KW
282 gdb_test "p sizeof(s3)" " = 8"
283 gdb_test "print s3" " = \\{-1, -2, -3\\}"
284}
ea5e6b0e 285gdb_test "whatis s4" "type = short4"
f4b8a18d
KW
286gdb_test "p sizeof(s4)" " = 8"
287gdb_test "print s4" " = \\{-1, -2, -3, -4\\}"
ea5e6b0e 288gdb_test "whatis s8" "type = short8"
f4b8a18d
KW
289gdb_test "p sizeof(s8)" " = 16"
290gdb_test "print s8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}"
ea5e6b0e 291gdb_test "whatis s16" "type = short16"
f4b8a18d
KW
292gdb_test "p sizeof(s16)" " = 32"
293gdb_test "print s16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}"
294
ea5e6b0e 295gdb_test "whatis us" "type = ushort"
f4b8a18d
KW
296gdb_test "p sizeof(us)" " = 2"
297gdb_test "print us" " = 1"
ea5e6b0e 298gdb_test "whatis us2" "type = ushort2"
f4b8a18d
KW
299gdb_test "p sizeof(us2)" " = 4"
300gdb_test "print us2" " = \\{1, 2\\}"
301if { ${opencl_version} >= 110 } {
ea5e6b0e 302 gdb_test "whatis us3" "type = ushort3"
f4b8a18d
KW
303 gdb_test "p sizeof(us3)" " = 8"
304 gdb_test "print us3" " = \\{1, 2, 3\\}"
305}
ea5e6b0e 306gdb_test "whatis us4" "type = ushort4"
f4b8a18d
KW
307gdb_test "p sizeof(us4)" " = 8"
308gdb_test "print us4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 309gdb_test "whatis us8" "type = ushort8"
f4b8a18d
KW
310gdb_test "p sizeof(us8)" " = 16"
311gdb_test "print us8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 312gdb_test "whatis us16" "type = ushort16"
f4b8a18d
KW
313gdb_test "p sizeof(us16)" " = 32"
314gdb_test "print us16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
315
316gdb_test "whatis i" "type = int"
317gdb_test "p sizeof(i)" " = 4"
318gdb_test "print i" " = -1"
ea5e6b0e 319gdb_test "whatis i2" "type = int2"
f4b8a18d
KW
320gdb_test "p sizeof(i2)" " = 8"
321gdb_test "print i2" " = \\{-1, -2\\}"
322if { ${opencl_version} >= 110 } {
ea5e6b0e 323 gdb_test "whatis i3" "type = int3"
f4b8a18d
KW
324 gdb_test "p sizeof(i3)" " = 16"
325 gdb_test "print i3" " = \\{-1, -2, -3\\}"
326}
ea5e6b0e 327gdb_test "whatis i4" "type = int4"
f4b8a18d
KW
328gdb_test "p sizeof(i4)" " = 16"
329gdb_test "print i4" " = \\{-1, -2, -3, -4\\}"
ea5e6b0e 330gdb_test "whatis i8" "type = int8"
f4b8a18d
KW
331gdb_test "p sizeof(i8)" " = 32"
332gdb_test "print i8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}"
ea5e6b0e 333gdb_test "whatis i16" "type = int16"
f4b8a18d
KW
334gdb_test "p sizeof(i16)" " = 64"
335gdb_test "print i16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}"
336
ea5e6b0e 337gdb_test "whatis ui" "type = uint"
f4b8a18d
KW
338gdb_test "p sizeof(ui)" " = 4"
339gdb_test "print ui" " = 1"
ea5e6b0e 340gdb_test "whatis ui2" "type = uint2"
f4b8a18d
KW
341gdb_test "p sizeof(ui2)" " = 8"
342gdb_test "print ui2" " = \\{1, 2\\}"
343if { ${opencl_version} >= 110 } {
ea5e6b0e 344 gdb_test "whatis ui3" "type = uint3"
f4b8a18d
KW
345 gdb_test "p sizeof(ui3)" " = 16"
346 gdb_test "print ui3" " = \\{1, 2, 3\\}"
347}
ea5e6b0e 348gdb_test "whatis ui4" "type = uint4"
f4b8a18d
KW
349gdb_test "p sizeof(ui4)" " = 16"
350gdb_test "print ui4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 351gdb_test "whatis ui8" "type = uint8"
f4b8a18d
KW
352gdb_test "p sizeof(ui8)" " = 32"
353gdb_test "print ui8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 354gdb_test "whatis ui16" "type = uint16"
f4b8a18d
KW
355gdb_test "p sizeof(ui16)" " = 64"
356gdb_test "print ui16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
357
358gdb_test "whatis l" "type = long"
359gdb_test "p sizeof(l)" " = 8"
360gdb_test "print l" " = -1"
ea5e6b0e 361gdb_test "whatis l2" "type = long2"
f4b8a18d
KW
362gdb_test "p sizeof(l2)" " = 16"
363gdb_test "print l2" " = \\{-1, -2\\}"
364if { ${opencl_version} >= 110 } {
ea5e6b0e 365 gdb_test "whatis l3" "type = long3"
f4b8a18d
KW
366 gdb_test "p sizeof(l3)" " = 32"
367 gdb_test "print l3" " = \\{-1, -2, -3\\}"
368}
ea5e6b0e 369gdb_test "whatis l4" "type = long4"
f4b8a18d
KW
370gdb_test "p sizeof(l4)" " = 32"
371gdb_test "print l4" " = \\{-1, -2, -3, -4\\}"
ea5e6b0e 372gdb_test "whatis l8" "type = long8"
f4b8a18d
KW
373gdb_test "p sizeof(l8)" " = 64"
374gdb_test "print l8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}"
ea5e6b0e 375gdb_test "whatis l16" "type = long16"
f4b8a18d
KW
376gdb_test "p sizeof(l16)" " = 128"
377gdb_test "print l16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}"
378
ea5e6b0e 379gdb_test "whatis ul" "type = ulong"
f4b8a18d
KW
380gdb_test "p sizeof(ul)" " = 8"
381gdb_test "print ul" " = 1"
ea5e6b0e 382gdb_test "whatis ul2" "type = ulong2"
f4b8a18d
KW
383gdb_test "p sizeof(ul2)" " = 16"
384gdb_test "print ul2" " = \\{1, 2\\}"
385if { ${opencl_version} >= 110 } {
ea5e6b0e 386 gdb_test "whatis ul3" "type = ulong3"
f4b8a18d
KW
387 gdb_test "p sizeof(ul3)" " = 32"
388 gdb_test "print ul3" " = \\{1, 2, 3\\}"
389}
ea5e6b0e 390gdb_test "whatis ul4" "type = ulong4"
f4b8a18d
KW
391gdb_test "p sizeof(ul4)" " = 32"
392gdb_test "print ul4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 393gdb_test "whatis ul8" "type = ulong8"
f4b8a18d
KW
394gdb_test "p sizeof(ul8)" " = 64"
395gdb_test "print ul8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 396gdb_test "whatis ul16" "type = ulong16"
f4b8a18d
KW
397gdb_test "p sizeof(ul16)" " = 128"
398gdb_test "print ul16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
399
3dfcbbd2 400gdb_test "whatis ph" "type = half \\*"
f4b8a18d
KW
401gdb_test "whatis *ph" "type = half"
402gdb_test "p sizeof(*ph)" " = 2"
403
404if { ${have_cl_khr_fp16} } {
405 gdb_test "whatis h" "type = half"
406 gdb_test "p sizeof(h)" " = 2"
407 gdb_test "print h" " = 1"
ea5e6b0e 408 gdb_test "whatis h2" "type = half2"
f4b8a18d
KW
409 gdb_test "p sizeof(h2)" " = 4"
410 gdb_test "print h2" " = \\{1, 2\\}"
411 if { ${opencl_version} >= 110 } {
ea5e6b0e 412 gdb_test "whatis h3" "type = half3"
f4b8a18d
KW
413 gdb_test "p sizeof(h3)" " = 8"
414 gdb_test "print h3" " = \\{1, 2, 3\\}"
415 }
ea5e6b0e 416 gdb_test "whatis h4" "type = half4"
f4b8a18d
KW
417 gdb_test "p sizeof(h4)" " = 8"
418 gdb_test "print h4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 419 gdb_test "whatis h8" "type = half8"
f4b8a18d
KW
420 gdb_test "p sizeof(h8)" " = 16"
421 gdb_test "print h8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 422 gdb_test "whatis h16" "type = half16"
f4b8a18d
KW
423 gdb_test "p sizeof(h16)" " = 16"
424 gdb_test "print h16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
425}
426
427gdb_test "whatis f" "type = float"
428gdb_test "p sizeof(f)" " = 4"
429gdb_test "print f" " = 1"
ea5e6b0e 430gdb_test "whatis f2" "type = float2"
f4b8a18d
KW
431gdb_test "p sizeof(f2)" " = 8"
432gdb_test "print f2" " = \\{1, 2\\}"
433if { ${opencl_version} >= 110 } {
ea5e6b0e 434 gdb_test "whatis f3" "type = float3"
f4b8a18d
KW
435 gdb_test "p sizeof(f3)" " = 16"
436 gdb_test "print f3" " = \\{1, 2, 3\\}"
437}
ea5e6b0e 438gdb_test "whatis f4" "type = float4"
f4b8a18d
KW
439gdb_test "p sizeof(f4)" " = 16"
440gdb_test "print f4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 441gdb_test "whatis f8" "type = float8"
f4b8a18d
KW
442gdb_test "p sizeof(f8)" " = 32"
443gdb_test "print f8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 444gdb_test "whatis f16" "type = float16"
f4b8a18d
KW
445gdb_test "p sizeof(f16)" " = 64"
446gdb_test "print f16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
447
448if { ${have_cl_khr_fp64} } {
449 gdb_test "whatis d" "type = double"
450 gdb_test "p sizeof(d)" " = 8"
451 gdb_test "print d" " = 1"
ea5e6b0e 452 gdb_test "whatis d2" "type = double2"
f4b8a18d
KW
453 gdb_test "p sizeof(d2)" " = 16"
454 gdb_test "print d2" " = \\{1, 2\\}"
455 if { ${opencl_version} >= 110 } {
ea5e6b0e 456 gdb_test "whatis d3" "type = double3"
f4b8a18d
KW
457 gdb_test "p sizeof(d3)" " = 32"
458 gdb_test "print d3" " = \\{1, 2, 3\\}"
459 }
ea5e6b0e 460 gdb_test "whatis d4" "type = double4"
f4b8a18d
KW
461 gdb_test "p sizeof(d4)" " = 32"
462 gdb_test "print d4" " = \\{1, 2, 3, 4\\}"
ea5e6b0e 463 gdb_test "whatis d8" "type = double8"
f4b8a18d
KW
464 gdb_test "p sizeof(d8)" " = 64"
465 gdb_test "print d8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}"
ea5e6b0e 466 gdb_test "whatis d16" "type = double16"
f4b8a18d
KW
467 gdb_test "p sizeof(d16)" " = 128"
468 gdb_test "print d16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}"
469}
470
471# Delete the OpenCL program source
472remote_file target delete ${clprogram}