---
source: crates/mun_codegen/src/test.rs
expression: "\n struct(value) Bar(f64, i32, bool, Foo);\n struct(value) Foo { a: i32 };\n struct(value) Baz;\n pub fn foo() {\n let a: Foo = Foo { a: 5 };\n let b: Bar = Bar(1.23, a.a, true, a);\n let c: Baz = Baz;\n }\n "
---
; == FILE IR (mod) =====================================
; ModuleID = 'mod'
source_filename = "mod"
%DispatchTable = type { i8** (i8*, i8*)* }
%"mun_codegen::ir::types::TypeInfo" = type <{ [0 x i64], [16 x i8], [0 x i64], i8*, [0 x i64], i32, [0 x i64], i8, [3 x i8], %"mun_codegen::ir::types::TypeInfoData", [0 x i64] }>
%"mun_codegen::ir::types::TypeInfoData" = type <{ [0 x i8], i8, [39 x i8] }>
%Baz = type {}
%Bar = type { double, i32, i1, %Foo }
%Foo = type { i32 }
@allocatorHandle = external global i8*
@dispatchTable = external global %DispatchTable
@global_type_table = external global [9 x %"mun_codegen::ir::types::TypeInfo"*]
define void @foo() {
body:
%c = alloca %Baz, align 8
%b = alloca %Bar, align 8
%a = alloca %Foo, align 8
store %Foo { i32 5 }, %Foo* %a, align 4
%Foo.a_ptr = getelementptr inbounds %Foo, %Foo* %a, i32 0, i32 0
%Foo.a = load i32, i32* %Foo.a_ptr, align 4
%a1 = load %Foo, %Foo* %a, align 4
%init = insertvalue %Bar { double 1.230000e+00, i32 undef, i1 undef, %Foo undef }, i32 %Foo.a, 1
%init2 = insertvalue %Bar %init, i1 true, 2
%init3 = insertvalue %Bar %init2, %Foo %a1, 3
store %Bar %init3, %Bar* %b, align 8
store %Baz undef, %Baz* %c, align 1
ret void
}
; == GROUP IR (mod) ====================================
; ModuleID = 'group_name'
source_filename = "group_name"
%DispatchTable = type { i8** (i8*, i8*)* }
%"mun_codegen::ir::types::TypeInfo" = type <{ [0 x i64], [16 x i8], [0 x i64], i8*, [0 x i64], i32, [0 x i64], i8, [3 x i8], %"mun_codegen::ir::types::TypeInfoData", [0 x i64] }>
%"mun_codegen::ir::types::TypeInfoData" = type <{ [0 x i8], i8, [39 x i8] }>
@dispatchTable = global %DispatchTable zeroinitializer
@"type_info::<core::i32>::name" = private unnamed_addr constant [10 x i8] c"core::i32\00"
@"type_info::<core::i32>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"\17yzt\19\D62\17\D25\95C\17\88[\FA", i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"type_info::<core::i32>::name", i32 0, i32 0), [48 x i8] c" \00\00\00\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@"type_info::<Foo>::name" = private unnamed_addr constant [4 x i8] c"Foo\00"
@"struct_info::<Foo>::field_names.0" = private unnamed_addr constant [2 x i8] c"a\00"
@"struct_info::<Foo>::field_names" = private unnamed_addr constant [1 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"struct_info::<Foo>::field_names.0", i32 0, i32 0)]
@"struct_info::<Foo>::field_types" = private unnamed_addr constant [1 x %"mun_codegen::ir::types::TypeInfo"*] [%"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::i32>"]
@"struct_info::<Foo>::field_offsets" = private unnamed_addr constant [1 x i16] zeroinitializer
@"type_info::<Foo>" = private unnamed_addr constant <{ [16 x i8], i8*, [16 x i8], i8**, [0 x i8], %"mun_codegen::ir::types::TypeInfo"**, [0 x i8], i16*, [8 x i8] }> <{ [16 x i8] c"8\AD\C9\D9Y\D2\AA<ME}\CD.\A5\A0\DB", i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"type_info::<Foo>::name", i32 0, i32 0), [16 x i8] c" \00\00\00\04\00\00\00\01\00\00\00\00\00\00\00", i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"struct_info::<Foo>::field_names", i32 0, i32 0), [0 x i8] zeroinitializer, %"mun_codegen::ir::types::TypeInfo"** getelementptr inbounds ([1 x %"mun_codegen::ir::types::TypeInfo"*], [1 x %"mun_codegen::ir::types::TypeInfo"*]* @"struct_info::<Foo>::field_types", i32 0, i32 0), [0 x i8] zeroinitializer, i16* getelementptr inbounds ([1 x i16], [1 x i16]* @"struct_info::<Foo>::field_offsets", i32 0, i32 0), [8 x i8] c"\01\00\01\00\00\00\00\00" }>
@"type_info::<*const TypeInfo>::name" = private unnamed_addr constant [16 x i8] c"*const TypeInfo\00"
@"type_info::<*const TypeInfo>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"=\A1-\1F\C2\A7\88`d\90\F4\B5\BEE}x", i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"type_info::<*const TypeInfo>::name", i32 0, i32 0), [48 x i8] c"@\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@"type_info::<Baz>::name" = private unnamed_addr constant [4 x i8] c"Baz\00"
@"type_info::<Baz>" = private unnamed_addr constant <{ [16 x i8], i8*, [16 x i8], i8**, [0 x i8], %"mun_codegen::ir::types::TypeInfo"**, [0 x i8], i16*, [8 x i8] }> <{ [16 x i8] c">\1A\BC\E5\C9\D3n\D8\8C?\86\22\FA\0DtV", i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"type_info::<Baz>::name", i32 0, i32 0), [16 x i8] c"\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00", i8** null, [0 x i8] zeroinitializer, %"mun_codegen::ir::types::TypeInfo"** null, [0 x i8] zeroinitializer, i16* null, [8 x i8] c"\00\00\01\00\00\00\00\00" }>
@"type_info::<core::f64>::name" = private unnamed_addr constant [10 x i8] c"core::f64\00"
@"type_info::<core::f64>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"`\DBF\9C?YJ%G\AD4\9F\D5\92%A", i8* getelementptr inbounds ([10 x i8], [10 x i8]* @"type_info::<core::f64>::name", i32 0, i32 0), [48 x i8] c"@\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@"type_info::<core::bool>::name" = private unnamed_addr constant [11 x i8] c"core::bool\00"
@"type_info::<core::bool>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"x\82\81m t7\03\CB\F8k\81-;\C9\84", i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"type_info::<core::bool>::name", i32 0, i32 0), [48 x i8] c"\01\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@"type_info::<*const *mut core::void>::name" = private unnamed_addr constant [23 x i8] c"*const *mut core::void\00"
@"type_info::<*const *mut core::void>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"\C5fO\BD\84\DF\06\BFd+\B1\9Abv\CE\00", i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"type_info::<*const *mut core::void>::name", i32 0, i32 0), [48 x i8] c"@\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@"type_info::<Bar>::name" = private unnamed_addr constant [4 x i8] c"Bar\00"
@"struct_info::<Bar>::field_names.0" = private unnamed_addr constant [2 x i8] c"0\00"
@"struct_info::<Bar>::field_names.1" = private unnamed_addr constant [2 x i8] c"1\00"
@"struct_info::<Bar>::field_names.2" = private unnamed_addr constant [2 x i8] c"2\00"
@"struct_info::<Bar>::field_names.3" = private unnamed_addr constant [2 x i8] c"3\00"
@"struct_info::<Bar>::field_names" = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"struct_info::<Bar>::field_names.0", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"struct_info::<Bar>::field_names.1", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"struct_info::<Bar>::field_names.2", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"struct_info::<Bar>::field_names.3", i32 0, i32 0)]
@"struct_info::<Bar>::field_types" = private unnamed_addr constant [4 x %"mun_codegen::ir::types::TypeInfo"*] [%"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::f64>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::i32>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::bool>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<Foo>"]
@"struct_info::<Bar>::field_offsets" = private unnamed_addr constant [4 x i16] [i16 0, i16 8, i16 12, i16 16]
@"type_info::<Bar>" = private unnamed_addr constant <{ [16 x i8], i8*, [16 x i8], i8**, [0 x i8], %"mun_codegen::ir::types::TypeInfo"**, [0 x i8], i16*, [8 x i8] }> <{ [16 x i8] c"\D6\CA\E2\C3Ht\09\EA\AEh\E50L\F7\EE\B5", i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"type_info::<Bar>::name", i32 0, i32 0), [16 x i8] c"\C0\00\00\00\08\00\00\00\01\00\00\00\00\00\00\00", i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @"struct_info::<Bar>::field_names", i32 0, i32 0), [0 x i8] zeroinitializer, %"mun_codegen::ir::types::TypeInfo"** getelementptr inbounds ([4 x %"mun_codegen::ir::types::TypeInfo"*], [4 x %"mun_codegen::ir::types::TypeInfo"*]* @"struct_info::<Bar>::field_types", i32 0, i32 0), [0 x i8] zeroinitializer, i16* getelementptr inbounds ([4 x i16], [4 x i16]* @"struct_info::<Bar>::field_offsets", i32 0, i32 0), [8 x i8] c"\04\00\01\00\00\00\00\00" }>
@"type_info::<*mut core::void>::name" = private unnamed_addr constant [16 x i8] c"*mut core::void\00"
@"type_info::<*mut core::void>" = private unnamed_addr constant <{ [16 x i8], i8*, [48 x i8] }> <{ [16 x i8] c"\F0Y\22\FC\95\9E\7F\CE\08T\B1\A2\CD\A7\FAz", i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"type_info::<*mut core::void>::name", i32 0, i32 0), [48 x i8] c"@\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" }>
@global_type_table = constant [9 x %"mun_codegen::ir::types::TypeInfo"*] [%"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::i32>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<Foo>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<*const TypeInfo>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<Baz>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::f64>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<core::bool>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<*const *mut core::void>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<Bar>", %"mun_codegen::ir::types::TypeInfo"* @"type_info::<*mut core::void>"]
@allocatorHandle = unnamed_addr global i8* null