diff options
author | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2021-03-19 10:37:58 +0530 |
---|---|---|
committer | Alok Kumar Sharma <AlokKumar.Sharma@amd.com> | 2021-03-19 10:44:56 +0530 |
commit | a088215ae37be0f44bce508ca0050fe9149beb39 (patch) | |
tree | 53cae304f279cb25e008a5892f211a5015d3108c /gdb | |
parent | 3818d4ab066ee40b976513b247b5da5f20379b66 (diff) | |
download | gdb-a088215ae37be0f44bce508ca0050fe9149beb39.zip gdb-a088215ae37be0f44bce508ca0050fe9149beb39.tar.gz gdb-a088215ae37be0f44bce508ca0050fe9149beb39.tar.bz2 |
Enable macro test for clang compiler
`clang` uses `-fdebug-macro` switch to enable debug-info
for macros.
gdb/testsuite/ChangeLog:
2021-03-19 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
* gdb.base/info-macros.exp: Append -fdebug-macro to
additional_flags for clang.
* gdb.base/macscp.exp: Likewise.
* gdb.base/style.exp: Likewise.
* gdb.linespec/macro-relative.exp: Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/info-macros.exp | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/macscp.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/style.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.linespec/macro-relative.exp | 2 |
5 files changed, 26 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c1d7fec..42484fa 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2021-03-19 Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> + + * gdb.base/info-macros.exp: Append -fdebug-macro to + additional_flags for clang. + * gdb.base/macscp.exp: Likewise. + * gdb.base/style.exp: Likewise. + * gdb.linespec/macro-relative.exp: Likewise. + 2021-03-17 Simon Marchi <simon.marchi@polymtl.ca> Pedro Alves <pedro@palves.net> diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp index 90da9db..c75229f 100644 --- a/gdb/testsuite/gdb.base/info-macros.exp +++ b/gdb/testsuite/gdb.base/info-macros.exp @@ -22,15 +22,17 @@ if [using_fission] { } get_compiler_info -if ![test_compiler_info gcc*] { - untested "no compiler info" - return -1 +if { [test_compiler_info gcc*] } { + # Don't use "debug" here. Otherwise "-g" would be appended to the gcc + # command line, possibly overriding "-g3" (depending on gcc version). + set options "additional_flags=-g3" +} elseif { [test_compiler_info clang*] } { + set options "additional_flags=-fdebug-macro" +} else { + untested "no compiler info" + return -1 } -# Don't use "debug" here. Otherwise "-g" would be appended to the gcc -# command line, possibly overriding "-g3" (depending on gcc version). -set options "additional_flags=-g3" - if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $options] } { return -1 } diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp index 724f737..9d295ad 100644 --- a/gdb/testsuite/gdb.base/macscp.exp +++ b/gdb/testsuite/gdb.base/macscp.exp @@ -21,8 +21,10 @@ set objfile [standard_output_file ${testfile}.o] set options { debug additional_flags=-DFROM_COMMANDLINE=ARG} get_compiler_info -if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } { +if { [test_compiler_info "gcc-*"] } { lappend options additional_flags=-g3 +} elseif { [test_compiler_info "clang-*"] } { + lappend options additional_flags=-fdebug-macro } # Generate the intermediate object file. This is required by Darwin to diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 0754c9d..4a3428b 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -21,9 +21,12 @@ standard_testfile set test_macros 0 set options debug get_compiler_info -if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } { +if { [test_compiler_info "gcc-*"] } { lappend options additional_flags=-g3 set test_macros 1 +} elseif { [test_compiler_info "clang-*"] } { + lappend options additional_flags=-fdebug-macro + set test_macros 1 } if {[build_executable "failed to build" $testfile $srcfile $options]} { diff --git a/gdb/testsuite/gdb.linespec/macro-relative.exp b/gdb/testsuite/gdb.linespec/macro-relative.exp index 32375e5..c8e5b29 100644 --- a/gdb/testsuite/gdb.linespec/macro-relative.exp +++ b/gdb/testsuite/gdb.linespec/macro-relative.exp @@ -31,6 +31,8 @@ set opts {debug additional_flags=-I.} get_compiler_info if [test_compiler_info gcc*] { lappend opts additional_flags=-g3 +} elseif [test_compiler_info clang*] { + lappend opts additional_flags=-fdebug-macro } if { [file pathtype $objdir] == "relative" } { |