2020-03-19 15:47:22 +01:00
|
|
|
// Test LVI ret hardening on generic rust code
|
|
|
|
|
|
2025-07-24 14:06:58 +02:00
|
|
|
//@ add-core-stubs
|
2020-03-19 15:47:22 +01:00
|
|
|
//@ assembly-output: emit-asm
|
2025-07-24 14:06:58 +02:00
|
|
|
//@ compile-flags: --target x86_64-fortanix-unknown-sgx
|
|
|
|
|
//@ needs-llvm-components: x86
|
|
|
|
|
|
|
|
|
|
#![feature(no_core, lang_items, f16)]
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
|
|
extern crate minicore;
|
|
|
|
|
use minicore::*;
|
2020-03-19 15:47:22 +01:00
|
|
|
|
|
|
|
|
#[no_mangle]
|
2024-05-29 13:57:23 +10:00
|
|
|
pub extern "C" fn myret() {}
|
2025-07-24 14:06:58 +02:00
|
|
|
// CHECK-LABEL: myret:
|
2020-03-19 15:47:22 +01:00
|
|
|
// CHECK: popq [[REGISTER:%[a-z]+]]
|
|
|
|
|
// CHECK-NEXT: lfence
|
|
|
|
|
// CHECK-NEXT: jmpq *[[REGISTER]]
|