Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.rocm / precise-memory-multi-inferiors.exp
blobde86eb2dd186ba4f3d43241fcf8b4fc62c6da549
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.
21 load_lib rocm.exp
23 require allow_hipcc_tests
25 clean_restart
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"
33     if $::test_python {
34         gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
35             "False" \
36             "show initial value using Python, inferior 1"
37     }
38     gdb_test_no_output "set amdgpu precise-memory" \
39         "set on inferior 1"
40     gdb_test "show amdgpu precise-memory" \
41         "AMDGPU precise memory access reporting is on \\(currently disabled\\)." \
42         "show new value, inferior 1"
43     if $::test_python {
44         gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
45             "True" \
46             "show new value using Python, inferior 1"
47     }
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"
55     if $::test_python {
56         gdb_test "python print(gdb.parameter(\"amdgpu precise-memory\"))" \
57             "False" \
58             "show initial value using Python, inferior 2"
59     }
62 proc test_copy_precise_memory_on_clone {precise_memory} {
63     set value $precise_memory
64     if {$precise_memory == "unspecified"} {
65         set value off
66     }
68     clean_restart
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"
75     }
77     gdb_test "clone-inferior" "Added inferior 2.*"
78     gdb_test "inferior 2"
79     gdb_test "show amdgpu precise-memory" "is $value.*" \
80         "show amdgpu precise-memory on cloned inferior"
83 test_per_inferior
85 foreach_with_prefix precise_memory { unspecified on off } {
86     test_copy_precise_memory_on_clone $precise_memory