10 cp -a $TEST_DIR/enclave .
13 # HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features.
14 # These come from the top-level Rust workspace, that this crate is not a
15 # member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
17 cargo -v run --target $TARGET
24 local checks="${TEST_DIR}/$2"
26 local objdump="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
27 local filecheck="${BUILD_DIR}/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
29 ${objdump} --disassemble-symbols=${func} --demangle \
30 ${WORK_DIR}/enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave > ${asm}
31 ${filecheck} --input-file ${asm} ${checks}
36 check unw_getcontext unw_getcontext.checks
37 check "libunwind::Registers_x86_64::jumpto()" jumpto.checks
38 check "std::io::stdio::_print::h87f0c238421c45bc" print.checks
39 check rust_plus_one_global_asm rust_plus_one_global_asm.checks \
40 || echo "warning: module level assembly currently not hardened"
42 check cc_plus_one_c cc_plus_one_c.checks
43 check cc_plus_one_c_asm cc_plus_one_c_asm.checks
44 check cc_plus_one_cxx cc_plus_one_cxx.checks
45 check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks
46 check cc_plus_one_asm cc_plus_one_asm.checks \
47 || echo "warning: the cc crate forwards assembly files to the CC compiler." \
48 "Clang uses its own integrated assembler, which does not include the LVI passes."
50 check cmake_plus_one_c cmake_plus_one_c.checks
51 check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks
52 check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks \
53 || echo "warning: module level assembly currently not hardened"
54 check cmake_plus_one_cxx cmake_plus_one_cxx.checks
55 check cmake_plus_one_cxx_asm cmake_plus_one_cxx_asm.checks
56 check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks \
57 || echo "warning: module level assembly currently not hardened"
58 check cmake_plus_one_asm cmake_plus_one_asm.checks