aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/preserve-none-7.c
blob: 2c80560887c275bfd8b9b33b0ddfdf8db9b53a12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* { dg-do compile } */
/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */

extern int bar (int) __attribute__ ((no_caller_saved_registers))
#ifndef __x86_64__
__attribute__ ((regparm(3)))
#endif
;

__attribute__ ((preserve_none))
void
foo (void *frame)
{
  int a,b,c,d,e,f,i;
  a = bar (5);
  b = bar (a);
  c = bar (b);
  d = bar (c);
  e = bar (d);
  f = bar (e);
  for (i = 1; i < 10; i++)
  {
    a += bar (a + i) + bar (b + i) +
	 bar (c + i) + bar (d + i) +
	 bar (e + i) + bar (f + i);
  }
}

/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*%(?:e|r)bp" 1 } } */
/* { dg-final { scan-assembler-times "pop(?:l|q)\[\\t \]*%(?:e|r)bp" 1 } } */
/* { dg-final { scan-assembler-times "push(?:l|q)\[\\t \]*" 1 } } */
/* { dg-final { scan-assembler-times "pop(?:l|q)\[\\t \]*" 1 } } */