Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr46226.c
blob168d80e2be40b1447a4053cbd5a1c4ab7ecfb2a5
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* } } */
5 extern void abort(void);
7 static void *p[2];
9 void __attribute__((noinline))
10 g(int x, ...)
12 asm volatile ("" : : "g"(x));
15 void __attribute__((noinline))
16 f(int x)
18 p[0] = __builtin_return_address (0);
19 if (x == 0)
20 g(0);
21 g(1, 2, 3, 4, 5, 6, 7);
23 asm goto ("jmp %l0" : : : : label);
24 abort ();
26 label:
27 p[1] = __builtin_return_address (0);
30 int main()
32 f(1);
33 if (p[0] != p[1])
34 abort ();
35 return 0;