Files
c3c/test/test_suite/overloading/set_overload.c3t
2025-12-29 17:01:03 +01:00

24 lines
568 B
Plaintext

// #target: macos-x64
module test;
import std::collections::map;
alias IntMap = HashMap{char[], int};
fn void main()
{
IntMap map;
map.set("Hello", 4);
map["Bye"] = 5;
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
%map = alloca %"HashMap{char[], int}", align 8
call void @llvm.memset.p0.i64(ptr align 8 %map, i8 0, i64 48, i1 false)
%0 = call i8 @"std.collections.map.HashMap$sa$char$int$.set"(ptr %map, ptr @.str, i64 5, i32 4)
%1 = call i8 @"std.collections.map.HashMap$sa$char$int$.set"(ptr %map, ptr @.str.1, i64 3, i32 5)
ret void
}