| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mlong-calls" } */ |
| 3 |
/* { dg-final { scan-assembler-not "bl\[^\n\]*dump_stack" } } */ |
| 4 |
|
| 5 |
extern void dump_stack (void) __attribute__ ((__cold__)) __attribute__ ((noinline)); |
| 6 |
struct thread_info { |
| 7 |
struct task_struct *task; |
| 8 |
}; |
| 9 |
extern struct thread_info *current_thread_info (void); |
| 10 |
extern int show_stack (struct task_struct *, unsigned long *); |
| 11 |
|
| 12 |
void dump_stack (void) |
| 13 |
{ |
| 14 |
unsigned long stack; |
| 15 |
show_stack ((current_thread_info ()->task), &stack); |
| 16 |
} |
| 17 |
|
| 18 |
void die (char *str, void *fp, int nr) |
| 19 |
{ |
| 20 |
if (nr) |
| 21 |
dump_stack (); |
| 22 |
while (1); |
| 23 |
} |
| 24 |
|