]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix clean_restart in gdb.opencl/callfuncs.exp
authorTom de Vries <tdevries@suse.de>
Wed, 3 Sep 2025 12:18:35 +0000 (14:18 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 3 Sep 2025 12:18:35 +0000 (14:18 +0200)
In test-case gdb.opencl/callfuncs.exp I noticed:
...
clean_restart [standard_testfile $testfile]
...

This doesn't have the desired effect of starting gdb with $testfile because
standard_testfile doesn't return anything.

Fix this by using "clean_restart $testfile".

While we're at it:
- move standard_testfile to the start of the file
- drop the redundant 'set testfile "callfuncs"'
- use standard_testfile .cl to properly define $srcfile
- use $srcfile instead of $testfile.cl

Tested on x86_64-linux, using the demonstrator patch in PR testsuite/33363.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33363

gdb/testsuite/gdb.opencl/callfuncs.exp

index 8ab8db74e406722959b14a9707d142af300463f1..698246192364a99e64bc4da2c66c2ff39c30ab66 100644 (file)
@@ -21,8 +21,9 @@ load_lib opencl.exp
 
 require allow_opencl_tests
 
-set testfile "callfuncs"
-set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl]
+standard_testfile .cl
+
+set clprogram [remote_download target $srcdir/$subdir/$srcfile]
 
 # Compile the generic OpenCL host app
 if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
@@ -30,7 +31,7 @@ if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } {
     return -1
 }
 
-clean_restart [standard_testfile $testfile]
+clean_restart $testfile
 
 # Set breakpoint at the OpenCL kernel
 gdb_test "tbreak testkernel" \