Files
rust/tests/codegen/sanitizer/kcfi/add-kcfi-offset-flag.rs
David Wood 92eb4450fa tests: use minicore more
minicore makes it much easier to add new language items to all of the
existing `no_core` tests.
2025-02-24 09:26:54 +00:00

21 lines
613 B
Rust

// Verifies that "kcfi-offset" module flag is added.
//
//@ add-core-stubs
//@ revisions: aarch64 x86_64
//@ [aarch64] compile-flags: --target aarch64-unknown-none
//@ [aarch64] needs-llvm-components: aarch64
//@ [x86_64] compile-flags: --target x86_64-unknown-none
//@ [x86_64] needs-llvm-components: x86
//@ compile-flags: -Ctarget-feature=-crt-static -Zsanitizer=kcfi -Z patchable-function-entry=4,3
#![feature(no_core, lang_items, patchable_function_entry)]
#![crate_type = "lib"]
#![no_core]
extern crate minicore;
use minicore::*;
pub fn foo() {}
// CHECK: !{{[0-9]+}} = !{i32 4, !"kcfi-offset", i32 3}