1 /* { dg-do compile } */
2 /* { dg-require-effective-target naked_functions } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 
5 static unsigned long __attribute__((naked))
foo(unsigned long base)6 foo (unsigned long base)
7 {
8   asm volatile ("dummy");
9 }
10 unsigned long
bar(void)11 bar (void)
12 {
13   static int start, set;
14 
15   if (!set)
16     {
17       set = 1;
18       start = foo (0);
19     }
20 
21   return foo (start);
22 }
23 
24 /* { dg-final { scan-tree-dump "foo \\\(long unsigned int base\\\)" "optimized" } } */
25