aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/notoc-direct-1.c
blob: 8fa09b03f4f10ee4b2e0b7c05e37e03d8923368f (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
33
34
35
36
37
38
39
40
41
/* { dg-do compile } */
/* { dg-options "-mdejagnu-cpu=power10 -O2" } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target power10_ok } */

/* Test that calls generated from PC-relative code are annotated with
   @notoc.  */

extern int yy0 (int);
extern void yy1 (int);

int zz0 (void) __attribute__((noinline));
void zz1 (int) __attribute__((noinline));

int xx (void)
{
  yy1 (7);
  return yy0 (5);
}

int zz0 ()
{
  asm ("");
  return 16;
};

void zz1 (int a __attribute__((__unused__)))
{
  asm ("");
};

int ww (void)
{
  zz1 (zz0 ());
  return 4;
}

/* { dg-final { scan-assembler {yy1@notoc} } } */
/* { dg-final { scan-assembler {yy0@notoc} } } */
/* { dg-final { scan-assembler {zz1@notoc} } } */
/* { dg-final { scan-assembler {zz0@notoc} } } */