view gcc/testsuite/gcc.target/s390/stack-clash-1.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

/* Make sure a stack probe is emitted also for the remaining bytes
   after the loop probing the large chunk.  */

/* { dg-do compile } */
/* { dg-options "-O2 -march=z9-ec -fstack-clash-protection" } */

void large_stack() {
  volatile int stack[8000];
  int i;
  for (i = 0; i < sizeof(stack) / sizeof(int); ++i)
    stack[i] = i;
}

/* We use a compare for the stack probe.  There needs to be one inside
   a loop and another for the remaining bytes.  */
/* { dg-final { scan-assembler-times "cg\t" 2 { target lp64 } } } */
/* { dg-final { scan-assembler-times "c\t" 2 { target { ! lp64 } } } } */