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