// #target: linux-x64 module test; import std::io; fn void main() { io::println("Hello, world!"); } extern fn void puts(char*); static initialize @priority(300) { puts("Hello startup2"); } static initialize { puts("Let's start main..."); } static initialize @priority(200) { puts("Hello startup"); } static initialize {} static finalize { puts("Bye bye"); } /* #expect: test.ll @llvm.global_ctors = appending global [3 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 300, void ()* @.static_initialize.0, i8* null }, { i32, void ()*, i8* } { i32 65535, void ()* @.static_initialize.1, i8* null }, { i32, void ()*, i8* } { i32 200, void ()* @.static_initialize.2, i8* null }] @llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @.static_finalize.0, i8* null }] define internal void @.static_initialize.0() { entry: call void @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)) ret void } ; Function Attrs: nounwind declare void @puts(i8*) #0 define internal void @.static_initialize.1() { entry: call void @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i32 0, i32 0)) ret void } define internal void @.static_initialize.2() { entry: call void @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i32 0, i32 0)) ret void } define internal void @.static_finalize.0() { entry: call void @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0)) ret void }