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

static void
cl (void *arg)
{
  ++cl_called;
}


void *
tf_usleep (void *arg)
{

  do { struct __pthread_cleanup_frame __clframe __attribute__ ((__cleanup__ (__pthread_cleanup_routine))) = { .__cancel_routine = (cl), .__cancel_arg = (
																			 ((void *)0)), .__do_it = 1 };;

    foo (arg == ((void *)0) ? (0x7fffffffL * 2UL + 1UL) : 0);

    __clframe.__do_it = (0); } while (0);

  exit (1);
}