mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
24 lines
555 B
C
24 lines
555 B
C
// #target: macos-x64
|
|
|
|
module test;
|
|
import std::collections::map;
|
|
|
|
typedef 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, align 8
|
|
call void @llvm.memset.p0.i64(ptr align 8 %map, i8 0, i64 40, i1 false)
|
|
%0 = call i8 @"std_collections_map$$sa$char.int_HashMap_set"(ptr %map, ptr @.str, i64 5, i32 4)
|
|
%1 = call i8 @"std_collections_map$$sa$char.int_HashMap_set"(ptr %map, ptr @.str.1, i64 3, i32 5)
|
|
ret void
|
|
}
|