- Bug with slice acces as inline struct member #2088.

This commit is contained in:
Christoffer Lerno
2025-04-16 17:02:22 +02:00
parent a44e932806
commit 37ffd92f7b
3 changed files with 29 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
// #target: macos-x64
module test;
struct Foo
{
inline String str;
}
fn int main()
{
(Foo){}.len;
return 0;
}
/* #expect: test.ll
entry:
%literal = alloca %Foo, align 8
call void @llvm.memset.p0.i64(ptr align 8 %literal, i8 0, i64 16, i1 false)
%ptradd = getelementptr inbounds i8, ptr %literal, i64 8
ret i32 0
}