1 # Copyright 2019-2020 Free Software Foundation, Inc.
2 # Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
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.
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.
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/>.
18 set testfile "bit_extract_compile"
19 set srcfile ${srcdir}/${subdir}/${testfile}.cpp
20 set objfile [standard_output_file ${testfile}.o]
21 set binfile [standard_output_file ${testfile}]
26 # Check if skip hip tests
27 if [skip_hipcc_tests] {
28 verbose "Skipping hip test: ${testfile}."
32 # Compile the hip program
33 if {[prepare_for_testing "failed to prepare ${testfile}" $testfile $srcfile {debug hip}]} {
40 # Load the hip program
41 if {[gdb_load ${binfile}] == -1} {
42 verbose "failed to load program ${testfile}."
46 # Run to main and break
48 fail "can't run to main and break in program ${testfile}."
52 # Set breakpoing in device code
53 gdb_breakpoint "bit_extract_kernel" "allow-pending"
54 gdb_continue_to_breakpoint "bit_extract_kernel"
57 # vega10 56 sample output "1 43:00.0 vega10 4 56 4 10"
58 gdb_test_sequence "info agents" "info agents" {
59 {Id\s+PCI Slot\s+Device Name\s+Shader Engines\s+Compute Units\s+SIMD/CU\s+Wavefronts/SIMD}
60 {\d\s+\d+:\d+\.\d\s+\w+\d+\s+\d+\s+\d+\s+\d+\s+\d}
63 # Check continue at device breakpoint in all-stop mode
64 gdb_test "c" ".+hit\\s+Breakpoint.+bit_extract_kernel\\(.*"
67 gdb_test_sequence "info threads" "info threads" {