| 1 |
// { dg-do assemble } |
| 2 |
// { dg-xfail-if "" { sparc64-*-elf } } |
| 3 |
// { dg-options "-g" } |
| 4 |
// GROUPS passed old-abort |
| 5 |
extern "C" { typedef int jmp_buf[12]; } |
| 6 |
|
| 7 |
enum Error { NO_ERROR }; |
| 8 |
class ErrorHandler |
| 9 |
{ |
| 10 |
ErrorHandler *previous; |
| 11 |
static ErrorHandler *error_stack; |
| 12 |
jmp_buf error_buffer; |
| 13 |
protected: |
| 14 |
static void pop() |
| 15 |
{ |
| 16 |
error_stack = error_stack->previous; |
| 17 |
} |
| 18 |
public: |
| 19 |
jmp_buf *push() |
| 20 |
{ |
| 21 |
previous = error_stack; |
| 22 |
error_stack = this; |
| 23 |
return &error_buffer; |
| 24 |
} |
| 25 |
}; |