summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr44290-2.c
blob: 073351091149a97f448c743cdf08c037f6cfdf65 (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
/* { dg-do compile } */
/* { dg-require-effective-target naked_functions } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

static unsigned long __attribute__((naked))
foo (unsigned long base)
{
  asm volatile ("dummy");
}
unsigned long
bar (void)
{
  static int start, set;

  if (!set)
    {
      set = 1;
      start = foo (0);
    }

  return foo (start);
}

/* { dg-final { scan-tree-dump "foo \\\(long unsigned int base\\\)" "optimized" } } */