Skip to content

Commit 9d63441

Browse files
committed
Fix LVI tests after making frame pointers easily enableable
1 parent d3d145e commit 9d63441

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
CHECK: cmake_plus_one_cxx_global_asm
2-
CHECK: lfence
2+
CHECK-NEXT: movl
3+
CHECK-NEXT: lfence
4+
CHECK-NEXT: incl
5+
CHECK-NEXT: shlq $0x0, (%rsp)
6+
CHECK-NEXT: lfence
7+
CHECK-NEXT: retq
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHECK: print
2+
CHECK: lfence
3+
CHECK: popq
4+
CHECK: popq
5+
CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
6+
CHECK-NEXT: lfence
7+
CHECK-NEXT: jmpq *[[REGISTER]]

tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ function check {
3434
${enclave} > ${asm}
3535
${filecheck} --input-file ${asm} ${checks}
3636

37-
if [ "${func_re}" != "rust_plus_one_global_asm" &&
38-
"${func_re}" != "cmake_plus_one_c_global_asm" ]; then
37+
if [ "${func_re}" != "rust_plus_one_global_asm" ] &&
38+
[ "${func_re}" != "cmake_plus_one_c_global_asm" &&
39+
[ "${func_re}" != "cmake_plus_one_cxx_global_asm" ]; then
3940
# The assembler cannot avoid explicit `ret` instructions. Sequences
4041
# of `shlq $0x0, (%rsp); lfence; retq` are used instead.
4142
# https://www.intel.com/content/www/us/en/developer/articles/technical/
@@ -48,7 +49,8 @@ build
4849

4950
check "unw_getcontext" unw_getcontext.checks
5051
check "__libunwind_Registers_x86_64_jumpto" jumpto.checks
51-
check 'std::io::stdio::_print::[[:alnum:]]+' print.checks
52+
check 'std::io::stdio::_print::[[:alnum:]]+' print.with_frame_pointes.checks ||
53+
check 'std::io::stdio::_print::[[:alnum:]]+' print.without_frame_pointes.checks
5254
check rust_plus_one_global_asm rust_plus_one_global_asm.checks
5355

5456
check cc_plus_one_c cc_plus_one_c.checks

0 commit comments

Comments
 (0)