rust/tests/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
381 B
Rust
Raw Normal View History

2020-03-19 14:47:50 +00:00
// Test LVI load hardening on SGX enclave code
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type staticlib
//@ only-x86_64-fortanix-unknown-sgx
#[no_mangle]
2024-05-29 03:57:23 +00:00
pub extern "C" fn plus_one(r: &mut u64) {
2020-03-19 14:47:50 +00:00
*r = *r + 1;
}
// CHECK: plus_one
// CHECK: lfence
2023-02-21 15:30:30 +00:00
// CHECK-NEXT: incq
2020-03-19 14:47:50 +00:00
// CHECK: popq [[REGISTER:%[a-z]+]]
// CHECK-NEXT: lfence
// CHECK-NEXT: jmpq *[[REGISTER]]