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