Use capstone to validate precise-output tests (#5780)

Use the capstone library to disassemble precise-output tests, in addition to pretty-printing their vcode.
This commit is contained in:
Trevor Elliott
2023-02-15 16:35:10 -08:00
committed by GitHub
parent eabd43a178
commit f04decc4a1
277 changed files with 39340 additions and 98 deletions

View File

@@ -1,6 +1,7 @@
test compile precise-output
set opt_level=speed
set use_egraphs=true
set machine_code_cfg_info=true
target x86_64
;; We want to make sure that this compiles successfully, so we are properly
@@ -15,6 +16,7 @@ function u0:359(i64) -> i8, i8 system_v {
return v3, v4
}
; VCode:
; pushq %rbp
; movq %rsp, %rbp
; block0:
@@ -22,4 +24,13 @@ function u0:359(i64) -> i8, i8 system_v {
; movq %rbp, %rsp
; popq %rbp
; ret
;
; Disassembled:
; pushq %rbp
; movq %rsp, %rbp
; block0: ; offset 0x4
; callq 9 ; reloc_external CallPCRel4 u0:521 -4
; movq %rbp, %rsp
; popq %rbp
; retq

View File

@@ -13,6 +13,7 @@ function u0:1302(i64) -> i64 system_v {
return v0
}
; VCode:
; pushq %rbp
; movq %rsp, %rbp
; block0:
@@ -21,4 +22,18 @@ function u0:1302(i64) -> i64 system_v {
; movq %rbp, %rsp
; popq %rbp
; ret
;
; Disassembled:
; pushq %rbp
; movq %rsp, %rbp
; block0: ; offset 0x4
; movq (%rdi), %rax ; trap: heap_oob
; movq %rax, %rcx
; addq %rdi, %rcx
; lock cmpxchgq %rcx, (%rdi) ; trap: heap_oob
; jne 7
; movq %rdi, %rax
; movq %rbp, %rsp
; popq %rbp
; retq