aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/unwind-backchain.c
blob: affa9b2efecc2235e344d41a1b824463edf18e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* -linux* targets have a fallback for the absence of unwind tables, thus are
   the only ones we can guarantee backtrace returns all addresses.  */
/* { dg-do run { target { *-*-linux* } } } */
/* { dg-options "-fno-asynchronous-unwind-tables" } */

#include <execinfo.h>

void
test_backtrace()
{
  int addresses;
  void *buffer[10];

  addresses = backtrace(buffer, 10);
  if(addresses != 4)
    __builtin_abort();
}

int
main()
{
  test_backtrace();
  return 0;
}