]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.ctf/dwarf2-and-ctf.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ctf / dwarf2-and-ctf.exp
1 # Copyright 2023-2024 Free Software Foundation, Inc.
2
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.
7 #
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.
12 #
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/>.
15
16 require allow_ctf_tests
17
18 standard_testfile .c -2.c
19
20 set objfile [standard_output_file ${testfile}.o]
21 set objfile2 [standard_output_file ${testfile}-2.o]
22
23 set s1 ${srcdir}/${subdir}/${srcfile}
24 set s2 ${srcdir}/${subdir}/${srcfile2}
25
26 set opts {}
27 lappend opts debug
28 if { [gdb_compile $s1 ${objfile} object $opts] != "" } {
29 untested "failed to compile"
30 return -1
31 }
32
33 set opts {}
34 lappend opts "additional_flags=-gctf"
35 if { [gdb_compile $s2 ${objfile2} object $opts] != "" } {
36 untested "failed to compile"
37 return -1
38 }
39
40 set opts {}
41 lappend opts "additional_flags=-Wl,-ctf-variables"
42 if { [gdb_compile [list ${objfile} ${objfile2}] $binfile executable $opts] != "" } {
43 unsupported "failed to link"
44 return -1
45 }
46
47 clean_restart
48
49 gdb_test_no_output "set always-read-ctf on"
50
51 gdb_load $binfile
52
53 gdb_test "print var_dwarf" " = 1"
54 gdb_test "print var_ctf" " = 2"