diff options
| author | Raoul Strackx <raoul.strackx@fortanix.com> | 2020-03-25 15:28:34 +0100 |
|---|---|---|
| committer | Raoul Strackx <raoul.strackx@fortanix.com> | 2020-09-25 15:02:14 +0200 |
| commit | 947d7238e0db03146d33d6b3354231d7e3384735 (patch) | |
| tree | b557c6f1597f3ea58507b055423c55b7ff17c8b4 | |
| parent | 4d1d0c6bd7e9b5dda47691729fe15a49091d2e4d (diff) | |
| download | rust-947d7238e0db03146d33d6b3354231d7e3384735.tar.gz rust-947d7238e0db03146d33d6b3354231d7e3384735.zip | |
Adding checks for assembly files in libunwind
4 files changed, 37 insertions, 0 deletions
diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile new file mode 100644 index 00000000000..b17f9a12a29 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile @@ -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 diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave.rs b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave.rs new file mode 100644 index 00000000000..66c8ead3e0f --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/enclave.rs @@ -0,0 +1,5 @@ + +pub fn main() { + println!("Hello, World!"); +} + diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks new file mode 100644 index 00000000000..15211e3ade7 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/jumpto.checks @@ -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 diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks new file mode 100644 index 00000000000..50b828662e3 --- /dev/null +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks @@ -0,0 +1,7 @@ +CHECK: unw_getcontext +CHECK: lfence +CHECK: lfence +CHECK: notq (%rsp) +CHECK-NEXT: notq (%rsp) +CHECK-NEXT: lfence +CHECK-NEXT: retq |
