summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/patchable_function_entry-definition.c')
-rw-r--r--gcc/testsuite/c-c++-common/patchable_function_entry-definition.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
new file mode 100644
index 00000000000..a007867dcb0
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/patchable_function_entry-definition.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
+/* { dg-final { scan-assembler-times "nop" 1 } } */
+
+extern int a;
+
+int f3 (void);
+
+/* F3 should now get 1 NOP. */
+int
+__attribute__((noinline))
+__attribute__((patchable_function_entry(1)))
+f3 (void)
+{
+ return 5*a;
+}