Merge pull request #7438 from kalsprite/asm_doc_category

Give asm templates a documentation category instead of a blank header and a null `%s`
This commit is contained in:
gingerBill
2026-08-26 08:41:20 +01:00
committed by GitHub
5 changed files with 35 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style -ignore-unused
..\..\..\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 doc ..\test_issue_asm_doc_category.odin -file 2>&1 | find /c "asm templates" | findstr /x "1" || 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

View File

@@ -114,6 +114,16 @@ 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 doc ../test_issue_asm_doc_category.odin -file 2>&1 | grep -c "asm templates") -eq 1 ]]; 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

View File

@@ -0,0 +1,16 @@
#+build amd64
// `Entity_AsmTemplate` was added to `ENTITY_KINDS` but not to the two `[Entity_Count]` tables in
// `src/docs.cpp`, so its slot was zero-filled: ordering `0` and a null name. `odin doc` and
// `odin check -show-unused` printed an `asm` template under an empty category header, and passed
// the null name to a `%s`.
package test_issues
DOC_CONST :: 1
doc_proc :: proc() {}
doc_asm :: asm() { nop; }
doc_asm_32 :: asm(a: i32) -> (v: i32) { mov v, a; }
doc_asm_64 :: asm(a: i64) -> (v: i64) { mov v, a; }
doc_asm_group :: asm { doc_asm_32, doc_asm_64 }