aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
blob: 5ed356c16452781b751b876f2637da19bfc96d7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target { ! { nvptx*-*-* visium-*-* } } } } */
/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
/* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */
/* { dg-final { scan-assembler-times "nop|NOP|SWYM" 1 { target { ! { alpha*-*-* riscv*-*-* } } } } } */
/* { dg-final { scan-assembler-times "bis" 1 { target alpha*-*-* } } } */
/* { dg-final { scan-assembler-times "nop\n" 1 { target riscv*-*-* } } } */

extern int a;

int f3 (void);

/* F3 should now get 1 NOP.  */
int
__attribute__((noinline))
__attribute__((patchable_function_entry(1)))
f3 (void)
{
  return 5*a;
}