Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/unwind-backchain.c

raw
1 /* -linux* targets have a fallback for the absence of unwind tables, thus are
2 the only ones we can guarantee backtrace returns all addresses. */
3 /* { dg-do run { target { *-*-linux* } } } */
4 /* { dg-options "-fno-asynchronous-unwind-tables" } */
5
6 #include <execinfo.h>
7
8 void
9 test_backtrace()
10 {
11 int addresses;
12 void *buffer[10];
13
14 addresses = backtrace(buffer, 10);
15 if(addresses != 4)
16 __builtin_abort();
17 }
18
19 int
20 main()
21 {
22 test_backtrace();
23 return 0;
24 }