aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60449_1.c
blob: ddc25296d8ab7cf8a6c74ba88158d09af7b1e9b3 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
extern int printf (const char *__restrict __format, ...);
typedef long int __time_t;
typedef long int __suseconds_t;
struct timeval
  {
    __time_t tv_sec;
    __suseconds_t tv_usec;
  };
struct timezone
  {
    int tz_minuteswest;
    int tz_dsttime;
  };
typedef struct timezone *__restrict __timezone_ptr_t;
extern int gettimeofday (struct timeval *__restrict __tv,
    __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));

typedef long int __jmp_buf[8];
typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
struct __jmp_buf_tag
  {
    __jmp_buf __jmpbuf;
    int __mask_was_saved;
    __sigset_t __saved_mask;
  };
typedef struct __jmp_buf_tag jmp_buf[1];

extern int setjmp (jmp_buf __env) __attribute__ ((__nothrow__));
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
     __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));

extern int bar (void);

int __attribute__ ((noinline, noclone))
get_input (void)
{
  return 0;
}

static jmp_buf buf;

int foo (void)
{
  if (get_input ())
    longjmp(buf, 1);
  return 0;
}

volatile int z;


int main (void)
{
  struct timeval tv;
  struct timezone tz;

  bar();
  if (setjmp (buf))
    return 1;

  if (!get_input ())
    {
      gettimeofday (&tv, &tz);
      z = 0;
      printf ("This is from main %i\n", tz.tz_dsttime);
    }

  foo ();
  bar ();
  bar ();

  return 0;
}