forked from rust-lang/rust
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a13239d
commit cd31f40
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-generic-load.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]] | ||
|