about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorMatthew Maurer <matthew.r.maurer@gmail.com>2023-12-12 13:32:43 -0800
committerFlorian Schmiderer <florian.schmiderer@posteo.net>2024-06-25 18:21:42 +0200
commitac7595fdb1ee2aafecdd99cd8a3e56192639ada6 (patch)
tree4be37518dc4e5f5366b2920c90573749a75d3b0e /tests/codegen
parentd929a42a664c026167800801b26d734db925314f (diff)
downloadrust-ac7595fdb1ee2aafecdd99cd8a3e56192639ada6.tar.gz
rust-ac7595fdb1ee2aafecdd99cd8a3e56192639ada6.zip
Support for -Z patchable-function-entry
`-Z patchable-function-entry` works like `-fpatchable-function-entry`
on clang/gcc. The arguments are total nop count and function offset.

See MCP rust-lang/compiler-team#704
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/patchable-function-entry.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/codegen/patchable-function-entry.rs b/tests/codegen/patchable-function-entry.rs
new file mode 100644
index 00000000000..f06739303d2
--- /dev/null
+++ b/tests/codegen/patchable-function-entry.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Z patchable-function-entry=15,10
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn foo() {}
+// CHECK: @foo() unnamed_addr #0
+// CHECK: attributes #0 = { {{.*}}"patchable-function-entry"="5"{{.*}}"patchable-function-prefix"="10" {{.*}} }