mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 03:14:11 +00:00
generic load hardening test
This commit is contained in:
parent
a13239dac2
commit
cd31f40b6f
@ -0,0 +1,18 @@
|
||||
// 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]
|
||||
pub extern fn plus_one(r: &mut u64) {
|
||||
*r = *r + 1;
|
||||
}
|
||||
|
||||
// CHECK: plus_one
|
||||
// CHECK: lfence
|
||||
// CHECK-NEXT: addq
|
||||
// CHECK: popq [[REGISTER:%[a-z]+]]
|
||||
// CHECK-NEXT: lfence
|
||||
// CHECK-NEXT: jmpq *[[REGISTER]]
|
||||
|
Loading…
Reference in New Issue
Block a user