From 301baf0b88a6cf4baaf2fe33c191f2f468c7f351 Mon Sep 17 00:00:00 2001 From: kalsprite Date: Mon, 24 Aug 2026 17:46:55 -0700 Subject: [PATCH] remove faulty tests --- tests/issues/run.bat | 3 -- tests/issues/run.sh | 25 ---------- .../test_issue_asm_named_register_slot.odin | 41 ---------------- tests/issues/test_issue_asm_rip_register.odin | 15 ------ .../test_issue_asm_template_as_value.odin | 48 ------------------- 5 files changed, 132 deletions(-) delete mode 100644 tests/issues/test_issue_asm_named_register_slot.odin delete mode 100644 tests/issues/test_issue_asm_rip_register.odin delete mode 100644 tests/issues/test_issue_asm_template_as_value.odin diff --git a/tests/issues/run.bat b/tests/issues/run.bat index d31751a87..4cbb424b4 100644 --- a/tests/issues/run.bat +++ b/tests/issues/run.bat @@ -43,12 +43,9 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style -ignore-unused ..\..\..\odin test ..\test_issue_7008.odin %COMMON% || exit /b ..\..\..\odin check ..\test_issue_7012.odin -no-entry-point %COMMON% || exit /b ..\..\..\odin check ..\test_issue_7260.odin -no-entry-point %COMMON% || exit /b -..\..\..\odin check ..\test_issue_asm_named_register_slot.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "8" || exit /b ..\..\..\odin check ..\test_issue_ellipsis_type_call.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "10" || exit /b ..\..\..\odin check ..\test_issue_foreign_redeclaration.odin -no-entry-point %COMMON% || exit /b ..\..\..\odin check ..\test_issue_foreign_redeclaration_mismatch.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "1" || exit /b -..\..\..\odin check ..\test_issue_asm_rip_register.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "6" || exit /b -..\..\..\odin check ..\test_issue_asm_template_as_value.odin -no-entry-point %COMMON% 2>&1 | find /c "Error:" | findstr /x "10" || exit /b ..\..\..\odin build ..\test_issue_7037.odin %COMMON% -o:none || exit /b ..\..\..\odin build ..\test_issue_7188.odin %COMMON% || exit /b clang -c ..\test_issue_sysv_abi.c -o test_issue_sysv_abi_c.o || exit /b diff --git a/tests/issues/run.sh b/tests/issues/run.sh index 8fffdac59..f7fcfe4cc 100755 --- a/tests/issues/run.sh +++ b/tests/issues/run.sh @@ -96,15 +96,6 @@ $ODIN build ../test_issue_7167.odin $COMMON $ODIN build ../test_issue_7188.odin $COMMON $ODIN check ../test_issue_7260.odin -no-entry-point $COMMON_CHECK -# `asm` templates are amd64-only, so this file is empty on every other architecture -if [[ "$(uname -m)" == "x86_64" || "$(uname -m)" == "amd64" ]]; then - if [[ $($ODIN check ../test_issue_asm_named_register_slot.odin -no-entry-point $COMMON_CHECK 2>&1 >/dev/null | grep -c "Error:") -eq 8 ]]; then - echo "SUCCESSFUL 1/1" - else - echo "SUCCESSFUL 0/1" - exit 1 - fi -fi $ODIN check ../test_issue_foreign_redeclaration.odin -no-entry-point $COMMON_CHECK if [[ $($ODIN check ../test_issue_foreign_redeclaration_mismatch.odin -no-entry-point $COMMON_CHECK 2>&1 >/dev/null | grep -c "Error:") -eq 1 ]]; then echo "SUCCESSFUL 1/1" @@ -120,22 +111,6 @@ else exit 1 fi -# `asm` templates are amd64-only, so this file is empty on every other architecture -if [[ "$(uname -m)" == "x86_64" || "$(uname -m)" == "amd64" ]]; then - if [[ $($ODIN check ../test_issue_asm_rip_register.odin -no-entry-point $COMMON_CHECK 2>&1 >/dev/null | grep -c "Error:") -eq 6 ]]; then - echo "SUCCESSFUL 1/1" - else - echo "SUCCESSFUL 0/1" - exit 1 - fi - if [[ $($ODIN check ../test_issue_asm_template_as_value.odin -no-entry-point $COMMON_CHECK 2>&1 >/dev/null | grep -c "Error:") -eq 10 ]]; then - echo "SUCCESSFUL 1/1" - else - echo "SUCCESSFUL 0/1" - exit 1 - fi -fi - if [[ $($ODIN build ../test_issue_7108.odin $COMMON 2>&1 >/dev/null | grep -c "Error:") -eq 2 ]]; then echo "SUCCESSFUL 1/1" else diff --git a/tests/issues/test_issue_asm_named_register_slot.odin b/tests/issues/test_issue_asm_named_register_slot.odin deleted file mode 100644 index 1b6362510..000000000 --- a/tests/issues/test_issue_asm_named_register_slot.odin +++ /dev/null @@ -1,41 +0,0 @@ -#+build amd64 -// A slot that only a named hardware register can fill (segment/control/debug/x87/MMX) -// carries no width and no register class, so it used to absorb any operand at all and -// hand the backend an instruction that does not encode. -package test_issues - -// Rejected: none of these widths pair up, and only `mov`'s segment-register forms ever -// admitted them. -bad_64_32 :: asm(a: i64) -> (r: i32) { mov r, a; } -bad_8_16 :: asm(a: u8) -> (r: u16) { mov r, a; } -bad_16_8 :: asm(a: u16) -> (r: u8) { mov r, a; } -bad_64_8 :: asm(a: u64) -> (r: u8) { mov r, a; } - -// Accepted: equal widths, regardless of signedness or pointer spelling. -ok_32 :: asm(a: i32) -> (r: u32) { mov r, a; } -ok_64 :: asm(a: u64) -> (r: i64) { mov r, a; } -ok_ptr :: asm(a: rawptr) -> (r: ^i32) { mov r, a; } - -// Accepted: the named registers those forms are actually for. -ok_seg :: asm(a: u64) -> (r: u64) { mov %ds, a; mov r, a; } -ok_ctrl :: asm(a: u64) -> (r: u64) { mov %cr0, a; mov r, a; } -ok_dbg :: asm(a: u64) -> (r: u64) { mov %dr0, a; mov r, a; } - -use :: proc() { - a8: u8 - a16: u16 - a32: i32 - a64: i64 - au64: u64 - ap: rawptr - _ = bad_64_32(a64) - _ = bad_8_16(a8) - _ = bad_16_8(a16) - _ = bad_64_8(au64) - _ = ok_32(a32) - _ = ok_64(au64) - _ = ok_ptr(ap) - _ = ok_seg(au64) - _ = ok_ctrl(au64) - _ = ok_dbg(au64) -} diff --git a/tests/issues/test_issue_asm_rip_register.odin b/tests/issues/test_issue_asm_rip_register.odin deleted file mode 100644 index 8b9784790..000000000 --- a/tests/issues/test_issue_asm_rip_register.odin +++ /dev/null @@ -1,15 +0,0 @@ -#+build amd64 -// `%rip` is in the amd64 register table, but its class carries no width, so the checker's width -// switch reached its `GB_PANIC` default arm and aborted with SIGILL instead of diagnosing. Every -// position that can name a register reached it, including `[%rip + disp]`. -package test_issues - -rip_src :: asm() -> (v: u64) { mov v, %rip; } -rip_dst :: asm(x: u64) { mov %rip, x; } -rip_mem :: asm() { mov %rax, [%rip + 8]; } -rip_clob :: asm() [#clobber %rip] { nop; } -rip_in :: asm(x: u64) [x = %rip] { nop; } -rip_out :: asm() -> (r: u64) [r = %rip] { nop; } - -// the nearest special-purpose register that does carry a class has to keep checking cleanly -rsp_ok :: asm() -> (v: u64) { mov v, %rsp; } diff --git a/tests/issues/test_issue_asm_template_as_value.odin b/tests/issues/test_issue_asm_template_as_value.odin deleted file mode 100644 index 2062fa3c7..000000000 --- a/tests/issues/test_issue_asm_template_as_value.odin +++ /dev/null @@ -1,48 +0,0 @@ -#+build amd64 -// A named asm template got a plain `Addressing_Value`, so every value gate let it through: -// a cast, a transmute, an `auto_cast`, a blank assignment, a polymorphic parameter and a -// comparison against `nil` all passed the checker and then aborted the compiler in the -// backend, which has no value to lower for a template. Only a direct call and a listing in -// an `asm` group are legal. -package test_issues - -t :: asm(a: i32) -> (v: i32) { mov v, a; } - -a32 :: asm(a: i32) -> (v: i32) { mov v, a; } -a64 :: asm(a: i64) -> (v: i64) { mov v, a; } -g :: asm { a32, a64 } - -G := cast(rawptr)(t) - -take_rawptr :: proc(p: rawptr) { - _ = p -} - -poly :: proc(x: $T) { - _ = size_of(T) -} - -bad :: proc() { - _ = cast(proc "c" (i32) -> i32)(t) - _ = transmute(proc "c" (i32) -> i32)(t) - _ = cast(rawptr)(t) - _ = transmute(uintptr)(t) - take_rawptr(auto_cast t) - take_rawptr(cast(rawptr)(t)) - _ = t - poly(t) - if t == nil { - take_rawptr(nil) - } -} - -// these forms must remain valid -good :: proc() -> i32 { - x := t(1) - y := (t)(2) - z := g(i32(3)) - w := g(i64(4)) - v := asm(a: i32) -> (v: i32) { mov v, a; }(5) - take_rawptr(G) - return x + y + z + i32(w) + v -}