2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr46226.c
blobe93cbf3dda86446ab74a7c5c4051b3bf19d031d0
1 /* { dg-do run } */
2 /* { dg-options "-Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */
3 /* { dg-additional-options "-mno-accumulate-outgoing-args" { 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;