1/* { dg-do run } */
2/* { dg-options "-Os -fomit-frame-pointer -mno-accumulate-outgoing-args -fno-asynchronous-unwind-tables" } */
3/* { dg-options "-Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" { target *-*-mingw* *-*-cygwin* } } */
4
5extern void abort(void);
6
7static void *p[2];
8
9void __attribute__((noinline))
10g(int x, ...)
11{
12  asm volatile ("" : : "g"(x));
13}
14
15void __attribute__((noinline))
16f(int x)
17{
18  p[0] = __builtin_return_address (0);
19  if (x == 0)
20    g(0);
21  g(1, 2, 3, 4, 5, 6, 7);
22
23  asm goto ("jmp %l0" : : : : label);
24  abort ();
25
26 label:
27  p[1] = __builtin_return_address (0);
28}
29
30int main()
31{
32  f(1);
33  if (p[0] != p[1])
34    abort ();
35  return 0;
36}
37