1 # Copyright 2021-2024 Free Software Foundation, Inc.
3 # This file is part of GDB.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test that the "set amdgpu precise-memory" setting is per-inferior, and
19 # inherited by an inferior created using the clone-inferior command.
23 require allow_hipcc_tests
27 set test_python [allow_python_tests]
29 proc test_per_inferior { } {
30 gdb_test "show amdgpu precise-memory" \
31 "AMDGPU precise memory access reporting is off \\(currently disabled\\)." \
32 "show initial value, inferior 1"
34 gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
36 "show initial value using Python, inferior 1"
38 gdb_test_no_output "set amdgpu precise-memory" \
40 gdb_test "show amdgpu precise-memory" \
41 "AMDGPU precise memory access reporting is on \\(currently disabled\\)." \
42 "show new value, inferior 1"
44 gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
46 "show new value using Python, inferior 1"
49 gdb_test "add-inferior" "Added inferior 2"
50 gdb_test "inferior 2" "Switching to inferior 2 .*"
52 gdb_test "show amdgpu precise-memory" \
53 "AMDGPU precise memory access reporting is off \\(currently disabled\\)." \
54 "show initial value, inferior 2"
56 gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
58 "show initial value using Python, inferior 2"
62 proc test_copy_precise_memory_on_clone {precise_memory} {
63 set value $precise_memory
64 if {$precise_memory == "unspecified"} {
69 gdb_test "show amdgpu precise-memory" "is off.*" \
70 "show default amdgpu precise-memory"
71 if {$precise_memory != "unspecified"} {
72 gdb_test_no_output "set amdgpu precise-memory $value"
73 gdb_test "show amdgpu precise-memory" "is $value.*" \
74 "show amdgpu precise-memory on original inferior"
77 gdb_test "clone-inferior" "Added inferior 2.*"
79 gdb_test "show amdgpu precise-memory" "is $value.*" \
80 "show amdgpu precise-memory on cloned inferior"
85 foreach_with_prefix precise_memory { unspecified on off } {
86 test_copy_precise_memory_on_clone $precise_memory