aboutsummaryrefslogtreecommitdiff
path: root/debug/tst-backtrace4.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/tst-backtrace4.c')
-rw-r--r--debug/tst-backtrace4.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/debug/tst-backtrace4.c b/debug/tst-backtrace4.c
index 41a3f51349..9c0c2a2a7d 100644
--- a/debug/tst-backtrace4.c
+++ b/debug/tst-backtrace4.c
@@ -25,28 +25,16 @@
#include <signal.h>
#include <unistd.h>
+#include "tst-backtrace.h"
+
static int do_test (void);
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
-/* Set to a non-zero value if the test fails. */
-volatile int ret;
-
-/* Accesses to X are used to prevent optimization. */
-volatile int x;
-
-/* Called if the test fails. */
-#define FAIL() \
- do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
-
/* The backtrace should include at least handle_signal, a signal
trampoline, 3 * fn, and do_test. */
#define NUM_FUNCTIONS 6
-/* Use this attribute to prevent inlining, so that all expected frames
- are present. */
-#define NO_INLINE __attribute__ ((noinline))
-
volatile int sig_handled = 0;
void
@@ -79,14 +67,14 @@ handle_signal (int signum)
for (i = 0; i < n; ++i)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
- if (strstr (symbols[0], "handle_signal") == NULL)
+ if (!match (symbols[0], "handle_signal"))
{
FAIL ();
return;
}
/* Do not check name for signal trampoline. */
for (i = 2; i < n - 1; i++)
- if (strstr (symbols[i], "fn") == NULL)
+ if (!match (symbols[i], "fn"))
{
FAIL ();
return;