From: Tom de Vries Date: Wed, 3 Sep 2025 12:18:35 +0000 (+0200) Subject: [gdb/testsuite] Fix clean_restart in gdb.opencl/callfuncs.exp X-Git-Tag: gdb-17-branchpoint~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aebc33d411dcbf876c1fa3b8af02361dd39de183;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix clean_restart in gdb.opencl/callfuncs.exp 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 --- diff --git a/gdb/testsuite/gdb.opencl/callfuncs.exp b/gdb/testsuite/gdb.opencl/callfuncs.exp index 8ab8db74e40..69824619236 100644 --- a/gdb/testsuite/gdb.opencl/callfuncs.exp +++ b/gdb/testsuite/gdb.opencl/callfuncs.exp @@ -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" \