# Copyright (C) 2022-2024 Free Software Foundation, Inc. # Copyright (C) 2022-2024 Advanced Micro Devices, Inc. All rights reserved. # This file is part of GDB. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Check that waves which have finished execution are removed from the thread # list. load_lib rocm.exp require allow_hip_tests standard_testfile .cpp # Don't use $testfile as the executable name, because Windows' # installer detection heuristic refuses to launch executables whose # name contains "update" (and a few other keywords like "setup" and # "install") without elevation, failing with ERROR_ELEVATION_REQUIRED # (740). set executable "test" if {[prepare_for_testing "failed to prepare ${testfile}" $executable $srcfile {debug hip}]} { return -1 } with_rocm_gpu_lock { if ![runto_main] { fail "can't run to main" return -1 } # Set breakpoing in device code. gdb_breakpoint "kern" "allow-pending" # Continue to the first dispatch. gdb_continue_to_breakpoint "dispatch 1" # Continue to the second dispatch. gdb_continue_to_breakpoint "dispatch 2" # At this point the wave from the first dispatch is gone, it should not show in the thread # list. set n_waves 0 gdb_test_multiple "info threads" "" { -re "AMDGPU Wave " { incr n_waves 1 exp_continue } -re "$::gdb_prompt " { gdb_assert {$n_waves == 1} $gdb_test_name } } }