1 /* { dg-do compile } */
2 /* { dg-options "-O0 -fno-pic" } */
3 
4 /* Verify that __attribute__((naked)) produces a naked function
5    that does not use ret to return but traps at the end.  */
6 void
7 __attribute__((naked))
foo(void)8 foo (void)
9 {
10   __asm__ ("# naked");
11 }
12 /* { dg-final { scan-assembler "# naked" } } */
13 /* { dg-final { scan-assembler "(?n)^\\s*ud2$" } } */
14 /* { dg-final { scan-assembler-not "(?n)^\\s*ret$" } } */
15