summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr37337.C
blob: 5b8521df8db9b4e225ac74f33fda9c73f9db6f4e (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
// PR middle-end/37337
// { dg-do compile }
// { dg-options "-O2" }

extern "C"
{
  typedef struct _IO_FILE FILE;
  extern int __fprintf_chk (FILE *, int, const char *, ...);
  extern inline __attribute__ ((always_inline, gnu_inline, artificial))
  int fprintf (FILE *s, const char *f, ...)
  {
    return __fprintf_chk (s, 1, f, __builtin_va_arg_pack ());
  }
}

extern int a;
struct A
{
  virtual ~A (void)
  {
  }
};

struct B : public A
{
  B ();
  FILE *b;
};

void f (int *);
B::B ()
{
  f (&a);
  for (int i = 0; i < 6; i++)
    fprintf (b, "%02x", 0xff);
  fprintf (b, "\n--\n");
}