public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: debugedit@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [COMMITTED] tests: Check gcc accepts -gdwarf-5 otherwise skip DWARF5 tests
Date: Thu, 25 Mar 2021 00:29:23 +0100	[thread overview]
Message-ID: <20210324232923.22371-1-mark@klomp.org> (raw)

Add a configure check for -gdawrf-5. Set GDWARF_5_FLAG in atlocal.in
to yes or no. Use AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) in
debugedit.at.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 configure.ac       | 10 ++++++++++
 tests/atlocal.in   |  2 +-
 tests/debugedit.at |  6 ++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 09cc82e..b4bd749 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,16 @@ AC_FUNC_MMAP
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([memchr memset munmap strchr strdup strerror strrchr])
 
+# Checks for compiler flags.
+AC_CACHE_CHECK([whether gcc supports -gdwarf-5], ac_cv_gdwarf_5, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="-gdwarf-5"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_gdwarf_5=yes, ac_cv_gdwarf_5=no)
+CFLAGS="$save_CFLAGS"
+])
+GDWARF_5_FLAG=$ac_cv_gdwarf_5
+AC_SUBST([GDWARF_5_FLAG])
+
 # And generate the output files.
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 4b7303b..1324898 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -2,4 +2,4 @@
 # Configurable variable values for test suite.
 
 PATH=@abs_builddir@:@abs_top_builddir@:$top_srcdir:$srcdir:$PATH
-
+GDWARF_5_FLAG=@GDWARF_5_FLAG@
diff --git a/tests/debugedit.at b/tests/debugedit.at
index 2d1870b..9e6606a 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -120,6 +120,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str objects DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -184,6 +185,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str partial DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -245,6 +247,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str exe DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -484,6 +487,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line objects DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
@@ -530,6 +534,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line partial DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
@@ -574,6 +579,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line exe DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
-- 
2.20.1


                 reply	other threads:[~2021-03-24 23:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324232923.22371-1-mark@klomp.org \
    --to=mark@klomp.org \
    --cc=debugedit@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).