From ac7595fdb1ee2aafecdd99cd8a3e56192639ada6 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Tue, 12 Dec 2023 13:32:43 -0800 Subject: 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 --- tests/codegen/patchable-function-entry.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/codegen/patchable-function-entry.rs (limited to 'tests/codegen/patchable-function-entry.rs') 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" {{.*}} } -- cgit 1.4.1-3-g733a5