From 76be83b67e3c69d3bae720cd06ba3f66e1911674 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Mar 2024 16:00:40 +0300 Subject: [PATCH] Fix Windows tests --- tests/debug.Windows-x86_64/call2.irt | 10 +++----- tests/debug.Windows-x86_64/call3.irt | 8 +++--- tests/debug.Windows-x86_64/dessa_002.irt | 14 +++++++++++ tests/debug.Windows-x86_64/dessa_003.irt | 1 + tests/debug.Windows-x86_64/fig.irt | 29 ++++++++++++++-------- tests/debug.Windows-x86_64/loop_002.irt | 10 ++++++++ tests/debug.Windows-x86_64/regset-fib.irt | 8 ++++++ tests/debug.Windows-x86_64/regset-fib2.irt | 8 ++++++ tests/debug.Windows-x86_64/regset-fibi.irt | 15 +++++------ tests/debug.Windows-x86_64/regset-test.irt | 3 ++- tests/debug.Windows-x86_64/sccp_002.irt | 4 +++ tests/debug.Windows-x86_64/test-mavx.irt | 5 ++-- tests/debug.Windows-x86_64/test.irt | 4 +++ tests/debug.Windows-x86_64/test64.irt | 12 +++++++++ 14 files changed, 101 insertions(+), 30 deletions(-) diff --git a/tests/debug.Windows-x86_64/call2.irt b/tests/debug.Windows-x86_64/call2.irt index 17d0ca2a..81b92cb0 100755 --- a/tests/debug.Windows-x86_64/call2.irt +++ b/tests/debug.Windows-x86_64/call2.irt @@ -23,8 +23,8 @@ Windows-x86_64 } --EXPECT-- test: - subq $0x28, %rsp - movq %rbx, 0x20(%rsp) + pushq %rbx + subq $0x20, %rsp movl %ecx, %ebx movl %edx, %eax movl %r8d, %edx @@ -33,12 +33,10 @@ test: leaq .L1(%rip), %rcx callq printf addl %ebx, %eax - movq 0x20(%rsp), %rbx - addq $0x28, %rsp + addq $0x20, %rsp + popq %rbx retq .rodata .db 0x90, 0x90 .L1: .db 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x25, 0x64, 0x21, 0x0a, 0x00 - - diff --git a/tests/debug.Windows-x86_64/call3.irt b/tests/debug.Windows-x86_64/call3.irt index a1bb7747..20dbf92d 100755 --- a/tests/debug.Windows-x86_64/call3.irt +++ b/tests/debug.Windows-x86_64/call3.irt @@ -20,8 +20,8 @@ Windows-x86_64 } --EXPECT-- test: - subq $0x28, %rsp - movq %rbx, 0x20(%rsp) + pushq %rbx + subq $0x20, %rsp movl %ecx, %ebx movq 0x30(%rsp), %rax movl %edx, %r10d @@ -31,8 +31,8 @@ test: leaq .L1(%rip), %rcx callq *(%rax) addl %ebx, %eax - movq 0x20(%rsp), %rbx - addq $0x28, %rsp + addq $0x20, %rsp + popq %rbx retq .rodata .db 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 diff --git a/tests/debug.Windows-x86_64/dessa_002.irt b/tests/debug.Windows-x86_64/dessa_002.irt index bcf23c78..f109356d 100755 --- a/tests/debug.Windows-x86_64/dessa_002.irt +++ b/tests/debug.Windows-x86_64/dessa_002.irt @@ -25,6 +25,20 @@ Windows-x86_64 --EXPECT-- test: jmp .L2 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop .L1: movl %eax, %ecx .L2: diff --git a/tests/debug.Windows-x86_64/dessa_003.irt b/tests/debug.Windows-x86_64/dessa_003.irt index 20b2648a..a2ed8dd0 100755 --- a/tests/debug.Windows-x86_64/dessa_003.irt +++ b/tests/debug.Windows-x86_64/dessa_003.irt @@ -38,6 +38,7 @@ test: cltd idivl %ecx jmp .L2 + nop .L1: xchgl %eax, %r9d .L2: diff --git a/tests/debug.Windows-x86_64/fig.irt b/tests/debug.Windows-x86_64/fig.irt index ca4d5dc2..d2b273bc 100755 --- a/tests/debug.Windows-x86_64/fig.irt +++ b/tests/debug.Windows-x86_64/fig.irt @@ -66,11 +66,10 @@ Windows-x86_64 } --EXPECT-- test: - subq $0x20, %rsp - movq %rbx, 0x18(%rsp) - movq %rbp, 0x10(%rsp) - movq %rsi, 8(%rsp) - movq %rdi, (%rsp) + pushq %rbx + pushq %rbp + pushq %rsi + pushq %rdi movl 0x30(%rsp), %eax movl 0x38(%rsp), %r10d movl 0x40(%rsp), %r11d @@ -80,6 +79,17 @@ test: imull %edx, %esi leal 4(%rsi), %edi jmp .L3 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop .L1: movl %ecx, %r10d imull %edx, %r10d @@ -105,9 +115,8 @@ test: addl %r10d, %eax addl %r11d, %eax leal 1(%rax, %rbx), %eax - movq 0x18(%rsp), %rbx - movq 0x10(%rsp), %rbp - movq 8(%rsp), %rsi - movq (%rsp), %rdi - addq $0x20, %rsp + popq %rdi + popq %rsi + popq %rbp + popq %rbx retq diff --git a/tests/debug.Windows-x86_64/loop_002.irt b/tests/debug.Windows-x86_64/loop_002.irt index 8944dc48..234853b8 100755 --- a/tests/debug.Windows-x86_64/loop_002.irt +++ b/tests/debug.Windows-x86_64/loop_002.irt @@ -49,6 +49,16 @@ test: xorl %ecx, %ecx xorl %eax, %eax jmp .L4 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop .L1: cmpl %ecx, %edx je .L2 diff --git a/tests/debug.Windows-x86_64/regset-fib.irt b/tests/debug.Windows-x86_64/regset-fib.irt index b0ecf5e6..c13838a0 100755 --- a/tests/debug.Windows-x86_64/regset-fib.irt +++ b/tests/debug.Windows-x86_64/regset-fib.irt @@ -79,6 +79,14 @@ main: movsd %xmm0, 0x20(%rsp) xorpd %xmm0, %xmm0 jmp .L2 + nop + nop + nop + nop + nop + nop + nop + nop .L1: addsd %xmm0, %xmm1 movsd %xmm1, 0x20(%rsp) diff --git a/tests/debug.Windows-x86_64/regset-fib2.irt b/tests/debug.Windows-x86_64/regset-fib2.irt index b60b51c2..1e87df84 100755 --- a/tests/debug.Windows-x86_64/regset-fib2.irt +++ b/tests/debug.Windows-x86_64/regset-fib2.irt @@ -79,6 +79,14 @@ main: movsd %xmm0, 0x20(%rsp) xorpd %xmm0, %xmm0 jmp .L2 + nop + nop + nop + nop + nop + nop + nop + nop .L1: addsd %xmm0, %xmm1 movsd %xmm1, 0x20(%rsp) diff --git a/tests/debug.Windows-x86_64/regset-fibi.irt b/tests/debug.Windows-x86_64/regset-fibi.irt index 4cf6ced0..36ecf263 100755 --- a/tests/debug.Windows-x86_64/regset-fibi.irt +++ b/tests/debug.Windows-x86_64/regset-fibi.irt @@ -65,12 +65,13 @@ R3 (d_9) [%ebp]: [9.2-13.0), DEF(9.2)!, PHI_USE(12.2, phi=d_5/3) [%SCRATCH] : [10.1-10.2) } main: - subq $0x38, %rsp - movq %rbx, 0x30(%rsp) - movq %rbp, 0x28(%rsp) + pushq %rbx + pushq %rbp + subq $0x28, %rsp movl $1, %ebx xorl %eax, %eax jmp .L2 + nop .L1: leal (%rbx, %rax), %ebp movl %ebx, %edx @@ -82,12 +83,12 @@ main: cmpl $0x2710, %ebx jl .L1 xorl %eax, %eax - movq 0x30(%rsp), %rbx - movq 0x28(%rsp), %rbp - addq $0x38, %rsp + addq $0x28, %rsp + popq %rbp + popq %rbx retq .rodata - .db 0x90, 0x90, 0x90 + .db 0x90, 0x90 .L3: .db 0x25, 0x64, 0x0a, 0x00 diff --git a/tests/debug.Windows-x86_64/regset-test.irt b/tests/debug.Windows-x86_64/regset-test.irt index b2475fa8..06e47508 100755 --- a/tests/debug.Windows-x86_64/regset-test.irt +++ b/tests/debug.Windows-x86_64/regset-test.irt @@ -148,6 +148,7 @@ test: movsd %xmm0, 0x18(%rsp) xorl %eax, %eax jmp .L2 + nop .L1: movsd 0x10(%rsp), %xmm0 mulsd 0x18(%rsp), %xmm0 @@ -176,7 +177,7 @@ test: addq $0x28, %rsp retq .rodata - .db 0x90, 0x90, 0x90, 0x90, 0x90 + .db 0x90, 0x90, 0x90, 0x90 .L4: .db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f .L5: diff --git a/tests/debug.Windows-x86_64/sccp_002.irt b/tests/debug.Windows-x86_64/sccp_002.irt index 8e5e7705..2c760064 100755 --- a/tests/debug.Windows-x86_64/sccp_002.irt +++ b/tests/debug.Windows-x86_64/sccp_002.irt @@ -68,6 +68,10 @@ test: movl $3, %eax .L4: retq + nop + nop + nop + nop .L5: testb %dl, %dl jne .L5 diff --git a/tests/debug.Windows-x86_64/test-mavx.irt b/tests/debug.Windows-x86_64/test-mavx.irt index 166da34f..ce30714b 100755 --- a/tests/debug.Windows-x86_64/test-mavx.irt +++ b/tests/debug.Windows-x86_64/test-mavx.irt @@ -62,6 +62,8 @@ test: xorl %eax, %eax vxorpd %xmm2, %xmm2, %xmm2 jmp .L2 + nop + nop .L1: vmulsd %xmm3, %xmm2, %xmm3 vsubsd %xmm5, %xmm4, %xmm2 @@ -86,9 +88,8 @@ test: addq $8, %rsp retq .rodata - .db 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 + .db 0x90, 0x90, 0x90, 0x90, 0x90 .L4: .db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f .L5: .db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40 - diff --git a/tests/debug.Windows-x86_64/test.irt b/tests/debug.Windows-x86_64/test.irt index 163faa66..d81616c2 100755 --- a/tests/debug.Windows-x86_64/test.irt +++ b/tests/debug.Windows-x86_64/test.irt @@ -62,6 +62,9 @@ test: xorl %eax, %eax xorpd %xmm2, %xmm2 jmp .L2 + nop + nop + nop .L1: mulsd %xmm2, %xmm3 subsd %xmm5, %xmm4 @@ -90,6 +93,7 @@ test: addq $8, %rsp retq .rodata + .db 0x90, 0x90, 0x90, 0x90, 0x90 .L4: .db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f .L5: diff --git a/tests/debug.Windows-x86_64/test64.irt b/tests/debug.Windows-x86_64/test64.irt index ecd89e33..8cdaa135 100755 --- a/tests/debug.Windows-x86_64/test64.irt +++ b/tests/debug.Windows-x86_64/test64.irt @@ -62,6 +62,17 @@ test: movabsq $0x200000000, %rax xorpd %xmm2, %xmm2 jmp .L2 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop .L1: mulsd %xmm2, %xmm3 subsd %xmm5, %xmm4 @@ -91,6 +102,7 @@ test: addq $8, %rsp retq .rodata + .db 0x90, 0x90, 0x90, 0x90, 0x90 .L4: .db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f .L5: