Skip to content

Commit 947d723

Browse files
committed
Adding checks for assembly files in libunwind
1 parent 4d1d0c6 commit 947d723

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-include ../../run-make-fulldeps/tools.mk
2+
3+
#only-x86_64-fortanix-unknown-sgx
4+
5+
OBJDUMP="${S}/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
6+
FILECHECK="${S}/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
7+
8+
all:
9+
$(RUSTC) --target ${TARGET} enclave.rs
10+
11+
#TODO: re-enable check when newly compiled libunwind is used
12+
#${OBJDUMP} --disassemble-symbols=unw_getcontext --demangle $(TMPDIR)/enclave > $(TMPDIR)/unw_getcontext.asm
13+
#${FILECHECK} --input-file $(TMPDIR)/unw_getcontext.asm unw_getcontext.checks
14+
15+
#TODO: re-enable check when newly compiled libunwind is used
16+
${OBJDUMP} --disassemble-symbols="libunwind::Registers_x86_64::jumpto()" --demangle $(TMPDIR)/enclave > $(TMPDIR)/jumpto.asm
17+
${FILECHECK} --input-file $(TMPDIR)/jumpto.asm jumpto.checks
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
pub fn main() {
3+
println!("Hello, World!");
4+
}
5+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CHECK: libunwind::Registers_x86_64::jumpto
2+
CHECK: lfence
3+
CHECK: lfence
4+
CHECK: lfence
5+
CHECK: lfence
6+
CHECK: shlq $0, (%rsp)
7+
CHECK-NEXT: lfence
8+
CHECK-NEXT: retq
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHECK: unw_getcontext
2+
CHECK: lfence
3+
CHECK: lfence
4+
CHECK: notq (%rsp)
5+
CHECK-NEXT: notq (%rsp)
6+
CHECK-NEXT: lfence
7+
CHECK-NEXT: retq

0 commit comments

Comments
 (0)