Allow accessing parameters in a naked function, just disallow return, this fixes #1955.

This commit is contained in:
Christoffer Lerno
2025-07-29 20:38:46 +02:00
parent 51b9cb85bc
commit 3ac9bfc387
6 changed files with 47 additions and 14 deletions

View File

@@ -3,14 +3,15 @@ module test;
alias IntFn = fn int();
IntFn lambda @export = fn () => 1;
IntFn lambda_naked @export = fn () @naked => 2;
IntFn lambda_naked @export = fn () @naked { asm("ret"); };
/* #expect: test.ll
; Function Attrs: naked nounwind uwtable
define internal i32 @"test.$global$lambda2"() #0 {
entry:
ret i32 2
call void asm sideeffect alignstack "ret", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
; Function Attrs: nounwind uwtable