c8e5b29d81f0d17406f8d5893f869a35436273ca
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.linespec / macro-relative.exp
1 # Copyright 2013-2021 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 standard_testfile
17
18 # Fission doesn't support macros yet. Bug 15954.
19 if [using_fission] {
20 unsupported "fission"
21 return -1
22 }
23
24 if [is_remote host] {
25 unsupported "compiling on a remote host does not support a filename with directory."
26 return 0
27 }
28
29 set opts {debug additional_flags=-I.}
30
31 get_compiler_info
32 if [test_compiler_info gcc*] {
33 lappend opts additional_flags=-g3
34 } elseif [test_compiler_info clang*] {
35 lappend opts additional_flags=-fdebug-macro
36 }
37
38 if { [file pathtype $objdir] == "relative" } {
39 untested "objdir $objdir should be absolute"
40 return
41 }
42 set saved_pwd [pwd]
43 cd $srcdir/${subdir}/base/two
44 set err [gdb_compile "../../${srcfile}" "${binfile}" executable $opts]
45 cd $saved_pwd
46 if { $err != "" } {
47 untested "compilation failed"
48 return -1
49 }
50
51 clean_restart ${testfile}
52
53 # Test macros respect DW_AT_comp_dir.
54
55 # "list header_two_func" does not set exactly the one line we want.
56 if ![runto header_two_func] {
57 return -1
58 }
59
60 gdb_test "info macro HEADER" "\r\n#define HEADER 2"
This page took 0.030484 seconds and 3 git commands to generate.