PR target/83368
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr66334.c
blob97dfecc8725cd6695d5b4aaa6aac45261e4e1c38
1 /* { dg-do compile } */
2 /* { dg-require-effective-target ia32 } */
3 /* { dg-options "-O2 -fpic -fexceptions -fasynchronous-unwind-tables" } */
4 /* { dg-final { scan-assembler "movl\[ \\t\].+, %ebx" } } */
5 extern int foo (int);
6 extern void exit (int __status) __attribute__ ((__nothrow__ )) __attribute__ ((__noreturn__));
7 struct __pthread_cleanup_frame
9 void (*__cancel_routine) (void *);
10 void *__cancel_arg;
11 int __do_it;
12 int __cancel_type;
14 extern __inline void
15 __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
17 if (__frame->__do_it)
18 __frame->__cancel_routine (__frame->__cancel_arg);
20 static int cl_called;
22 static void
23 cl (void *arg)
25 ++cl_called;
29 void *
30 tf_usleep (void *arg)
33 do { struct __pthread_cleanup_frame __clframe __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) = { .__cancel_routine = (cl), .__cancel_arg = (
34 ((void *)0)), .__do_it = 1 };;
36 foo (arg == ((void *)0) ? (0x7fffffffL * 2UL + 1UL) : 0);
38 __clframe.__do_it = (0); } while (0);
40 exit (1);