PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / ret-thunk-26.c
blobdc722c2f5f9927b1c6473bce78046942b256ca2d
1 /* PR target/r84530 */
2 /* { dg-do run } */
3 /* { dg-options "-Os -mfunction-return=thunk -fcf-protection=none" } */
5 struct S { int i; };
6 __attribute__((const, noinline, noclone))
7 struct S foo (int x)
9 struct S s;
10 s.i = x;
11 return s;
14 int a[2048], b[2048], c[2048], d[2048];
15 struct S e[2048];
17 __attribute__((noinline, noclone)) void
18 bar (void)
20 int i;
21 for (i = 0; i < 1024; i++)
23 e[i] = foo (i);
24 a[i+2] = a[i] + a[i+1];
25 b[10] = b[10] + i;
26 c[i] = c[2047 - i];
27 d[i] = d[i + 1];
31 int
32 main ()
34 int i;
35 bar ();
36 for (i = 0; i < 1024; i++)
37 if (e[i].i != i)
38 __builtin_abort ();
39 return 0;