1 # Copyright 2023-2024 Free Software Foundation, Inc.
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/>.
16 # Test use of DW_OP_GNU_uninit with DW_OP_piece. For this case, GDB
19 # DWARF-2 expression error: DW_OP_GNU_uninit must always be the very last op.
23 require dwarf2_support
25 standard_testfile main.c -dw.S
27 set asm_file [standard_output_file $srcfile2]
29 set c64 6639779683436459270
32 Dwarf::assemble $asm_file {
35 declare_labels i64_type i32_type
39 {encoding @DW_ATE_signed}
40 {byte_size 8 DW_FORM_sdata}
45 {encoding @DW_ATE_signed}
46 {byte_size 4 DW_FORM_sdata}
74 if {[build_executable ${testfile}.exp ${testfile} \
75 [list $srcfile $asm_file] {nodebug}]} {
79 clean_restart ${testfile}
85 set cmd "print i64_var"
86 if { [is_64_target] } {
88 " = +\\\[uninitialized\\\] $c64"
93 gdb_test "print i32_var" \
94 " = +\\\[uninitialized\\\] $c32"