| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target ia32 } */ |
| 3 |
/* { dg-require-effective-target fpic } */ |
| 4 |
/* { dg-options "-O2 -fpic -fexceptions -fasynchronous-unwind-tables" } */ |
| 5 |
/* { dg-final { scan-assembler "movl\[ \\t\].+, %ebx" } } */ |
| 6 |
extern int foo (int); |
| 7 |
extern void exit (int __status) __attribute__ ((__nothrow__ )) __attribute__ ((__noreturn__)); |
| 8 |
struct __pthread_cleanup_frame |
| 9 |
{ |
| 10 |
void (*__cancel_routine) (void *); |
| 11 |
void *__cancel_arg; |
| 12 |
int __do_it; |
| 13 |
int __cancel_type; |
| 14 |
}; |
| 15 |
extern __inline void |
| 16 |
__pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) |
| 17 |
{ |
| 18 |
if (__frame->__do_it) |
| 19 |
__frame->__cancel_routine (__frame->__cancel_arg); |
| 20 |
} |
| 21 |
static int cl_called; |
| 22 |
|
| 23 |
static void |
| 24 |
cl (void *arg) |
| 25 |
{ |
| 26 |
++cl_called; |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
void * |
| 31 |
tf_usleep (void *arg) |
| 32 |
{ |
| 33 |
|
| 34 |
do { struct __pthread_cleanup_frame __clframe __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) = { .__cancel_routine = (cl), .__cancel_arg = ( |
| 35 |
((void *)0)), .__do_it = 1 };; |
| 36 |
|
| 37 |
foo (arg == ((void *)0) ? (0x7fffffffL * 2UL + 1UL) : 0); |
| 38 |
|
| 39 |
__clframe.__do_it = (0); } while (0); |
| 40 |
|
| 41 |
exit (1); |
| 42 |
} |