OSDN Git Service

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