Adding checks for assembly files in libunwind

This commit is contained in:
Raoul Strackx 2020-03-25 15:28:34 +01:00
parent 4d1d0c6bd7
commit 947d7238e0
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,17 @@
-include ../../run-make-fulldeps/tools.mk
#only-x86_64-fortanix-unknown-sgx
OBJDUMP="${S}/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
FILECHECK="${S}/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
all:
$(RUSTC) --target ${TARGET} enclave.rs
#TODO: re-enable check when newly compiled libunwind is used
#${OBJDUMP} --disassemble-symbols=unw_getcontext --demangle $(TMPDIR)/enclave > $(TMPDIR)/unw_getcontext.asm
#${FILECHECK} --input-file $(TMPDIR)/unw_getcontext.asm unw_getcontext.checks
#TODO: re-enable check when newly compiled libunwind is used
${OBJDUMP} --disassemble-symbols="libunwind::Registers_x86_64::jumpto()" --demangle $(TMPDIR)/enclave > $(TMPDIR)/jumpto.asm
${FILECHECK} --input-file $(TMPDIR)/jumpto.asm jumpto.checks

View File

@ -0,0 +1,5 @@
pub fn main() {
println!("Hello, World!");
}

View File

@ -0,0 +1,8 @@
CHECK: libunwind::Registers_x86_64::jumpto
CHECK: lfence
CHECK: lfence
CHECK: lfence
CHECK: lfence
CHECK: shlq $0, (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq

View File

@ -0,0 +1,7 @@
CHECK: unw_getcontext
CHECK: lfence
CHECK: lfence
CHECK: notq (%rsp)
CHECK-NEXT: notq (%rsp)
CHECK-NEXT: lfence
CHECK-NEXT: retq