aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/naked-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/naked-4.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/naked-4.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/naked-4.c b/gcc/testsuite/gcc.target/i386/naked-4.c
new file mode 100644
index 00000000000..07b32424f5f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/naked-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+/* { dg-additional-options "-mregparm=3" { target ia32 } } */
+
+/* Verify that __attribute__((naked)) produces a naked function
+ that does not allocate stack slots for args. */
+extern void bar (int);
+
+int
+__attribute__((naked))
+foo (int a, int b, int c)
+{
+ bar (c);
+ asm volatile ("ret" :: "a" (b));
+}
+
+/* { dg-final { scan-assembler-not "%\[re\]bp" } } */