summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr45843.C
blob: f77b8cb0135d7a0fe689e5850e86edc9f598ee3a (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
// PR target/45843
// { dg-do run }

#include <stdarg.h>

extern "C" void abort ();
struct S { struct T { } a[14]; char b; };
struct S arg, s;

void
foo (int z, ...)
{
  char c;
  va_list ap;
  va_start (ap, z);
  c = 'a';
  arg = va_arg (ap, struct S);
  if (c != 'a')
    abort ();
  va_end (ap);
}

int
main ()
{
  foo (1, s);
  return 0;
}