diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap index 275c650b64..906f3dee39 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap @@ -5,8 +5,8 @@ expression: "results.join(\"\\n\")" ; ModuleID = 'main.st' source_filename = "main.st" -@x = external global i16 -@y = external global i16 +@x = external global i16, section "var-x:i16" +@y = external global i16, section "var-y:i16" define i16 @main() section "fn-main:i16" { entry: @@ -24,7 +24,7 @@ declare i16 @external() section "fn-external:i16" ; ModuleID = 'external.st' source_filename = "external.st" -@x = external global i16 -@y = external global i16 +@x = external global i16, section "var-x:i16" +@y = external global i16, section "var-y:i16" declare i16 @external() section "fn-external:i16" diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap index d66f8c80d5..1e6d9d5d84 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap @@ -7,7 +7,7 @@ source_filename = "app/file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg, !dbg !0 +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:v", !dbg !0 define i16 @main() section "fn-main:i16" !dbg !10 { entry: @@ -54,7 +54,7 @@ source_filename = "lib/file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:v", !dbg !0 define void @mainProg(%mainProg* %0) section "fn-mainProg:v" !dbg !10 { entry: diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap index 10ea84d0cd..f4e07003b1 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap @@ -7,7 +7,7 @@ source_filename = "file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg, !dbg !0 +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:v", !dbg !0 define i16 @main() section "fn-main:i16" !dbg !10 { entry: @@ -54,7 +54,7 @@ source_filename = "file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:v", !dbg !0 define void @mainProg(%mainProg* %0) section "fn-mainProg:v" !dbg !10 { entry: diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap index 9d92283477..3caea93db8 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap @@ -7,7 +7,7 @@ source_filename = "external_file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:v" define i16 @main() section "fn-main:i16" { entry: @@ -25,7 +25,7 @@ source_filename = "external_file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:v" define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { entry: diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 4e00658c69..db20711f74 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -84,9 +84,11 @@ impl SectionMangler { } } - pub fn with_return_type(self, return_type: Option) -> SectionMangler { + pub fn with_return_type(self, return_type: Type) -> SectionMangler { match self { - SectionMangler::Function(f) => SectionMangler::Function(FunctionMangler { return_type, ..f }), + SectionMangler::Function(f) => { + SectionMangler::Function(FunctionMangler { return_type: Some(return_type), ..f }) + } SectionMangler::Variable(_) => unreachable!("global variables do not have a return type."), } } diff --git a/src/codegen/generators/pou_generator.rs b/src/codegen/generators/pou_generator.rs index e23af09f0e..a9c2d01caf 100644 --- a/src/codegen/generators/pou_generator.rs +++ b/src/codegen/generators/pou_generator.rs @@ -153,17 +153,16 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { PouGenerator { llvm, index, annotations, llvm_index } } - fn mangle_function(&self, implementation: &ImplementationIndexEntry) -> String { + fn mangle_function(&self, implementation: &ImplementationIndexEntry) -> Result { let ctx = SectionMangler::function(implementation.get_call_name()); let params = self.index.get_declared_parameters(implementation.get_call_name()); - let ctx = params.into_iter().fold(ctx, |ctx, param| { - // FIXME: Can we unwrap here? + let ctx = params.into_iter().try_fold(ctx, |ctx, param| -> Result { let ty = section_names::mangle_type( self.index, - self.index.get_effective_type_by_name(¶m.data_type_name).unwrap(), - ); + self.index.get_effective_type_by_name(¶m.data_type_name)?, + )?; let parameter = match param.argument_type { // TODO: We need to handle the `VariableType` enum as well - this describes the mode of // argument passing, e.g. inout @@ -171,15 +170,20 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { index::ArgumentType::ByRef(_) => FunctionArgument::ByRef(ty), }; - ctx.with_parameter(parameter) - }); + Ok(ctx.with_parameter(parameter)) + })?; let return_ty = self .index .find_return_type(implementation.get_type_name()) .map(|ty| section_names::mangle_type(self.index, ty)); - ctx.with_return_type(return_ty).mangle() + let ctx = match return_ty { + Some(rty) => ctx.with_return_type(rty?), + None => ctx, + }; + + Ok(ctx.mangle()) } /// generates an empty llvm function for the given implementation, including all parameters and the return type @@ -281,7 +285,7 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { let curr_f = module.add_function(implementation.get_call_name(), function_declaration, None); - let section_name = self.mangle_function(implementation); + let section_name = self.mangle_function(implementation)?; curr_f.set_section(Some(§ion_name)); let pou_name = implementation.get_call_name(); diff --git a/src/codegen/generators/section_names.rs b/src/codegen/generators/section_names.rs index a6a03c8380..0d7cefaa1c 100644 --- a/src/codegen/generators/section_names.rs +++ b/src/codegen/generators/section_names.rs @@ -1,14 +1,15 @@ use crate::index::Index; use crate::typesystem::{self, DataTypeInformation, StringEncoding, TypeSize}; +use plc_diagnostics::diagnostics::Diagnostic; use section_mangler::{StringEncoding as SectionStringEncoding, Type}; -pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> section_mangler::Type { +pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> Result { // TODO: This is a bit ugly because we keep dereferencing references to Copy types like // bool, u32, etc, because `DataTypeInformation::Pointer` keeps a `String` which is not // Copy. the alternative is for section_mangle::Type to keep references everywhere, and // have a lifetime generic parameter, e.g. `section_mangler::Type<'a>` - which is also // annoying. - match ty.get_type_information() { + let mangled = match ty.get_type_information() { DataTypeInformation::Void => Type::Void, DataTypeInformation::Integer { signed, size, semantic_size, .. } => { Type::Integer { signed: *signed, size: *size, semantic_size: *semantic_size } @@ -23,11 +24,13 @@ pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> section_mangler: Type::String { size: *size as usize, encoding } } DataTypeInformation::Pointer { inner_type_name, .. } => Type::Pointer { - inner: Box::new(mangle_type(index, index.get_effective_type_by_name(inner_type_name).unwrap())), + inner: Box::new(mangle_type(index, index.get_effective_type_by_name(inner_type_name)?)?), }, // FIXME: For now, encode all unknown types as "void" since this is not required for // execution. Not doing so (and doing an `unreachable!()` for example) obviously causes // failures, because complex types are already implemented in the compiler. _ => Type::Void, - } + }; + + Ok(mangled) } diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 55a8194b05..08b99db2fb 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -15,6 +15,7 @@ use super::{ data_type_generator::get_default_for, expression_generator::ExpressionCodeGenerator, llvm::{GlobalValueExt, Llvm}, + section_names, }; use crate::codegen::debug::DebugBuilderEnum; use crate::index::FxIndexSet; @@ -170,6 +171,17 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { } } + let section = section_mangler::SectionMangler::variable( + global_variable.get_name(), + section_names::mangle_type( + self.global_index, + self.global_index.get_effective_type_by_name(global_variable.get_type_name())?, + )?, + ) + .mangle(); + + global_ir_variable.set_section(Some(§ion)); + Ok(global_ir_variable) } } diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap index fe0182cfa9..01893fd7c4 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap @@ -8,8 +8,8 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = external global %myPrg, !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, !dbg !5 +@myPrg_instance = external global %myPrg, section "var-myPrg_instance:v", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !5 declare i32 @myFunc() section "fn-myFunc:i32" diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap index e5933b7ee3..7d396b08f5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap @@ -8,8 +8,8 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = global %myPrg zeroinitializer, !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, !dbg !5 +@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:v", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !5 define i32 @myFunc() section "fn-myFunc:i32" !dbg !12 { entry: diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap index 99bd0a7cf7..a5be82a1c0 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap @@ -8,8 +8,8 @@ source_filename = "main" %myProg = type { i32 } %fb = type { i32 } -@myProg_instance = global %myProg zeroinitializer, !dbg !0 -@__fb__init = unnamed_addr constant %fb zeroinitializer, !dbg !7 +@myProg_instance = global %myProg zeroinitializer, section "var-myProg_instance:v", !dbg !0 +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v", !dbg !7 define void @myProg(%myProg* %0) section "fn-myProg:v[i32]" !dbg !16 { entry: diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__string_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__string_size_correctly_set_in_dwarf_info.snap index fd039416b4..8fc968ed22 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__string_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__string_size_correctly_set_in_dwarf_info.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [65 x i8] zeroinitializer, !dbg !0 +@a = global [65 x i8] zeroinitializer, section "var-a:s8u65", !dbg !0 !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap index 09aeddba2f..0662946bc3 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap @@ -8,8 +8,8 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = global %myPrg zeroinitializer, !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, !dbg !9 +@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:v", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !9 define i32 @myFunc() section "fn-myFunc:i32" !dbg !20 { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap index 157bfcca59..e853d64321 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap @@ -7,7 +7,7 @@ source_filename = "main" %commands = type { i8, i8 } -@__commands__init = unnamed_addr constant %commands { i8 1, i8 0 } +@__commands__init = unnamed_addr constant %commands { i8 1, i8 0 }, section "var-__commands__init:v" define i32 @main() section "fn-main:i32" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap index 66373e6230..853cf1cfc2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap @@ -7,7 +7,7 @@ source_filename = "main" %commands = type { i8, i8 } -@__commands__init = unnamed_addr constant %commands zeroinitializer +@__commands__init = unnamed_addr constant %commands zeroinitializer, section "var-__commands__init:v" @__main.myStr1__init = unnamed_addr constant [81 x i8] zeroinitializer define i32 @main() section "fn-main:i32" { diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_constant_variables.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_constant_variables.snap index 67066f351d..13dad12aa2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_constant_variables.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_constant_variables.snap @@ -1,28 +1,25 @@ --- source: src/codegen/tests/initialization_test/global_initializers.rs -assertion_line: 38 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@c_INT = unnamed_addr constant i16 7 -@c_3c = unnamed_addr constant i16 21 -@c_BOOL = unnamed_addr constant i8 1 -@c_not = unnamed_addr constant i8 0 -@c_str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00" -@c_wstr = unnamed_addr constant [11 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0] -@c_real = unnamed_addr constant float 0x40091EB860000000 -@c_lreal = unnamed_addr constant double 3.141500e+00 -@x = unnamed_addr constant i16 7 -@y = unnamed_addr constant i16 14 -@z = unnamed_addr constant i16 32 -@b = unnamed_addr constant i8 1 -@nb = unnamed_addr constant i8 0 -@bb = unnamed_addr constant i8 0 -@str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00" -@wstr = unnamed_addr constant [11 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0] -@r = unnamed_addr constant float 0x3FF91EB860000000 -@tau = unnamed_addr constant double 6.283000e+00 - +@c_INT = unnamed_addr constant i16 7, section "var-c_INT:i16" +@c_3c = unnamed_addr constant i16 21, section "var-c_3c:i16" +@c_BOOL = unnamed_addr constant i8 1, section "var-c_BOOL:u8" +@c_not = unnamed_addr constant i8 0, section "var-c_not:u8" +@c_str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00", section "var-c_str:s8u11" +@c_wstr = unnamed_addr constant [11 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0], section "var-c_wstr:s16u11" +@c_real = unnamed_addr constant float 0x40091EB860000000, section "var-c_real:f32" +@c_lreal = unnamed_addr constant double 3.141500e+00, section "var-c_lreal:f64" +@x = unnamed_addr constant i16 7, section "var-x:i16" +@y = unnamed_addr constant i16 14, section "var-y:i16" +@z = unnamed_addr constant i16 32, section "var-z:i16" +@b = unnamed_addr constant i8 1, section "var-b:u8" +@nb = unnamed_addr constant i8 0, section "var-nb:u8" +@bb = unnamed_addr constant i8 0, section "var-bb:u8" +@str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00", section "var-str:s8u11" +@wstr = unnamed_addr constant [11 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0], section "var-wstr:s16u11" +@r = unnamed_addr constant float 0x3FF91EB860000000, section "var-r:f32" +@tau = unnamed_addr constant double 6.283000e+00, section "var-tau:f64" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap index 8316de11dc..80c3a364d3 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables.snap @@ -1,13 +1,10 @@ --- source: src/codegen/tests/initialization_test/global_initializers.rs -assertion_line: 53 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@x = global i16 7 -@y = global i8 1 -@z = global float 0x400921CAC0000000 - +@x = global i16 7, section "var-x:i16" +@y = global i8 1, section "var-y:u8" +@z = global float 0x400921CAC0000000, section "var-z:f32" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap index 6cd804ef79..45ac8563ca 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap @@ -8,9 +8,9 @@ source_filename = "main" %MyFB = type { i16 } %prg = type { %MyFB } -@x = global %MyFB { i16 77 } -@__MyFB__init = unnamed_addr constant %MyFB { i16 77 } -@prg_instance = global %prg { %MyFB { i16 77 } } +@x = global %MyFB { i16 77 }, section "var-x:v" +@__MyFB__init = unnamed_addr constant %MyFB { i16 77 }, section "var-__MyFB__init:v" +@prg_instance = global %prg { %MyFB { i16 77 } }, section "var-prg_instance:v" define void @MyFB(%MyFB* %0) section "fn-MyFB:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap index 3936b3ed8d..47f6e67f71 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__uninitialized_global_array.snap @@ -1,10 +1,8 @@ --- source: src/codegen/tests/initialization_test/global_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@a = global [2 x i8] zeroinitializer - +@a = global [2 x i8] zeroinitializer, section "var-a:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap index f18e7a7f9f..ccaeb66ab5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap @@ -8,8 +8,8 @@ source_filename = "main" %fb = type { i16 } %main = type { %fb } -@__fb__init = unnamed_addr constant %fb { i16 9 } -@main_instance = global %main { %fb { i16 9 } } +@__fb__init = unnamed_addr constant %fb { i16 9 }, section "var-__fb__init:v" +@main_instance = global %main { %fb { i16 9 } }, section "var-main_instance:v" define void @fb(%fb* %0) section "fn-fb:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap index 4814d385ab..491a95ed7c 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap @@ -5,11 +5,11 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@x = global i32 10 -@__foo_position.x = unnamed_addr constant i32 1 -@__bar_position.x = unnamed_addr constant i32 3 -@__foo_position.y = unnamed_addr constant i32 2 -@__bar_position.y = unnamed_addr constant i32 4 +@x = global i32 10, section "var-x:i32" +@__foo_position.x = unnamed_addr constant i32 1, section "var-x:v" +@__bar_position.x = unnamed_addr constant i32 3, section "var-x:v" +@__foo_position.y = unnamed_addr constant i32 2, section "var-y:v" +@__bar_position.y = unnamed_addr constant i32 4, section "var-y:v" define i32 @foo() section "fn-foo:i32" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap index f4b32717b2..b5ee8c7258 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap @@ -8,8 +8,8 @@ source_filename = "main" %fb = type {} %main = type { %fb } -@__fb__init = unnamed_addr constant %fb zeroinitializer -@main_instance = global %main zeroinitializer +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @fb(%fb* %0) section "fn-fb:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap index 8c46762849..55750e7c54 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap @@ -7,7 +7,7 @@ source_filename = "main" %MyStruct = type { i32, i16 } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" define i16 @foo_int() section "fn-foo_int:i16" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap index fd1ff02550..2dbcf8c413 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap @@ -7,8 +7,8 @@ source_filename = "main" %main = type { [4 x i32], [4 x i32] } -@main_instance = global %main zeroinitializer -@__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__myArray__init:v" define void @target([4 x i32]* %0) section "fn-target:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap index 2c289792cb..a6d4cec2d0 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap @@ -7,9 +7,9 @@ source_filename = "main" %MyStrct = type { i32, i32, i32 } -@__MyStr__init = unnamed_addr constant [11 x i8] c"init\00\00\00\00\00\00\00" -@__MyArr__init = unnamed_addr constant [10 x float] [float 0.000000e+00, float 0x3FF19999A0000000, float 0x40019999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 5.500000e+00, float 0x401A666660000000, float 0x401ECCCCC0000000, float 0x40219999A0000000, float 0x4023CCCCC0000000] -@__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 } +@__MyStr__init = unnamed_addr constant [11 x i8] c"init\00\00\00\00\00\00\00", section "var-__MyStr__init:s8u11" +@__MyArr__init = unnamed_addr constant [10 x float] [float 0.000000e+00, float 0x3FF19999A0000000, float 0x40019999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 5.500000e+00, float 0x401A666660000000, float 0x401ECCCCC0000000, float 0x40219999A0000000, float 0x4023CCCCC0000000], section "var-__MyArr__init:v" +@__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 }, section "var-__MyStrct__init:v" define i16 @foo_int() section "fn-foo_int:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap index 13afea3c3c..a0989f4e3a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap @@ -7,7 +7,7 @@ source_filename = "main" %MyStrct = type { i32, i32, i32 } -@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer +@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-__MyStrct__init:v" define i16 @foo_int() section "fn-foo_int:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap index ac5fadd160..451b11526a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap @@ -7,10 +7,10 @@ source_filename = "main" %prg = type { i16, i16 } -@MAX_LEN = unnamed_addr constant i16 99 -@MIN_LEN = unnamed_addr constant i16 10 -@LEN = unnamed_addr constant i16 20 -@prg_instance = global %prg { i16 24, i16 89 } +@MAX_LEN = unnamed_addr constant i16 99, section "var-MAX_LEN:i16" +@MIN_LEN = unnamed_addr constant i16 10, section "var-MIN_LEN:i16" +@LEN = unnamed_addr constant i16 20, section "var-LEN:i16" +@prg_instance = global %prg { i16 24, i16 89 }, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v[i16][i16]" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap index d0331729c0..ccea431152 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_array_of_array_variable.snap @@ -1,10 +1,8 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@a = global [2 x [2 x i8]] [[2 x i8] c"\01\02", [2 x i8] c"\03\04"] - +@a = global [2 x [2 x i8]] [[2 x i8] c"\01\02", [2 x i8] c"\03\04"], section "var-a:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap index a5929eb7d3..2a173a8804 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap @@ -8,8 +8,8 @@ source_filename = "main" %FB = type { i16, i16, i8, i8, float, float } %main = type { %FB } -@__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } -@main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } } +@__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-__FB__init:v" +@main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } }, section "var-main_instance:v" define void @FB(%FB* %0) section "fn-FB:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap index ff7c4eea8f..fa41bb40f5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap @@ -7,7 +7,7 @@ source_filename = "main" %Main = type { i16, i16, i8, i8, float, float } -@Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } +@Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-Main_instance:v" define void @Main(%Main* %0) section "fn-Main:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap index 180d254bf3..d27868f830 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] +@__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__arr__init:v" define i16 @func() section "fn-func:i16" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap index 966bd9624c..abe7965daa 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap @@ -7,7 +7,7 @@ source_filename = "main" %__func_a = type { i16 } -@____func_a__init = unnamed_addr constant %__func_a zeroinitializer +@____func_a__init = unnamed_addr constant %__func_a zeroinitializer, section "var-____func_a__init:v" define i16 @func() section "fn-func:i16" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap index fdd64024ee..531f81468c 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { %__prog_a } %__prog_a = type { i16 } -@prog_instance = global %prog zeroinitializer -@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-____prog_a__init:v" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap index f29cc3f334..71a651bc7a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap @@ -5,10 +5,10 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@__foo_position.x = unnamed_addr constant i32 1 -@__bar_position.x = unnamed_addr constant i32 3 -@__foo_position.y = unnamed_addr constant i32 2 -@__bar_position.y = unnamed_addr constant i32 4 +@__foo_position.x = unnamed_addr constant i32 1, section "var-x:v" +@__bar_position.x = unnamed_addr constant i32 3, section "var-x:v" +@__foo_position.y = unnamed_addr constant i32 2, section "var-y:v" +@__bar_position.y = unnamed_addr constant i32 4, section "var-y:v" define i32 @foo() section "fn-foo:i32" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap index 4e12913c16..ee17653176 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap @@ -5,14 +5,14 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@__a_position.x = unnamed_addr constant i32 1 -@__aa_position.x = unnamed_addr constant i32 2 -@__bb_position.x = unnamed_addr constant i32 3 -@__b_position.x = unnamed_addr constant i32 4 -@__a_position.y = unnamed_addr constant i32 5 -@__aa_position.y = unnamed_addr constant i32 5 -@__bb_position.y = unnamed_addr constant i32 5 -@__b_position.y = unnamed_addr constant i32 5 +@__a_position.x = unnamed_addr constant i32 1, section "var-x:v" +@__aa_position.x = unnamed_addr constant i32 2, section "var-x:v" +@__bb_position.x = unnamed_addr constant i32 3, section "var-x:v" +@__b_position.x = unnamed_addr constant i32 4, section "var-x:v" +@__a_position.y = unnamed_addr constant i32 5, section "var-y:v" +@__aa_position.y = unnamed_addr constant i32 5, section "var-y:v" +@__bb_position.y = unnamed_addr constant i32 5, section "var-y:v" +@__b_position.y = unnamed_addr constant i32 5, section "var-y:v" define i32 @a() section "fn-a:i32" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap index 02b7546bc9..1a701ba06a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__alias_chain_with_lots_of_initializers.snap @@ -1,13 +1,11 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@x0 = global i32 1 -@x1 = global i32 1 -@x2 = global i32 2 -@x3 = global i32 3 - +@x0 = global i32 1, section "var-x0:i32" +@x1 = global i32 1, section "var-x1:i32" +@x2 = global i32 2, section "var-x2:i32" +@x3 = global i32 3, section "var-x3:i32" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap index c43b1a1b00..5707989bc5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap @@ -8,11 +8,11 @@ source_filename = "main" %myStruct = type { i32, i32, [2 x i32] } %main = type { [2 x %myStruct], [2 x %myStruct] } -@str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer -@alias_str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] } -@global_arr = unnamed_addr constant [2 x i32] [i32 30, i32 40] -@main_instance = global %main { [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }], [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] } +@str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-str:v" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" +@alias_str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-alias_str:v" +@global_arr = unnamed_addr constant [2 x i32] [i32 30, i32 40], section "var-global_arr:v" +@main_instance = global %main { [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }], [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] }, section "var-main_instance:v" @__main.arr__init = unnamed_addr constant [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] @__main.alias_arr__init = unnamed_addr constant [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__complex_initial_values_in_struct_variable_using_multiplied_statement.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__complex_initial_values_in_struct_variable_using_multiplied_statement.snap index e20ef73b71..b9ac16eb15 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__complex_initial_values_in_struct_variable_using_multiplied_statement.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__complex_initial_values_in_struct_variable_using_multiplied_statement.snap @@ -8,7 +8,6 @@ source_filename = "main" %MyStruct = type { %MyPoint, [4 x i16], i32 } %MyPoint = type { i32, i32 } -@a = global %MyStruct { %MyPoint { i32 1, i32 2 }, [4 x i16] [i16 0, i16 1, i16 2, i16 3], i32 7 } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer - +@a = global %MyStruct { %MyPoint { i32 1, i32 2 }, [4 x i16] [i16 0, i16 1, i16 2, i16 3], i32 7 }, section "var-a:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap index 54a43a7466..bbb173cac9 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap @@ -5,21 +5,21 @@ expression: res ; ModuleID = 'main' source_filename = "main" -@x = global i32 2 -@__main_var1.x1 = unnamed_addr constant i32 1 -@__main_var2.x7 = unnamed_addr constant i32 2 -@__global_x.yellow = unnamed_addr constant i32 1 -@__main_y.redy = unnamed_addr constant i32 1 -@__main_y.yellowy = unnamed_addr constant i32 2 -@__main_y.greeny = unnamed_addr constant i32 3 -@__main_var1.x2 = unnamed_addr constant i32 2 -@__main_var1.x3 = unnamed_addr constant i32 3 -@__main_var2.x5 = unnamed_addr constant i32 0 -@__main_var2.x6 = unnamed_addr constant i32 1 -@__main_var3.x8 = unnamed_addr constant i32 0 -@__main_var3.x9 = unnamed_addr constant i32 1 -@__global_x.red = unnamed_addr constant i32 0 -@__global_x.green = unnamed_addr constant i32 2 +@x = global i32 2, section "var-x:v" +@__main_var1.x1 = unnamed_addr constant i32 1, section "var-x1:v" +@__main_var2.x7 = unnamed_addr constant i32 2, section "var-x7:v" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:v" +@__main_y.redy = unnamed_addr constant i32 1, section "var-redy:v" +@__main_y.yellowy = unnamed_addr constant i32 2, section "var-yellowy:v" +@__main_y.greeny = unnamed_addr constant i32 3, section "var-greeny:v" +@__main_var1.x2 = unnamed_addr constant i32 2, section "var-x2:v" +@__main_var1.x3 = unnamed_addr constant i32 3, section "var-x3:v" +@__main_var2.x5 = unnamed_addr constant i32 0, section "var-x5:v" +@__main_var2.x6 = unnamed_addr constant i32 1, section "var-x6:v" +@__main_var3.x8 = unnamed_addr constant i32 0, section "var-x8:v" +@__main_var3.x9 = unnamed_addr constant i32 1, section "var-x9:v" +@__global_x.red = unnamed_addr constant i32 0, section "var-red:v" +@__global_x.green = unnamed_addr constant i32 2, section "var-green:v" define i32 @main() section "fn-main:i32" { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__expression_list_as_array_initilization.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__expression_list_as_array_initilization.snap index dd18222fa1..778c2ba1be 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__expression_list_as_array_initilization.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__expression_list_as_array_initilization.snap @@ -1,13 +1,10 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs -assertion_line: 93 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@arr = global [5 x i16] [i16 1, i16 2, i16 3, i16 0, i16 0] -@b_exp = global [6 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0, i32 0] -@str = global [4 x [81 x i8]] [[81 x i8] c"first\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\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", [81 x i8] c"second\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\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", [81 x i8] zeroinitializer, [81 x i8] zeroinitializer] - +@arr = global [5 x i16] [i16 1, i16 2, i16 3, i16 0, i16 0], section "var-arr:v" +@b_exp = global [6 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0, i32 0], section "var-b_exp:v" +@str = global [4 x [81 x i8]] [[81 x i8] c"first\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\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", [81 x i8] c"second\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\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", [81 x i8] zeroinitializer, [81 x i8] zeroinitializer], section "var-str:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap index 584be447f3..b44485541e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization.snap @@ -1,11 +1,8 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs -assertion_line: 105 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0] - +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0], section "var-arr:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap index 66951c1e73..8cff67b366 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__incomplete_array_initialization_with_custom_init_value.snap @@ -1,11 +1,8 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs -assertion_line: 119 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7] - +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7], section "var-arr:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_nested_struct_delayed_init.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_nested_struct_delayed_init.snap index 2e399090e9..de5683b641 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_nested_struct_delayed_init.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_nested_struct_delayed_init.snap @@ -8,8 +8,7 @@ source_filename = "main" %MyStruct2 = type { %MyStruct, %MyStruct } %MyStruct = type { i32, i32 } -@a = global %MyStruct2 { %MyStruct { i32 5, i32 7 }, %MyStruct { i32 3, i32 2 } } -@__MyStruct2__init = unnamed_addr constant %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 0, i32 7 } } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -@b = global %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 9, i32 0 } } - +@a = global %MyStruct2 { %MyStruct { i32 5, i32 7 }, %MyStruct { i32 3, i32 2 } }, section "var-a:v" +@__MyStruct2__init = unnamed_addr constant %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 0, i32 7 } }, section "var-__MyStruct2__init:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@b = global %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 9, i32 0 } }, section "var-b:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_array_variable_using_multiplied_statement.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_array_variable_using_multiplied_statement.snap index bb1bd1833f..8a24ff596a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_array_variable_using_multiplied_statement.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_array_variable_using_multiplied_statement.snap @@ -1,13 +1,11 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@a = global [4 x i8] c"\07\07\07\07" -@b = global [4 x i8] c"\02\07\07\03" -@c = global [10 x i8] c"\00\01\00\01\00\01\00\01\00\01" -@d = global [10 x i8] c"\00\00\01\01\02\00\00\01\01\02" - +@a = global [4 x i8] c"\07\07\07\07", section "var-a:v" +@b = global [4 x i8] c"\02\07\07\03", section "var-b:v" +@c = global [10 x i8] c"\00\01\00\01\00\01\00\01\00\01", section "var-c:v" +@d = global [10 x i8] c"\00\00\01\01\02\00\00\01\01\02", section "var-d:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap index c1d76999b9..5c689524b3 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap @@ -8,8 +8,8 @@ source_filename = "main" %TON = type { i16, i16 } %main = type { i16, %TON, %TON } -@__TON__init = unnamed_addr constant %TON zeroinitializer -@main_instance = global %main { i16 10, %TON { i16 10, i16 17 }, %TON { i16 17, i16 10 } } +@__TON__init = unnamed_addr constant %TON zeroinitializer, section "var-__TON__init:v" +@main_instance = global %main { i16 10, %TON { i16 10, i16 17 }, %TON { i16 17, i16 10 } }, section "var-main_instance:v" @__main.struct1__init = unnamed_addr constant %TON { i16 10, i16 17 } @__main.struct2__init = unnamed_addr constant %TON { i16 17, i16 10 } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap index 0f3864ac7c..41c629a124 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_multi_dimension_array_variable.snap @@ -1,11 +1,8 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs -assertion_line: 158 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@a = global [4 x i8] c"\01\02\03\04" - +@a = global [4 x i8] c"\01\02\03\04", section "var-a:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap index efe72cb312..999b7620ae 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_type.snap @@ -5,6 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global [3 x i16] [i16 1, i16 2, i16 3] -@__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3] - +@x = global [3 x i16] [i16 1, i16 2, i16 3], section "var-x:v" +@__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3], section "var-__MyArray__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_variable.snap index 387927ce95..efda6d9b39 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_single_dimension_array_variable.snap @@ -1,18 +1,15 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs -assertion_line: 159 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@a = global [3 x i8] c"\01\02\03" -@b = global [3 x i16] [i16 1, i16 2, i16 3] -@c = global [3 x i32] [i32 1, i32 2, i32 3] -@d = global [3 x i64] [i64 1, i64 2, i64 3] -@e = global [3 x i8] c"\01\02\03" -@f = global [3 x i16] [i16 1, i16 2, i16 3] -@g = global [3 x i64] [i64 1, i64 2, i64 3] -@h = global [3 x i8] [i8 true, i8 false, i8 true] - +@a = global [3 x i8] c"\01\02\03", section "var-a:v" +@b = global [3 x i16] [i16 1, i16 2, i16 3], section "var-b:v" +@c = global [3 x i32] [i32 1, i32 2, i32 3], section "var-c:v" +@d = global [3 x i64] [i64 1, i64 2, i64 3], section "var-d:v" +@e = global [3 x i8] c"\01\02\03", section "var-e:v" +@f = global [3 x i16] [i16 1, i16 2, i16 3], section "var-f:v" +@g = global [3 x i64] [i64 1, i64 2, i64 3], section "var-g:v" +@h = global [3 x i8] [i8 true, i8 false, i8 true], section "var-h:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_types.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_types.snap index 4371c8d7e6..8805826663 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_types.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_types.snap @@ -7,6 +7,5 @@ source_filename = "main" %MyStruct = type { i16, i16, i8, i8, float, float } -@x = global %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } -@__MyStruct__init = unnamed_addr constant %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } - +@x = global %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-x:v" +@__MyStruct__init = unnamed_addr constant %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-__MyStruct__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap index bf4180e439..488abaf68d 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable.snap @@ -7,7 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32 } -@a = global %MyStruct { i32 3, i32 5 } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -@b = global %MyStruct { i32 5, i32 3 } - +@a = global %MyStruct { i32 3, i32 5 }, section "var-a:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@b = global %MyStruct { i32 5, i32 3 }, section "var-b:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable_missing_init.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable_missing_init.snap index efd2696cdd..71d7ba8efe 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable_missing_init.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_struct_variable_missing_init.snap @@ -7,7 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32, i32 } -@a = global %MyStruct { i32 5, i32 0, i32 10 } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -@b = global %MyStruct { i32 0, i32 3, i32 10 } - +@a = global %MyStruct { i32 5, i32 0, i32 10 }, section "var-a:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@b = global %MyStruct { i32 0, i32 3, i32 10 }, section "var-b:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap index f41b371bc4..2a32557473 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_sub_range_type.snap @@ -1,10 +1,8 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@x = global i16 7 - +@x = global i16 7, section "var-x:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap index f41b371bc4..8bb5bfa260 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_type_alias.snap @@ -1,10 +1,8 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@x = global i16 7 - +@x = global i16 7, section "var-x:i16" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__partly_uninitialized_const_struct_will_get_default_values.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__partly_uninitialized_const_struct_will_get_default_values.snap index 5085a5dbb3..bf139b3e04 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__partly_uninitialized_const_struct_will_get_default_values.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__partly_uninitialized_const_struct_will_get_default_values.snap @@ -7,7 +7,6 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = unnamed_addr constant %Point { i32 1, i32 2, i32 3 } -@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 } -@empty = unnamed_addr constant %Point { i32 0, i32 2, i32 3 } - +@x = unnamed_addr constant %Point { i32 1, i32 2, i32 3 }, section "var-x:v" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:v" +@empty = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-empty:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap index ed8acdc181..831c8f33c5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap @@ -9,9 +9,9 @@ source_filename = "main" %STRUCT1 = type { i32, [2 x %STRUCT2] } %STRUCT2 = type { i32, i32 } -@main_instance = global %main { [3 x %STRUCT1] [%STRUCT1 { i32 0, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 2, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 1 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 1, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 { i32 0, i32 2 }] }] } -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer +@main_instance = global %main { [3 x %STRUCT1] [%STRUCT1 { i32 0, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 2, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 1 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 1, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 { i32 0, i32 2 }] }] }, section "var-main_instance:v" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:v" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:v" @__main.var_init1__init = unnamed_addr constant [3 x %STRUCT1] [%STRUCT1 { i32 0, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 2, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 1 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 1, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 { i32 0, i32 2 }] }] define void @main(%main* %0) section "fn-main:v" { diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initial_values_different_data_types.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initial_values_different_data_types.snap index 16b3f1ef6c..261439bd1a 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initial_values_different_data_types.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initial_values_different_data_types.snap @@ -7,6 +7,5 @@ source_filename = "main" %MyStruct = type { i8, i8, i8, i16, i16, i16, i32, i32, i32, i64, i64, i64, float, double } -@x = global %MyStruct { i8 7, i8 7, i8 7, i16 7, i16 7, i16 7, i32 7, i32 7, i32 7, i64 7, i64 7, i64 7, float 0x401ECCCCC0000000, double 7.700000e+00 } -@__MyStruct__init = unnamed_addr constant %MyStruct { i8 7, i8 7, i8 7, i16 7, i16 7, i16 7, i32 7, i32 7, i32 7, i64 7, i64 7, i64 7, float 0x401ECCCCC0000000, double 7.700000e+00 } - +@x = global %MyStruct { i8 7, i8 7, i8 7, i16 7, i16 7, i16 7, i32 7, i32 7, i32 7, i64 7, i64 7, i64 7, float 0x401ECCCCC0000000, double 7.700000e+00 }, section "var-x:v" +@__MyStruct__init = unnamed_addr constant %MyStruct { i8 7, i8 7, i8 7, i16 7, i16 7, i16 7, i32 7, i32 7, i32 7, i64 7, i64 7, i64 7, float 0x401ECCCCC0000000, double 7.700000e+00 }, section "var-__MyStruct__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap index d5d1781a3b..92af7e5756 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initialization_uses_types_default_if_not_provided.snap @@ -7,6 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = global %Point { i32 1, i32 2, i32 7 } -@__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 } - +@x = global %Point { i32 1, i32 2, i32 7 }, section "var-x:v" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 }, section "var-__Point__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap index d7a1508187..cfe33d4ef5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_initializer_uses_fallback_to_field_default.snap @@ -7,6 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = global %Point { i32 1, i32 2, i32 3 } -@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 } - +@x = global %Point { i32 1, i32 2, i32 3 }, section "var-x:v" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap index f3c20bd570..6eb8a9cec5 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__struct_with_one_field_can_be_initialized.snap @@ -7,6 +7,5 @@ source_filename = "main" %MyPoint = type { i32 } -@a = global %MyPoint { i32 7 } -@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer - +@a = global %MyPoint { i32 7 }, section "var-a:v" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:v" diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap index 908bd3460a..bbde239af2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__type_defaults_are_used_for_uninitialized_constants.snap @@ -5,8 +5,7 @@ expression: result.unwrap() ; ModuleID = 'main' source_filename = "main" -@a = unnamed_addr constant i16 7 -@b = unnamed_addr constant i16 21 -@c = unnamed_addr constant i32 2 -@d = unnamed_addr constant i32 30 - +@a = unnamed_addr constant i16 7, section "var-a:i16" +@b = unnamed_addr constant i16 21, section "var-b:i16" +@c = unnamed_addr constant i32 2, section "var-c:i32" +@d = unnamed_addr constant i32 30, section "var-d:i32" diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index 0e2745257a..99022f7e3c 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -897,7 +897,7 @@ fn by_value_function_arg_structs_are_memcopied() { %S_TY = type { i8, i8 } - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:v" define i32 @foo(%S_TY* %0) section "fn-foo:i32[v]" { entry: @@ -969,8 +969,8 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { %AGGREGATE_COLLECTOR_TY = type { [65537 x i32], [65537 x i8], %S_TY } %S_TY = type { i8, i8 } - @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer + @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer, section "var-__AGGREGATE_COLLECTOR_TY__init:v" + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:v" define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-foo:i32[v]" { entry: @@ -1031,7 +1031,7 @@ fn by_value_fb_arg_aggregates_are_memcopied() { %FOO = type { [65537 x i8], [1024 x i32] } - @__FOO__init = unnamed_addr constant %FOO zeroinitializer + @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-__FOO__init:v" define i32 @main() section "fn-main:i32" { entry: @@ -1121,9 +1121,9 @@ fn var_output_aggregate_types_are_memcopied() { %OUT_TYPE = type { i8 } %PRG = type { %OUT_TYPE, [11 x i32], [11 x %OUT_TYPE], [81 x i8], [81 x i16], %FB } - @__FB__init = unnamed_addr constant %FB zeroinitializer - @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer - @PRG_instance = global %PRG zeroinitializer + @__FB__init = unnamed_addr constant %FB zeroinitializer, section "var-__FB__init:v" + @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer, section "var-__OUT_TYPE__init:v" + @PRG_instance = global %PRG zeroinitializer, section "var-PRG_instance:v" define void @FB(%FB* %0) section "fn-FB:v[v][v][v][s8u81][s16u81]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap index 109b0bd442..39f90d2d94 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap @@ -7,9 +7,9 @@ source_filename = "main" %main = type {} -@gX = global i16 0 -@gY = global i8 0 -@main_instance = global %main zeroinitializer +@gX = global i16 0, section "var-gX:i16" +@gY = global i8 0, section "var-gY:u8" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap index 29682365fe..b5fde29a6b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap @@ -8,8 +8,8 @@ source_filename = "main" %Main = type { %MyStruct } %MyStruct = type { [5 x i16] } -@Main_instance = global %Main zeroinitializer -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" define void @Main(%Main* %0) section "fn-Main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap index e32a4f3098..0b7669df5e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap @@ -9,9 +9,9 @@ source_filename = "main" %OuterStruct = type { %InnerStruct, %InnerStruct } %InnerStruct = type { i16, i16 } -@Main_instance = global %Main zeroinitializer -@__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer -@__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:v" +@__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer, section "var-__OuterStruct__init:v" +@__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer, section "var-__InnerStruct__init:v" define void @Main(%Main* %0) section "fn-Main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap index 112d4e99aa..5a7808a1f9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap index 3f8c29168c..d904f97dcd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap index a3273bd0e9..b211c44700 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [31 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap index 3f8c29168c..d904f97dcd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap index 3f8c29168c..d904f97dcd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap index afcb9daee6..8d526cba33 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [4 x i32] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap index 605324ede9..01cf64c261 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [6 x i32] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap index 6ed961f13e..805d18d8fd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [3 x i32] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap index 3c096b1285..a448d714a5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap @@ -9,9 +9,9 @@ source_filename = "main" %STRUCT1 = type { i16, [5 x %STRUCT2] } %STRUCT2 = type { i8, i32 } -@mainProg_instance = global %mainProg { [5 x %STRUCT1] [%STRUCT1 { i16 1, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 { i16 2, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 256 }, %STRUCT2 { i8 0, i32 2048 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer] } -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer +@mainProg_instance = global %mainProg { [5 x %STRUCT1] [%STRUCT1 { i16 1, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 { i16 2, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 256 }, %STRUCT2 { i8 0, i32 2048 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer] }, section "var-mainProg_instance:v" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:v" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:v" @__mainProg.var_str1__init = unnamed_addr constant [5 x %STRUCT1] [%STRUCT1 { i16 1, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 { i16 2, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 256 }, %STRUCT2 { i8 0, i32 2048 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer] define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap index 671390a36a..e82cd0917c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap @@ -9,9 +9,9 @@ source_filename = "main" %STRUCT1 = type { i16, [11 x %STRUCT2] } %STRUCT2 = type { i8, i32 } -@mainProg_instance = global %mainProg { %STRUCT1 { i16 10, [11 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] } } -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer +@mainProg_instance = global %mainProg { %STRUCT1 { i16 10, [11 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] } }, section "var-mainProg_instance:v" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:v" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:v" @__mainProg.var_str1__init = unnamed_addr constant %STRUCT1 { i16 10, [11 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] } define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap index 6057650a3a..e7684f026a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_are_generated.snap @@ -1,11 +1,9 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@x = global [10 x i16] zeroinitializer -@y = global [6 x float] zeroinitializer - +@x = global [10 x i16] zeroinitializer, section "var-x:v" +@y = global [6 x float] zeroinitializer, section "var-y:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_with_global_const_size_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_with_global_const_size_are_generated.snap index d03111f3e6..d415094ef2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_with_global_const_size_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__arrays_with_global_const_size_are_generated.snap @@ -1,18 +1,15 @@ --- source: src/codegen/tests/code_gen_tests.rs -assertion_line: 1989 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@THREE = unnamed_addr constant i16 3 -@ZERO = unnamed_addr constant i16 0 -@LEN = unnamed_addr constant i16 9 -@x = global [10 x i16] zeroinitializer -@y = global [11 x i32] zeroinitializer -@z = global [19 x i8] zeroinitializer -@zz = global [100 x i8] zeroinitializer -@zzz = global [10 x [8 x i8]] zeroinitializer - +@THREE = unnamed_addr constant i16 3, section "var-THREE:i16" +@ZERO = unnamed_addr constant i16 0, section "var-ZERO:i16" +@LEN = unnamed_addr constant i16 9, section "var-LEN:i16" +@x = global [10 x i16] zeroinitializer, section "var-x:v" +@y = global [11 x i32] zeroinitializer, section "var-y:v" +@z = global [19 x i8] zeroinitializer, section "var-z:v" +@zz = global [100 x i8] zeroinitializer, section "var-zz:v" +@zzz = global [10 x [8 x i8]] zeroinitializer, section "var-zzz:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__basic_datatypes_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__basic_datatypes_generated.snap index bfa2c32641..904d0d6ffe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__basic_datatypes_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__basic_datatypes_generated.snap @@ -1,23 +1,20 @@ --- source: src/codegen/tests/code_gen_tests.rs -assertion_line: 2224 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@bool_1 = global i8 0 -@byte_2 = global i8 0 -@sint_3 = global i8 0 -@usint_4 = global i8 0 -@word_5 = global i16 0 -@int_6 = global i16 0 -@uint_7 = global i16 0 -@dword_8 = global i32 0 -@dint_9 = global i32 0 -@udint_10 = global i32 0 -@lword_11 = global i64 0 -@lint_12 = global i64 0 -@ulint_13 = global i64 0 - +@bool_1 = global i8 0, section "var-bool_1:u8" +@byte_2 = global i8 0, section "var-byte_2:u8" +@sint_3 = global i8 0, section "var-sint_3:i8" +@usint_4 = global i8 0, section "var-usint_4:u8" +@word_5 = global i16 0, section "var-word_5:u16" +@int_6 = global i16 0, section "var-int_6:i16" +@uint_7 = global i16 0, section "var-uint_7:u16" +@dword_8 = global i32 0, section "var-dword_8:u32" +@dint_9 = global i32 0, section "var-dint_9:i32" +@udint_10 = global i32 0, section "var-udint_10:u32" +@lword_11 = global i64 0, section "var-lword_11:u64" +@lint_12 = global i64 0, section "var-lint_12:i64" +@ulint_13 = global i64 0, section "var-ulint_13:u64" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap index e527800ea1..224773eb70 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap @@ -5,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@FORWARD = unnamed_addr constant i32 7 -@UP = unnamed_addr constant i32 8 -@DOWN = unnamed_addr constant i32 15 +@FORWARD = unnamed_addr constant i32 7, section "var-FORWARD:i32" +@UP = unnamed_addr constant i32 8, section "var-UP:i32" +@DOWN = unnamed_addr constant i32 15, section "var-DOWN:i32" define i32 @drive() section "fn-drive:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap index 5588e2370f..6c3c76bf44 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap @@ -5,10 +5,10 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@BASE = unnamed_addr constant i32 7 -@Direction.FORWARD = unnamed_addr constant i32 7 -@Direction.UP = unnamed_addr constant i32 8 -@Direction.DOWN = unnamed_addr constant i32 28 +@BASE = unnamed_addr constant i32 7, section "var-BASE:i32" +@Direction.FORWARD = unnamed_addr constant i32 7, section "var-FORWARD:v" +@Direction.UP = unnamed_addr constant i32 8, section "var-UP:v" +@Direction.DOWN = unnamed_addr constant i32 28, section "var-DOWN:v" define i32 @drive() section "fn-drive:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap index 7520920060..7a2d169008 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap index 58fe060d19..847e44b515 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap index b84a0b5054..72c809cde4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap index 55408b7bd8..8a99fdab2a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap index e7a4f21bb4..8e610ce9a3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap index 3a57568ae3..4f8a269f2f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap index 2468140ebe..66a6076d05 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap index 846e5eedf5..1ac3a679b5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap index 90e7973690..aa7d5adcda 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap @@ -8,7 +8,7 @@ source_filename = "main" %MyClass = type { i16, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:v" define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap index 3c0ea0e41c..09a0ce8494 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap @@ -9,8 +9,8 @@ source_filename = "main" %prg = type { %MyClass, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -@prg_instance = global %prg zeroinitializer +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap index 9ad5dd85ed..6c81c6b042 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, [10 x i16], [10 x i16*], [10 x i16]* } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap index 1942b71c28..579aa492ba 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap @@ -7,7 +7,7 @@ source_filename = "main" %fbWithConstant = type { i16, i16 } -@__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 } +@__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 }, section "var-__fbWithConstant__init:v" define void @fbWithConstant(%fbWithConstant* %0) section "fn-fbWithConstant:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap index a018dd2f69..28b4f07ee5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap @@ -7,8 +7,8 @@ source_filename = "main" %prg = type { i16 } -@MIN = unnamed_addr constant i16 7 -@prg_instance = global %prg zeroinitializer +@MIN = unnamed_addr constant i16 7, section "var-MIN:i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap index 5e0d5cda0c..a070a3a8e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap @@ -7,8 +7,8 @@ source_filename = "main" %STRUCT1 = type { i32 } -@MyStruct = unnamed_addr constant %STRUCT1 { i32 99 } -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer +@MyStruct = unnamed_addr constant %STRUCT1 { i32 99 }, section "var-MyStruct:v" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:v" define i32 @main() section "fn-main:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap index f922abe416..992ba3b9e3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32 } -@main_instance = global %main { i32 0, i32 60 } +@main_instance = global %main { i32 0, i32 60 }, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap index 9c46fc7bee..946a4a5571 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap @@ -7,23 +7,23 @@ source_filename = "main" %main = type {} -@cT = unnamed_addr constant i64 1000000000 -@cT_SHORT = unnamed_addr constant i64 1000000000 -@cLT = unnamed_addr constant i64 1000000000000 -@cLT_SHORT = unnamed_addr constant i64 1000000000000 -@cD = unnamed_addr constant i64 0 -@cD_SHORT = unnamed_addr constant i64 161308800000000000 -@cLD = unnamed_addr constant i64 161308800000000000 -@cLD_SHORT = unnamed_addr constant i64 161308800000000000 -@cTOD = unnamed_addr constant i64 0 -@cTOD_SHORT = unnamed_addr constant i64 0 -@cLTOD = unnamed_addr constant i64 86399999999999 -@cLTOD_SHORT = unnamed_addr constant i64 86399999999999 -@cDT = unnamed_addr constant i64 172799000000000 -@cDT_SHORT = unnamed_addr constant i64 172799000000000 -@cLDT = unnamed_addr constant i64 172799123000000 -@cLDT_SHORT = unnamed_addr constant i64 172799123000000 -@main_instance = global %main zeroinitializer +@cT = unnamed_addr constant i64 1000000000, section "var-cT:i64" +@cT_SHORT = unnamed_addr constant i64 1000000000, section "var-cT_SHORT:i64" +@cLT = unnamed_addr constant i64 1000000000000, section "var-cLT:i64" +@cLT_SHORT = unnamed_addr constant i64 1000000000000, section "var-cLT_SHORT:i64" +@cD = unnamed_addr constant i64 0, section "var-cD:i64" +@cD_SHORT = unnamed_addr constant i64 161308800000000000, section "var-cD_SHORT:i64" +@cLD = unnamed_addr constant i64 161308800000000000, section "var-cLD:i64" +@cLD_SHORT = unnamed_addr constant i64 161308800000000000, section "var-cLD_SHORT:i64" +@cTOD = unnamed_addr constant i64 0, section "var-cTOD:i64" +@cTOD_SHORT = unnamed_addr constant i64 0, section "var-cTOD_SHORT:i64" +@cLTOD = unnamed_addr constant i64 86399999999999, section "var-cLTOD:i64" +@cLTOD_SHORT = unnamed_addr constant i64 86399999999999, section "var-cLTOD_SHORT:i64" +@cDT = unnamed_addr constant i64 172799000000000, section "var-cDT:i64" +@cDT_SHORT = unnamed_addr constant i64 172799000000000, section "var-cDT_SHORT:i64" +@cLDT = unnamed_addr constant i64 172799123000000, section "var-cLDT:i64" +@cLDT_SHORT = unnamed_addr constant i64 172799123000000, section "var-cLDT_SHORT:i64" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap index b8f8ee1f3d..ba1197e20a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap index 714f7af589..5b3ec7d4ba 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16, i32 } -@prg_instance = global %prg { i16 0, i16 1, i32 2 } +@prg_instance = global %prg { i16 0, i16 1, i32 2 }, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap index 687716fc30..ec20c50f5a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap index 8518c00c82..66f8e99d2a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap index 8e502d81c9..e8aec06d46 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap index aa2572299d..2d3211324f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap @@ -7,10 +7,10 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer -@MyEnum.red = unnamed_addr constant i32 0 -@MyEnum.yellow = unnamed_addr constant i32 1 -@MyEnum.green = unnamed_addr constant i32 2 +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@MyEnum.red = unnamed_addr constant i32 0, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i32 2, section "var-green:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_are_generated.snap index 0abe1ca826..647b058535 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_are_generated.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i32 0 -@MyEnum.red = unnamed_addr constant i32 0 -@MyEnum.yellow = unnamed_addr constant i32 1 -@MyEnum.green = unnamed_addr constant i32 2 +@x = global i32 0, section "var-x:v" +@MyEnum.red = unnamed_addr constant i32 0, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i32 2, section "var-green:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap index e0d826b451..b4bf2f72b3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap @@ -7,11 +7,11 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer -@TrafficLight.White = unnamed_addr constant i32 0 -@TrafficLight.Red = unnamed_addr constant i32 1 -@TrafficLight.Yellow = unnamed_addr constant i32 2 -@TrafficLight.Green = unnamed_addr constant i32 3 +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@TrafficLight.White = unnamed_addr constant i32 0, section "var-White:v" +@TrafficLight.Red = unnamed_addr constant i32 1, section "var-Red:v" +@TrafficLight.Yellow = unnamed_addr constant i32 2, section "var-Yellow:v" +@TrafficLight.Green = unnamed_addr constant i32 3, section "var-Green:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__expression_list_as_array_initilization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__expression_list_as_array_initilization.snap index 74e64e517a..cea8e93594 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__expression_list_as_array_initilization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__expression_list_as_array_initilization.snap @@ -1,13 +1,10 @@ --- source: src/codegen/tests/code_gen_tests.rs -assertion_line: 2719 expression: result - --- ; ModuleID = 'main' source_filename = "main" -@arr = global [4 x i16] [i16 1, i16 2, i16 3, i16 0] -@b_exp = global [5 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0] -@str = global [3 x [81 x i8]] [[81 x i8] c"first\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\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", [81 x i8] c"second\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\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", [81 x i8] zeroinitializer] - +@arr = global [4 x i16] [i16 1, i16 2, i16 3, i16 0], section "var-arr:v" +@b_exp = global [5 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0], section "var-b_exp:v" +@str = global [3 x [81 x i8]] [[81 x i8] c"first\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\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", [81 x i8] c"second\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\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", [81 x i8] zeroinitializer], section "var-str:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap index cccc8d51d2..32b97e6a6c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" declare i32 @foo() section "fn-foo:i32" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap index f1e2407e55..c758e511fa 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap @@ -7,9 +7,9 @@ source_filename = "main" %main = type {} -@gX = external global i16 -@gY = external global i8 -@main_instance = global %main zeroinitializer +@gX = external global i16, section "var-gX:i16" +@gY = external global i8, section "var-gY:u8" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap index 36e7bbb9af..16868bff70 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap @@ -7,6 +7,6 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = external global %prg +@prg_instance = external global %prg, section "var-prg_instance:v" declare void @prg(%prg*) section "fn-prg:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap index 3c0ea0e41c..09a0ce8494 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap @@ -9,8 +9,8 @@ source_filename = "main" %prg = type { %MyClass, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -@prg_instance = global %prg zeroinitializer +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap index 9158760cb7..a6abd6d3ca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap index 5f74508138..5af170e92c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap index a1c90f3e7b..11841d6f87 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap index fb9981f1ee..7fcb763bf1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap index d818614e18..13dfc6a4c4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap index 5b3736b042..ddafb0720d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap index 57bce3d6c1..2a48ebe922 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap index 8453989932..9aa5a4ab85 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap index 5d3fac126f..ca30b8320f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap index 005f6caf77..3d563d6337 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i16, i16 } %prg = type { %foo } -@__foo__init = unnamed_addr constant %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[i16][i16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap index 0b86c010d7..b96816ef8f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap @@ -9,9 +9,9 @@ source_filename = "main" %bar = type {} %prg = type { %foo } -@__foo__init = unnamed_addr constant %foo zeroinitializer -@__bar__init = unnamed_addr constant %bar zeroinitializer -@prg_instance = global %prg zeroinitializer +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:v" +@__bar__init = unnamed_addr constant %bar zeroinitializer, section "var-__bar__init:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap index efd50eb79d..fe859851d6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i64 @TIME() section "fn-TIME:i64" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap index e93b371d6b..6d325566f4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo() section "fn-foo:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap index d799007060..2e459bfef3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo() section "fn-foo:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap index e64407254d..82da9a43f1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap index 502da9643c..07e09ae604 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap index 25d554785c..29d534651e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap index c2071bde99..d76c0047f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @foo(i32 %0, i8 %1) section "fn-foo:i32[i32][u8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap index a86223b3fd..210223b212 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap @@ -7,8 +7,8 @@ source_filename = "main" %prg = type { i16 } -@gX = global i16 0 -@prg_instance = global %prg zeroinitializer +@gX = global i16 0, section "var-gX:i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap index 98ed4b0730..f9cddf4300 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32, i32, i32, i8, i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap index e65bc548b9..faa729d015 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap index b12b4c415c..c81742ec6d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap index 4871a67eca..d62aabbf1e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_enums_are_generated.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i32 0 -@__global_x.red = unnamed_addr constant i32 0 -@__global_x.yellow = unnamed_addr constant i32 1 -@__global_x.green = unnamed_addr constant i32 2 +@x = global i32 0, section "var-x:v" +@__global_x.red = unnamed_addr constant i32 0, section "var-red:v" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:v" +@__global_x.green = unnamed_addr constant i32 2, section "var-green:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap index 342b6acc44..45e507a435 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inline_structs_are_generated.snap @@ -7,6 +7,5 @@ source_filename = "main" %__global_x = type { i32, i32 } -@x = global %__global_x zeroinitializer -@____global_x__init = unnamed_addr constant %__global_x zeroinitializer - +@x = global %__global_x zeroinitializer, section "var-x:v" +@____global_x__init = unnamed_addr constant %__global_x zeroinitializer, section "var-____global_x__init:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap index cd41db2ea3..9a6d576a47 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap @@ -7,10 +7,10 @@ source_filename = "main" %aaa = type { i16, i16, [5 x i8], [3 x i8] } -@a = unnamed_addr constant i16 0 -@b = unnamed_addr constant i16 2 -@c = unnamed_addr constant i16 5 -@aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer } +@a = unnamed_addr constant i16 0, section "var-a:i16" +@b = unnamed_addr constant i16 2, section "var-b:i16" +@c = unnamed_addr constant i16 5, section "var-c:i16" +@aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer }, section "var-aaa_instance:v" define void @aaa(%aaa* %0) section "fn-aaa:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap index f0efdafb33..0d6facb11e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap @@ -8,7 +8,7 @@ source_filename = "main" %MyClass = type {} %MyClass.testMethod = type { i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:v" define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap index 66f3b579fe..39680edf7a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap @@ -8,7 +8,7 @@ source_filename = "main" %MyClass = type {} %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:v" define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap index adab6e978b..c830b6219b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { float, float, double, double } -@main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF } +@main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF }, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap index b53601e5bb..c7fe776470 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [8 x i32] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap index bf62574403..f9fb3913e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [6 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap index c64ea74009..4eccd3299c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [4 x [2 x i32]] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap index 7f655ad893..b78d13f280 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16, i16, i16, [125 x i32] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap index a742dd204b..370df99d56 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16, i16, i16, [125 x i32] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap index da38870f59..a00527b422 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [3 x [2 x i16]] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap index 2b7d27f1de..80f14aa14e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @bar() section "fn-bar:i32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap index 97a090218c..f63b04e325 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap index 8e51541321..bc6ef42e23 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap @@ -9,9 +9,9 @@ source_filename = "main" %foo = type { i32* } %prg = type { i32 } -@foo2_instance = global %foo2 zeroinitializer -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo2_instance = global %foo2 zeroinitializer, section "var-foo2_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo2(%foo2* %0) section "fn-foo2:v[pi32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap index 3f57f25b8d..2bb37784a5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8*, i8* } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap index 560393369b..c816607801 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type {} %prg = type {} -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap index e361bbf28c..c06c88c7ed 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap index 56448021c1..bbe38ca83a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap index c003aa7969..5f60119b4b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap index 4cb7a5f58a..94f41ef783 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %mainPROG = type { i8, i16 } -@mainPROG_instance = global %mainPROG zeroinitializer +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-mainPROG_instance:v" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"B\00" @utf16_literal_0 = private unnamed_addr constant [2 x i16] [i16 65, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap index a4c73f6983..b9cc155b92 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap @@ -7,7 +7,7 @@ source_filename = "main" %mainPROG = type { i8, i16 } -@mainPROG_instance = global %mainPROG zeroinitializer +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-mainPROG_instance:v" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c" \00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"a\00" @utf16_literal_0 = private unnamed_addr constant [2 x i16] [i16 32, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap index 8bbb51edf7..d5b4c9e78d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap index 0ce71bca5b..fea90adb3d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap index 9b6672b871..8cccf01f2e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap index b5460fdea6..33b8e8d5c5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i16 } %prg = type {} -@foo_instance = global %foo { i16 7 } -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo { i16 7 }, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap index 6e14b94318..39484794b0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap index a3a65b3cae..ae89278889 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap index 7f36c86224..246faf2ff7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap index ad31cb1492..2ec898b86d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap index dff1485346..f9f0af42c6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, float, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap index 07eb3ab779..64e34c494e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap index 314b9c196d..742b197551 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap index e6fb6122b9..ed93a327f7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap index 4f24fceac1..966eebf603 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i8], [81 x i16], [81 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [19 x i8] c"\0043 $\22no replace$\22\00" @utf08_literal_1 = private unnamed_addr constant [41 x i8] c"a\0A\0A b\0A\0A c\0C\0C d\0D\0D e\09\09 $ 'single' W\F0\9F\92\96\F0\9F\92\96\00" @utf16_literal_0 = private unnamed_addr constant [19 x i16] [i16 36, i16 52, i16 51, i16 32, i16 36, i16 39, i16 110, i16 111, i16 32, i16 114, i16 101, i16 112, i16 108, i16 97, i16 99, i16 101, i16 36, i16 39, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap index 2e9650b3f9..fcc84444fc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf16_literal_0 = private unnamed_addr constant [18 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 117, i16 116, i16 102, i16 49, i16 54, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap index eefda5d4f5..20d7b23148 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap index 0e15ee7c80..73b59829c1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap index bbbe108555..e58c7b03b5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type {} -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap index e12d9f1dad..21c26aa540 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type {} -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap index ccaeba9880..9ce9a29a66 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i32* } %prg = type { i32 } -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap index ffb7db7441..7f865906c2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type { i8 } -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap index ffb7db7441..7f865906c2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type { i8 } -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap index e97814a1ea..95dd021991 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap index 059fb28466..0a9e308cdc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap index d87b270482..4f9b87ff07 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap index b168459828..f6eb9e2915 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap index 82bb93e563..b6fcf23a6a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap index 8e502d81c9..e8aec06d46 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap index b7ddb4a0a7..bbfc899e40 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap index aec25fbc6f..dd6a561a3d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap index bce25d5413..2e3dc2726a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %bar = type { %fb } %fb = type { i32 } -@bar_instance = global %bar zeroinitializer -@__fb__init = unnamed_addr constant %fb zeroinitializer +@bar_instance = global %bar zeroinitializer, section "var-bar_instance:v" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" define void @bar(%bar* %0) section "fn-bar:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap index 6f41a49428..eeb19565d0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap @@ -8,8 +8,8 @@ source_filename = "main" %bar = type {} %prg = type { i32 } -@bar_instance = global %bar zeroinitializer -@prg_instance = global %prg zeroinitializer +@bar_instance = global %bar zeroinitializer, section "var-bar_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @bar(%bar* %0) section "fn-bar:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap index 1671c4d327..62f570c3ec 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap index 80252a1d47..1122991393 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define float @foo() section "fn-foo:f32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap index f058d9cf68..2865d3ee7c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap @@ -9,9 +9,9 @@ source_filename = "main" %foo = type { i32, i32, %fb } %prg = type { i32 } -@__fb__init = unnamed_addr constant %fb zeroinitializer -@foo_instance = global %foo zeroinitializer -@prg_instance = global %prg zeroinitializer +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @fb(%fb* %0) section "fn-fb:v[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap index 1a0c976fbb..36cedc9a82 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap @@ -9,15 +9,15 @@ source_filename = "main" %prog = type { %STRUCT_params*, %STRUCT_params* } %main = type {} -@global1 = global %STRUCT_params zeroinitializer -@__STRUCT_params__init = unnamed_addr constant %STRUCT_params zeroinitializer -@global2 = global %STRUCT_params zeroinitializer -@global3 = global %STRUCT_params zeroinitializer -@global4 = global i32 0 -@global5 = global [81 x i8] zeroinitializer -@global6 = global float 0.000000e+00 -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@global1 = global %STRUCT_params zeroinitializer, section "var-global1:v" +@__STRUCT_params__init = unnamed_addr constant %STRUCT_params zeroinitializer, section "var-__STRUCT_params__init:v" +@global2 = global %STRUCT_params zeroinitializer, section "var-global2:v" +@global3 = global %STRUCT_params zeroinitializer, section "var-global3:v" +@global4 = global i32 0, section "var-global4:i32" +@global5 = global [81 x i8] zeroinitializer, section "var-global5:s8u81" +@global6 = global float 0.000000e+00, section "var-global6:f32" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[pv][pv]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap index 7412e36a42..6854c1b39b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap index ae484e44b4..2e2de34c9d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap @@ -7,7 +7,7 @@ source_filename = "main" %abcdef = type { i8 } -@__abcdef__init = unnamed_addr constant %abcdef zeroinitializer +@__abcdef__init = unnamed_addr constant %abcdef zeroinitializer, section "var-__abcdef__init:v" define void @abcdef(%abcdef* %0) section "fn-abcdef:v[i8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap index 8786736fca..c3c6f880e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap index a6e5948dee..fecc1370f3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_are_generated.snap index ca1fd4ce42..cb3d6bf2b3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_are_generated.snap @@ -8,8 +8,7 @@ source_filename = "main" %MyStruct = type { i32, i16 } %__global_y = type { i8, i8 } -@x = global %MyStruct zeroinitializer -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -@y = global %__global_y zeroinitializer -@____global_y__init = unnamed_addr constant %__global_y zeroinitializer - +@x = global %MyStruct zeroinitializer, section "var-x:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@y = global %__global_y zeroinitializer, section "var-y:v" +@____global_y__init = unnamed_addr constant %__global_y zeroinitializer, section "var-____global_y__init:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap index 4333aaab90..4e7e457154 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap @@ -8,8 +8,8 @@ source_filename = "main" %MainProg = type { %MyStruct } %MyStruct = type { i32, i32 } -@MainProg_instance = global %MainProg zeroinitializer -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer +@MainProg_instance = global %MainProg zeroinitializer, section "var-MainProg_instance:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" define void @MainProg(%MainProg* %0) section "fn-MainProg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap index ed77c405c0..2148629e2e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i8, i8, i8, i16, i16, i16, i32, i32, i64, i64 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) section "fn-CheckRangeSigned:i32[i32][i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap index b0a81bb92d..e9ef6db4be 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap @@ -7,7 +7,7 @@ source_filename = "main" %Main = type { i16 } -@Main_instance = global %Main zeroinitializer +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:v" define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) section "fn-Check_XX_RangeSigned:i16[i16][i16][i16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap index 2b4de87c62..650199f450 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap @@ -7,7 +7,7 @@ source_filename = "main" %Main = type { i16 } -@Main_instance = global %Main zeroinitializer +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:v" define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap index fdfbf91e84..b14d1efc02 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap index dc394dd957..91b8c1d6d2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap @@ -7,10 +7,10 @@ source_filename = "main" %main = type {} -@gX = global i16 0 -@gY = global i8 0 -@gA = global i16 0 -@main_instance = global %main zeroinitializer +@gX = global i16 0, section "var-gX:i16" +@gY = global i8 0, section "var-gY:u8" +@gA = global i16 0, section "var-gA:i16" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_generated.snap index dd20ce1e35..22236a29d8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_generated.snap @@ -5,15 +5,15 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i8 0 -@y = global i16 0 -@z = global i32 0 -@MyEnum.red = unnamed_addr constant i8 0 -@MyEnum.yellow = unnamed_addr constant i8 1 -@MyEnum.green = unnamed_addr constant i8 2 -@MyEnum2.red = unnamed_addr constant i16 0 -@MyEnum2.yellow = unnamed_addr constant i16 1 -@MyEnum2.green = unnamed_addr constant i16 2 -@MyEnum3.red = unnamed_addr constant i32 0 -@MyEnum3.yellow = unnamed_addr constant i32 1 -@MyEnum3.green = unnamed_addr constant i32 2 +@x = global i8 0, section "var-x:v" +@y = global i16 0, section "var-y:v" +@z = global i32 0, section "var-z:v" +@MyEnum.red = unnamed_addr constant i8 0, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i8 1, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i8 2, section "var-green:v" +@MyEnum2.red = unnamed_addr constant i16 0, section "var-red:v" +@MyEnum2.yellow = unnamed_addr constant i16 1, section "var-yellow:v" +@MyEnum2.green = unnamed_addr constant i16 2, section "var-green:v" +@MyEnum3.red = unnamed_addr constant i32 0, section "var-red:v" +@MyEnum3.yellow = unnamed_addr constant i32 1, section "var-yellow:v" +@MyEnum3.green = unnamed_addr constant i32 2, section "var-green:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap index 57ad6134cb..ce2fd10fb4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap @@ -7,16 +7,16 @@ source_filename = "main" %prg = type { i8, i16, i32 } -@prg_instance = global %prg zeroinitializer -@MyEnum.red = unnamed_addr constant i8 5 -@MyEnum.yellow = unnamed_addr constant i8 6 -@MyEnum.green = unnamed_addr constant i8 7 -@MyEnum2.red = unnamed_addr constant i16 15 -@MyEnum2.yellow = unnamed_addr constant i16 16 -@MyEnum2.green = unnamed_addr constant i16 17 -@MyEnum3.red = unnamed_addr constant i32 25 -@MyEnum3.yellow = unnamed_addr constant i32 26 -@MyEnum3.green = unnamed_addr constant i32 27 +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@MyEnum.red = unnamed_addr constant i8 5, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i8 6, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i8 7, section "var-green:v" +@MyEnum2.red = unnamed_addr constant i16 15, section "var-red:v" +@MyEnum2.yellow = unnamed_addr constant i16 16, section "var-yellow:v" +@MyEnum2.green = unnamed_addr constant i16 17, section "var-green:v" +@MyEnum3.red = unnamed_addr constant i32 25, section "var-red:v" +@MyEnum3.yellow = unnamed_addr constant i32 26, section "var-yellow:v" +@MyEnum3.green = unnamed_addr constant i32 27, section "var-green:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_initializers_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_initializers_are_generated.snap index 14f10de461..8431d9f966 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_initializers_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_initializers_are_generated.snap @@ -5,15 +5,15 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i8 0 -@y = global i16 0 -@z = global i32 0 -@MyEnum.red = unnamed_addr constant i8 1 -@MyEnum.yellow = unnamed_addr constant i8 2 -@MyEnum.green = unnamed_addr constant i8 3 -@MyEnum2.red = unnamed_addr constant i16 10 -@MyEnum2.yellow = unnamed_addr constant i16 11 -@MyEnum2.green = unnamed_addr constant i16 12 -@MyEnum3.red = unnamed_addr constant i32 22 -@MyEnum3.yellow = unnamed_addr constant i32 33 -@MyEnum3.green = unnamed_addr constant i32 44 +@x = global i8 0, section "var-x:v" +@y = global i16 0, section "var-y:v" +@z = global i32 0, section "var-z:v" +@MyEnum.red = unnamed_addr constant i8 1, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i8 2, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i8 3, section "var-green:v" +@MyEnum2.red = unnamed_addr constant i16 10, section "var-red:v" +@MyEnum2.yellow = unnamed_addr constant i16 11, section "var-yellow:v" +@MyEnum2.green = unnamed_addr constant i16 12, section "var-green:v" +@MyEnum3.red = unnamed_addr constant i32 22, section "var-red:v" +@MyEnum3.yellow = unnamed_addr constant i32 33, section "var-yellow:v" +@MyEnum3.green = unnamed_addr constant i32 44, section "var-green:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_partly_initializers_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_partly_initializers_are_generated.snap index a6f7759b1d..4cf179a5d0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_partly_initializers_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_with_partly_initializers_are_generated.snap @@ -5,15 +5,15 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@twenty = unnamed_addr constant i16 20 -@x = global i8 0 -@MyEnum.red = unnamed_addr constant i8 7 -@MyEnum.yellow = unnamed_addr constant i8 8 -@MyEnum.green = unnamed_addr constant i8 9 -@MyEnum2.a = unnamed_addr constant i8 0 -@MyEnum2.b = unnamed_addr constant i8 1 -@MyEnum2.c = unnamed_addr constant i8 7 -@MyEnum2.d = unnamed_addr constant i8 8 -@MyEnum2.e = unnamed_addr constant i8 9 -@MyEnum2.f = unnamed_addr constant i8 20 -@MyEnum2.g = unnamed_addr constant i8 21 +@twenty = unnamed_addr constant i16 20, section "var-twenty:i16" +@x = global i8 0, section "var-x:v" +@MyEnum.red = unnamed_addr constant i8 7, section "var-red:v" +@MyEnum.yellow = unnamed_addr constant i8 8, section "var-yellow:v" +@MyEnum.green = unnamed_addr constant i8 9, section "var-green:v" +@MyEnum2.a = unnamed_addr constant i8 0, section "var-a:v" +@MyEnum2.b = unnamed_addr constant i8 1, section "var-b:v" +@MyEnum2.c = unnamed_addr constant i8 7, section "var-c:v" +@MyEnum2.d = unnamed_addr constant i8 8, section "var-d:v" +@MyEnum2.e = unnamed_addr constant i8 9, section "var-e:v" +@MyEnum2.f = unnamed_addr constant i8 20, section "var-f:v" +@MyEnum2.g = unnamed_addr constant i8 21, section "var-g:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap index 8272ecf6de..15527837e9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [14 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap index fda711bc8d..e3dace6f49 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap @@ -7,9 +7,9 @@ source_filename = "main" %prg = type { i16 } -@CONST = global i16 7 -@MIN = global i16 7 -@prg_instance = global %prg zeroinitializer +@CONST = global i16 7, section "var-CONST:i16" +@MIN = global i16 7, section "var-MIN:i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap index 92306c19a0..47c9a60953 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap @@ -7,10 +7,10 @@ source_filename = "main" %prg = type { i32 } -@cA = unnamed_addr constant i16 1 -@cB = unnamed_addr constant i16 2 -@cC = unnamed_addr constant i16 3 -@prg_instance = global %prg zeroinitializer +@cA = unnamed_addr constant i16 1, section "var-cA:i16" +@cB = unnamed_addr constant i16 2, section "var-cB:i16" +@cC = unnamed_addr constant i16 3, section "var-cC:i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap index 244c5340ae..5017a0cb63 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap @@ -7,7 +7,7 @@ source_filename = "main" %prog = type { i64 } -@prog_instance = global %prog zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" define i64 @func() section "fn-func:i64" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap index 35f2497d9a..4991a22782 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap index fb30b7ee89..dc8b34ad26 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap index 3619b8afd0..55ec760895 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap index 33b062d4cf..dd70b3d707 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i64, i64, i64, i64 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap index 30f7cd9e8a..e6a8ff09fb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { float*, i16, i32, float, double, i8, i16, i32, i64, i8, i16, i32, i64 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define float @foo() section "fn-foo:f32" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap index 09104ad5ec..7f1a63acca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16*, i16, i32, i8, i16, i32, i64, i8, i16, i32, i64 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i64 @foo() section "fn-foo:i64" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap index b528b61404..8c253b338b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16, i16, i16*, i8 } -@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 } +@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 }, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap index 71ab97bb9d..b6723ad329 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16*, i16, i8 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i64 @foo() section "fn-foo:i64" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap index 6ab566dc67..2883b8f331 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap @@ -7,8 +7,8 @@ source_filename = "main" %main = type { [4 x i16] } -@const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4] -@main_instance = global %main zeroinitializer +@const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4], section "var-const_arr:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap index 98e3e4218a..5e5b107187 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap @@ -7,8 +7,8 @@ source_filename = "main" %main = type { [81 x i8] } -@const_str = unnamed_addr constant [81 x i8] c"global constant string\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" -@main_instance = global %main zeroinitializer +@const_str = unnamed_addr constant [81 x i8] c"global constant string\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", section "var-const_str:s8u81" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap index 1504e0742f..14e257a166 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap @@ -8,9 +8,9 @@ source_filename = "main" %Point = type { i16, i16 } %main = type { %Point } -@const_strct = unnamed_addr constant %Point { i16 1, i16 2 } -@__Point__init = unnamed_addr constant %Point zeroinitializer -@main_instance = global %main zeroinitializer +@const_strct = unnamed_addr constant %Point { i16 1, i16 2 }, section "var-const_strct:v" +@__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__dwarf_version_override.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__dwarf_version_override.snap index 97f35d7d5a..fd970898c0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__dwarf_version_override.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__dwarf_version_override.snap @@ -5,7 +5,7 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@gInt = global i32 0, !dbg !0 +@gInt = global i32 0, section "var-gInt:i32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -19,4 +19,3 @@ source_filename = "main" !6 = !{i32 2, !"Debug Info Version", i32 3} !7 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false) !8 = !{!0} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_alias_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_alias_type.snap index f768c755d4..d5ada2b6fe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_alias_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_alias_type.snap @@ -5,7 +5,7 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@gInt = global i32 0, !dbg !0 +@gInt = global i32 0, section "var-gInt:i32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -19,4 +19,3 @@ source_filename = "main" !6 = !{i32 2, !"Debug Info Version", i32 3} !7 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false) !8 = !{!0} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_array_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_array_added_to_debug_info.snap index bc8939baec..6cffe50f33 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_array_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_array_added_to_debug_info.snap @@ -5,9 +5,9 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global [11 x i32] zeroinitializer, !dbg !0 -@b = global [110 x i32] zeroinitializer, !dbg !7 -@c = global [11 x [10 x i32]] zeroinitializer, !dbg !12 +@a = global [11 x i32] zeroinitializer, section "var-a:v", !dbg !0 +@b = global [110 x i32] zeroinitializer, section "var-b:v", !dbg !7 +@c = global [11 x [10 x i32]] zeroinitializer, section "var-c:v", !dbg !12 !llvm.module.flags = !{!17, !18} !llvm.dbg.cu = !{!19} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_byteseq_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_byteseq_added_to_debug_info.snap index c3bcfd9c53..b76a363b7f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_byteseq_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_byteseq_added_to_debug_info.snap @@ -5,11 +5,11 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global i8 0, !dbg !0 -@b = global i8 0, !dbg !4 -@c = global i16 0, !dbg !7 -@d = global i32 0, !dbg !10 -@e = global i64 0, !dbg !13 +@a = global i8 0, section "var-a:u8", !dbg !0 +@b = global i8 0, section "var-b:u8", !dbg !4 +@c = global i16 0, section "var-c:u16", !dbg !7 +@d = global i32 0, section "var-d:u32", !dbg !10 +@e = global i64 0, section "var-e:u64", !dbg !13 !llvm.module.flags = !{!16, !17} !llvm.dbg.cu = !{!18} @@ -34,4 +34,3 @@ source_filename = "main" !17 = !{i32 2, !"Debug Info Version", i32 3} !18 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !19, splitDebugInlining: false) !19 = !{!0, !4, !7, !10, !13} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_enum_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_enum_added_to_debug_info.snap index f2e51fc23c..30c8ed22bc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_enum_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_enum_added_to_debug_info.snap @@ -5,16 +5,16 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@en3 = global i64 0, !dbg !0 -@en1.a = unnamed_addr constant i32 0, !dbg !5 -@en1.b = unnamed_addr constant i32 1, !dbg !9 -@en1.c = unnamed_addr constant i32 2, !dbg !11 -@en2.d = unnamed_addr constant i8 0, !dbg !13 -@en2.e = unnamed_addr constant i8 1, !dbg !17 -@en2.f = unnamed_addr constant i8 2, !dbg !19 -@__global_en3.a = unnamed_addr constant i64 0, !dbg !21 -@__global_en3.b = unnamed_addr constant i64 1, !dbg !23 -@__global_en3.c = unnamed_addr constant i64 2, !dbg !25 +@en3 = global i64 0, section "var-en3:v", !dbg !0 +@en1.a = unnamed_addr constant i32 0, section "var-a:v", !dbg !5 +@en1.b = unnamed_addr constant i32 1, section "var-b:v", !dbg !9 +@en1.c = unnamed_addr constant i32 2, section "var-c:v", !dbg !11 +@en2.d = unnamed_addr constant i8 0, section "var-d:v", !dbg !13 +@en2.e = unnamed_addr constant i8 1, section "var-e:v", !dbg !17 +@en2.f = unnamed_addr constant i8 2, section "var-f:v", !dbg !19 +@__global_en3.a = unnamed_addr constant i64 0, section "var-a:v", !dbg !21 +@__global_en3.b = unnamed_addr constant i64 1, section "var-b:v", !dbg !23 +@__global_en3.c = unnamed_addr constant i64 2, section "var-c:v", !dbg !25 !llvm.module.flags = !{!27, !28} !llvm.dbg.cu = !{!29} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_float_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_float_added_to_debug_info.snap index 3072a3a70e..66516a5731 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_float_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_float_added_to_debug_info.snap @@ -5,8 +5,8 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global float 0.000000e+00, !dbg !0 -@b = global double 0.000000e+00, !dbg !4 +@a = global float 0.000000e+00, section "var-a:f32", !dbg !0 +@b = global double 0.000000e+00, section "var-b:f64", !dbg !4 !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} @@ -22,4 +22,3 @@ source_filename = "main" !8 = !{i32 2, !"Debug Info Version", i32 3} !9 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !10, splitDebugInlining: false) !10 = !{!0, !4} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_int_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_int_added_to_debug_info.snap index ef994f3a9e..49401e2564 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_int_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_int_added_to_debug_info.snap @@ -5,14 +5,14 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global i8 0, !dbg !0 -@b = global i8 0, !dbg !4 -@c = global i16 0, !dbg !7 -@d = global i16 0, !dbg !10 -@e = global i32 0, !dbg !13 -@f = global i32 0, !dbg !16 -@g = global i64 0, !dbg !19 -@h = global i64 0, !dbg !22 +@a = global i8 0, section "var-a:i8", !dbg !0 +@b = global i8 0, section "var-b:u8", !dbg !4 +@c = global i16 0, section "var-c:i16", !dbg !7 +@d = global i16 0, section "var-d:u16", !dbg !10 +@e = global i32 0, section "var-e:i32", !dbg !13 +@f = global i32 0, section "var-f:u32", !dbg !16 +@g = global i64 0, section "var-g:i64", !dbg !19 +@h = global i64 0, section "var-h:u64", !dbg !22 !llvm.module.flags = !{!25, !26} !llvm.dbg.cu = !{!27} @@ -46,4 +46,3 @@ source_filename = "main" !26 = !{i32 2, !"Debug Info Version", i32 3} !27 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !28, splitDebugInlining: false) !28 = !{!0, !4, !7, !10, !13, !16, !19, !22} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap index 77a450c403..35c9255e19 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap @@ -8,9 +8,9 @@ source_filename = "main" %myStruct = type { i32, %myStruct2 } %myStruct2 = type { i32, double } -@gStruct = global %myStruct zeroinitializer, !dbg !0 -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !13 -@__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, !dbg !15 +@gStruct = global %myStruct zeroinitializer, section "var-gStruct:v", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v", !dbg !13 +@__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, section "var-__myStruct2__init:v", !dbg !15 !llvm.module.flags = !{!17, !18} !llvm.dbg.cu = !{!19} @@ -36,4 +36,3 @@ source_filename = "main" !18 = !{i32 2, !"Debug Info Version", i32 3} !19 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !20, splitDebugInlining: false) !20 = !{!0, !13, !15} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap index 627648ab04..14397d0fda 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap @@ -5,7 +5,7 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global i32* null, !dbg !0 +@a = global i32* null, section "var-a:pi32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -19,4 +19,3 @@ source_filename = "main" !6 = !{i32 2, !"Debug Info Version", i32 3} !7 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false) !8 = !{!0} - diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_string_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_string_added_to_debug_info.snap index eb898b7e82..5187ca6c16 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_string_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_string_added_to_debug_info.snap @@ -5,8 +5,8 @@ expression: codegen ; ModuleID = 'main' source_filename = "main" -@a = global [81 x i8] zeroinitializer, !dbg !0 -@b = global [81 x i16] zeroinitializer, !dbg !7 +@a = global [81 x i8] zeroinitializer, section "var-a:s8u81", !dbg !0 +@b = global [81 x i16] zeroinitializer, section "var-b:s16u81", !dbg !7 !llvm.module.flags = !{!11, !12} !llvm.dbg.cu = !{!13} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap index e4da745f10..acfca65649 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap @@ -7,9 +7,9 @@ source_filename = "main" %myStruct = type { i32, double, [11 x i32] } -@gStruct = global %myStruct zeroinitializer, !dbg !0 -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !13 -@b = global [11 x %myStruct] zeroinitializer, !dbg !15 +@gStruct = global %myStruct zeroinitializer, section "var-gStruct:v", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v", !dbg !13 +@b = global [11 x %myStruct] zeroinitializer, section "var-b:v", !dbg !15 !llvm.module.flags = !{!18, !19} !llvm.dbg.cu = !{!20} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap index 18595e7268..852b8bbcc3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %myStruct = type { i8 } -@__myStruct__init = unnamed_addr constant %myStruct { i8 1 } +@__myStruct__init = unnamed_addr constant %myStruct { i8 1 }, section "var-__myStruct__init:v" define i16 @main() section "fn-main:i16" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap index 68a042fcf5..8365d18676 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap @@ -7,7 +7,7 @@ source_filename = "main" %baz = type { [11 x i8], i8*, [10 x i8]* } -@baz_instance = global %baz zeroinitializer +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:v" define void @baz(%baz* %0) section "fn-baz:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap index 32fb59a6dc..1fb7467225 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16, [2 x i16], i16*, [2 x i16]* } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_adr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_adr.snap index 8f00ddfb91..8d924769bd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_adr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_adr.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32*, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_lower_bound.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_lower_bound.snap index aa7a2bb241..4b4e671304 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_lower_bound.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_lower_bound.snap @@ -8,8 +8,8 @@ source_filename = "main" %main = type { [2 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@main_instance = global %main zeroinitializer -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_move.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_move.snap index 5d0484af4b..a01ca57d25 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_move.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_move.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap index 27229cc276..d993b2a874 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap index 75f90dd458..14d9e59034 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"dolor\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"ipsum\00" @utf08_literal_2 = private unnamed_addr constant [6 x i8] c"lorem\00" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_ref.snap index 43033311c3..57cb4c4bfc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_ref.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32*, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel.snap index df8babe7d6..4d28c4bfe1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap index 367c4cb9f0..df881a2995 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sizeof.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sizeof.snap index f4f198abfd..4f2697c148 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sizeof.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sizeof.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i64 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound.snap index fd899f8f69..5b8b790aaf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound.snap @@ -8,8 +8,8 @@ source_filename = "main" %main = type { [2 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@main_instance = global %main zeroinitializer -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap index 36f5e9ee4d..fae443b0e1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap @@ -8,9 +8,9 @@ source_filename = "main" %main = type { [16 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@MY_CONST = unnamed_addr constant i32 10 -@main_instance = global %main zeroinitializer -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@MY_CONST = unnamed_addr constant i32 10, section "var-MY_CONST:i32" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap index 491ea33572..2474067f63 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" define void @func([81 x i8]* %0) section "fn-func:s8u81" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap index 934a893e2b..a6576b99ad 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %baz = type { i8*, i16 } -@baz_instance = global %baz zeroinitializer +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:v" define void @baz(%baz* %0) section "fn-baz:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap index 3599d8dfc1..0f29f527dc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_assign_codegen.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_assign_codegen.snap index 5c9db0d473..50ce6556e2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_assign_codegen.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_assign_codegen.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_codegen.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_codegen.snap index 8aaf65c189..11f8d11c27 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_codegen.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__hardware_access_codegen.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap index 702898de62..8a9f1e2af2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap index 66d17c646b..8b71bf56b3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16, i16, i16* } -@main_instance = global %main { i16 10, i16 20, i16* null } +@main_instance = global %main { i16 10, i16 20, i16* null }, section "var-main_instance:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap index f402dd6314..312813a759 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16*, i16 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i64 @foo() section "fn-foo:i64" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap index 87dce219e8..f2fbd7f269 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap @@ -7,7 +7,7 @@ source_filename = "main" %myStruct = type { i16 } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" define void @func(%myStruct* %0, %myStruct* %1) section "fn-func:v[pv]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap index b0d68fe813..ad58df9992 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap index 1c78aafcc1..cb4fcae29d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap @@ -7,7 +7,7 @@ source_filename = "main" %baz = type { i8*, i8, i8, i8 } -@baz_instance = global %baz zeroinitializer +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:v" define void @baz(%baz* %0) section "fn-baz:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap index 760a8ba1dc..8e55a24c6a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @func(i8* %0, i16* %1, i32* %2, i64* %3, float* %4, double* %5) section "fn-func:i32[pi8][pi16][pi32][pi64][pf32][pf64]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap index 7eeed6da58..9eae4a3172 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i8, i8, i16, i16, i32, i32, i64, i64, float, float, double, double } -@main_instance = global %main { i8 1, i8 1, i16 2, i16 2, i32 3, i32 3, i64 4, i64 4, float 5.000000e+00, float 5.000000e+00, double 6.000000e+00, double 6.000000e+00 } +@main_instance = global %main { i8 1, i8 1, i16 2, i16 2, i32 3, i32 3, i64 4, i64 4, float 5.000000e+00, float 5.000000e+00, double 6.000000e+00, double 6.000000e+00 }, section "var-main_instance:v" define i8 @fn_sint(i8* %0, i8* %1) section "fn-fn_sint:i8[pi8][pi8]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap index c83905fbf9..5427d5b246 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [4 x i8] c"abc\00" @utf08_literal_2 = private unnamed_addr constant [7 x i8] c"abcdef\00" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap index 6908aaecc3..78ccdde51d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" declare i32 @foo(i32, i32*) section "fn-foo:i32" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap index 7e7b60961e..c65db915e6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" declare i32 @foo(...) section "fn-foo:i32" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap index 5d3bad001d..60a625e8a9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" declare void @func([81 x i8]*, i8*) section "fn-func:s8u81[ps8u81]" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap index 1411ca6172..df13425d9b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [6 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" define i32 @func(i8* %0) section "fn-func:i32[s8u6]" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap index 2bd5e485a1..ae3be6cc10 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [6 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" define i32 @func(i8* %0) section "fn-func:i32[ps8u6]" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap index 3bb606f590..c8b71d1ec1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) section "fn-func:i32[pi16][pi32][i16][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap index 2355a116c6..707a9b3525 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @func(i32 %0) section "fn-func:i32[i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap index 7babfb5043..74f1e520d6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i16 } -@main_instance = global %main { i16 4 } +@main_instance = global %main { i16 4 }, section "var-main_instance:v" define i32 @func(i16* %0) section "fn-func:i32[pi16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap index f4cd2fde23..ecbe9bd12a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, float, float, double, float, float, float, double } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define float @foo__REAL(float %0) section "fn-foo__REAL:f32[f32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap index 06744fe4a5..9c2ad044df 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i32 @MAX__DINT(i32 %0, i32 %1) section "fn-MAX__DINT:i32[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap index f0b16563c7..538862dbde 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define i16 @foo__INT(i64 %0, i16* %1) section "fn-foo__INT:i16[i64][pi16]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap index 41c47d74c2..1e6033b615 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap @@ -7,7 +7,7 @@ source_filename = "myStruct.st" %myStruct = type { i32, i16* } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" ; ModuleID = 'prog.st' source_filename = "prog.st" @@ -15,8 +15,8 @@ source_filename = "prog.st" %prog = type { %myStruct.1 } %myStruct.1 = type { i32, i16* } -@prog_instance = global %prog zeroinitializer -@__myStruct__init = external global %myStruct.1 +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@__myStruct__init = external global %myStruct.1, section "var-__myStruct__init:v" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap index 65414424ad..ec27b63904 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap @@ -7,14 +7,14 @@ source_filename = "myStruct.st" %myStruct = type { i32, i16* } -@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null } +@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null }, section "var-__myStruct__init:v" ; ModuleID = 'prog.st' source_filename = "prog.st" %prog = type { i32 } -@prog_instance = global %prog zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap index 6c5e306f9d..a7d14c05d1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap @@ -10,7 +10,7 @@ source_filename = "prog.st" %prog = type { i16 } -@prog_instance = global %prog { i16 5 } +@prog_instance = global %prog { i16 5 }, section "var-prog_instance:v" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap index 0868c261e6..fde171e602 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap @@ -5,16 +5,16 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'myEnum.st' source_filename = "myEnum.st" -@myEnum.a = unnamed_addr constant i32 1 -@myEnum.b = unnamed_addr constant i32 2 -@myEnum.c = unnamed_addr constant i32 3 +@myEnum.a = unnamed_addr constant i32 1, section "var-a:v" +@myEnum.b = unnamed_addr constant i32 2, section "var-b:v" +@myEnum.c = unnamed_addr constant i32 3, section "var-c:v" ; ModuleID = 'fb.st' source_filename = "fb.st" %fb = type { i32 } -@__fb__init = unnamed_addr constant %fb zeroinitializer +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" define void @fb(%fb* %0) section "fn-fb:v" { entry: @@ -28,8 +28,8 @@ source_filename = "myStruct.st" %myStruct = type { %fb.2 } %fb.2 = type { i32 } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer -@__fb__init = external global %fb.2 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" +@__fb__init = external global %fb.2, section "var-__fb__init:v" declare void @fb(%fb.2*) section "fn-fb:v" @@ -40,9 +40,9 @@ source_filename = "fb2.st" %myStruct.4 = type { %fb.5 } %fb.5 = type { i32 } -@__fb2__init = unnamed_addr constant %fb2 zeroinitializer -@__myStruct__init = external global %myStruct.4 -@__fb__init = external global %fb.5 +@__fb2__init = unnamed_addr constant %fb2 zeroinitializer, section "var-__fb2__init:v" +@__myStruct__init = external global %myStruct.4, section "var-__myStruct__init:v" +@__fb__init = external global %fb.5, section "var-__fb__init:v" define void @fb2(%fb2* %0) section "fn-fb2:v" { entry: @@ -57,7 +57,7 @@ source_filename = "fb3.st" %fb3 = type {} -@__fb3__init = unnamed_addr constant %fb3 zeroinitializer +@__fb3__init = unnamed_addr constant %fb3 zeroinitializer, section "var-__fb3__init:v" define void @fb3(%fb3* %0) section "fn-fb3:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap index d25ccf90a3..3140940c5c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap @@ -18,7 +18,7 @@ source_filename = "fb.st" %fb = type {} -@__fb__init = unnamed_addr constant %fb zeroinitializer +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" define void @fb(%fb* %0) section "fn-fb:v" { entry: @@ -30,7 +30,7 @@ source_filename = "prg.st" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: @@ -43,7 +43,7 @@ source_filename = "prg2.st" %prg2 = type { i32 } -@prg2_instance = global %prg2 zeroinitializer +@prg2_instance = global %prg2 zeroinitializer, section "var-prg2_instance:v" define void @prg2(%prg2* %0) section "fn-prg2:v" { entry: @@ -59,10 +59,10 @@ source_filename = "prog.st" %prg.5 = type { i32 } %prg2.6 = type { i32 } -@prog_instance = global %prog zeroinitializer -@__fb__init = external global %fb.4 -@prg_instance = external global %prg.5 -@prg2_instance = external global %prg2.6 +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@__fb__init = external global %fb.4, section "var-__fb__init:v" +@prg_instance = external global %prg.5, section "var-prg_instance:v" +@prg2_instance = external global %prg2.6, section "var-prg2_instance:v" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap index 9742323315..d45dd7fb2d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap @@ -5,26 +5,26 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'g1.st' source_filename = "g1.st" -@x = global i32 6 -@d = external global i32 -@y = global i32 7 -@e = external global i32 +@x = global i32 6, section "var-x:i32" +@d = external global i32, section "var-d:i32" +@y = global i32 7, section "var-y:i32" +@e = external global i32, section "var-e:i32" ; ModuleID = 'g2.st' source_filename = "g2.st" -@c = unnamed_addr constant i32 5 -@d = unnamed_addr constant i32 6 -@e = unnamed_addr constant i32 7 +@c = unnamed_addr constant i32 5, section "var-c:i32" +@d = unnamed_addr constant i32 6, section "var-d:i32" +@e = unnamed_addr constant i32 7, section "var-e:i32" ; ModuleID = 'prog.st' source_filename = "prog.st" %prog = type {} -@prog_instance = global %prog zeroinitializer -@c = external global i32 -@x = external global i32 +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@c = external global i32, section "var-c:i32" +@x = external global i32, section "var-x:i32" define void @prog(%prog* %0) section "fn-prog:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap index 08f55ab4cd..6ecf811475 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap @@ -7,14 +7,14 @@ source_filename = "myStruct.st" %myStruct = type { i32, i16 } -@__myStruct__init = unnamed_addr constant %myStruct { i32 6, i16 2 } +@__myStruct__init = unnamed_addr constant %myStruct { i32 6, i16 2 }, section "var-__myStruct__init:v" ; ModuleID = 'myStruct2.st' source_filename = "myStruct2.st" %myStruct2 = type { i32, i16 } -@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 } +@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 }, section "var-__myStruct2__init:v" ; ModuleID = 'prog.st' source_filename = "prog.st" @@ -23,9 +23,9 @@ source_filename = "prog.st" %myStruct.2 = type { i32, i16 } %myStruct2.3 = type { i32, i16 } -@prog_instance = global %prog { %myStruct.2 { i32 5, i16 2 }, %myStruct2.3 { i32 6, i16 2 } } -@__myStruct__init = external global %myStruct.2 -@__myStruct2__init = external global %myStruct2.3 +@prog_instance = global %prog { %myStruct.2 { i32 5, i16 2 }, %myStruct2.3 { i32 6, i16 2 } }, section "var-prog_instance:v" +@__myStruct__init = external global %myStruct.2, section "var-__myStruct__init:v" +@__myStruct2__init = external global %myStruct2.3, section "var-__myStruct2__init:v" @__prog.x__init = unnamed_addr constant %myStruct.2 { i32 5, i16 2 } define void @prog(%prog* %0) section "fn-prog:v" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap index 9f0a262497..8aa2ef52d2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap @@ -8,8 +8,8 @@ source_filename = "main" %fb_t = type { i32, i32 } %main = type { %fb_t } -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer -@main_instance = global %main zeroinitializer +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @fb_t(%fb_t* %0) section "fn-fb_t:v[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap index a6cfbe4ab1..d203962ab0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap @@ -8,8 +8,8 @@ source_filename = "main" %fb_t = type { i32, i32 } %main = type { %fb_t, i32 } -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer -@main_instance = global %main zeroinitializer +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @fb_t(%fb_t* %0) section "fn-fb_t:v[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap index 39324edd55..79faff54bf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @foo(i32 %0, i32 %1) section "fn-foo:v[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap index 52e8f828de..f5f85480ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @foo(i32* %0, i32* %1) section "fn-foo:v[pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap index 094ab12b37..ad19dbff8e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap index bfc66e6526..152ae2b777 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) section "fn-foo:i32[i32][pi32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap index 1e544425ee..ca59b0dffc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap index b57f573c60..ba4da1bbdb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap index ea03ab08ec..a75139b5ab 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap index 0aa2e8f342..b0eba6e62d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap index 1e544425ee..ca59b0dffc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap index b57f573c60..ba4da1bbdb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap index 4401729c25..f15f075d3b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap index ea03ab08ec..a75139b5ab 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap index 0aa2e8f342..b0eba6e62d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap index 185a060f5b..dd36b72451 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap @@ -8,8 +8,8 @@ source_filename = "main" %main = type { %file_t, %file_t* } %file_t = type { i8, i8 } -@main_instance = global %main zeroinitializer -@__file_t__init = unnamed_addr constant %file_t zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-__file_t__init:v" define void @main(%main* %0) section "fn-main:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap index 31f71c8838..bb3a04b207 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32 } %main = type {} -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap index 093ab00e9f..f8f06b81d0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32 } %main = type { i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap index 1dd9d67c12..28081ea3bf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap index 35d2ffb07a..39f9ee1290 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap index 5754af5b20..40d149c5ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap index ebae600179..3ca8523346 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap index 87d98a0641..3a1552ea87 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap index ec2c998881..46abbbe981 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap @@ -8,8 +8,8 @@ source_filename = "main" %mainProg = type { %fb_t, i8, i8 } %fb_t = type { i8, i8, i8*, i8, i8* } -@mainProg_instance = global %mainProg zeroinitializer -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:v" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:v" define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap index a339d326d6..1962aca319 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap index 607a355c17..550e84edf2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap index 8c93248cf2..0bd1ef0850 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap index 53c5974e89..2752af52dd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap index 66581e4437..4e0c92574f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8, i16, i16 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap index 846ec42e0b..4649fd564a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap index c22cb17223..eabb2fc255 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" @utf16_literal_0 = private unnamed_addr constant [4 x i16] [i16 97, i16 98, i16 99, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap index 196004e2c0..4be8d97e52 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [61 x i8], [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" define void @MID__STRING([81 x i8]* %0, i8* %1, i32 %2, i32 %3) section "fn-MID__STRING:s8u81[ps8u81][i32][i32]" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap index 4662182279..d6f51b8c4a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" define void @ret([81 x i8]* %0) section "fn-ret:s8u81" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap index f6f317c2fd..c4eca647fb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [154 x i8] c"abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc\00" define void @read_string([81 x i8]* %0, i8* %1) section "fn-read_string:s8u81[s8u81]" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__nested_struct_initialization_of_multi_dim_string_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__nested_struct_initialization_of_multi_dim_string_arrays.snap index 3a44ecd3b0..a6cca9e6c2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__nested_struct_initialization_of_multi_dim_string_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__nested_struct_initialization_of_multi_dim_string_arrays.snap @@ -7,6 +7,5 @@ source_filename = "main" %CONSTANTS_LANGUAGE = type { i16, i16, [21 x [11 x i8]], [21 x [3 x i8]], [36 x [11 x i8]], [36 x [4 x i8]], [48 x [4 x i8]] } -@x = global %CONSTANTS_LANGUAGE { i16 1, i16 3, [21 x [11 x i8]] [[11 x i8] c"Monday\00\00\00\00\00", [11 x i8] c"Tuesday\00\00\00\00", [11 x i8] c"Wednesday\00\00", [11 x i8] c"Thursday\00\00\00", [11 x i8] c"Friday\00\00\00\00\00", [11 x i8] c"Saturday\00\00\00", [11 x i8] c"Sunday\00\00\00\00\00", [11 x i8] c"Montag\00\00\00\00\00", [11 x i8] c"Dienstag\00\00\00", [11 x i8] c"Mittwoch\00\00\00", [11 x i8] c"Donnerstag\00", [11 x i8] c"Freitag\00\00\00\00", [11 x i8] c"Samstag\00\00\00\00", [11 x i8] c"Sonntag\00\00\00\00", [11 x i8] c"Lundi\00\00\00\00\00\00", [11 x i8] c"Mardi\00\00\00\00\00\00", [11 x i8] c"Mercredi\00\00\00", [11 x i8] c"Jeudi\00\00\00\00\00\00", [11 x i8] c"Vendredi\00\00\00", [11 x i8] c"Samedi\00\00\00\00\00", [11 x i8] c"Dimanche\00\00\00"], [21 x [3 x i8]] [[3 x i8] c"Mo\00", [3 x i8] c"Tu\00", [3 x i8] c"We\00", [3 x i8] c"Th\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"Su\00", [3 x i8] c"Mo\00", [3 x i8] c"Di\00", [3 x i8] c"Mi\00", [3 x i8] c"Do\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"So\00", [3 x i8] c"Lu\00", [3 x i8] c"Ma\00", [3 x i8] c"Me\00", [3 x i8] c"Je\00", [3 x i8] c"Ve\00", [3 x i8] c"Sa\00", [3 x i8] c"Di\00"], [36 x [11 x i8]] [[11 x i8] c"January\00\00\00\00", [11 x i8] c"February\00\00\00", [11 x i8] c"March\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"May\00\00\00\00\00\00\00\00", [11 x i8] c"June\00\00\00\00\00\00\00", [11 x i8] c"July\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"October\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"December\00\00\00", [11 x i8] c"Januar\00\00\00\00\00", [11 x i8] c"Februar\00\00\00\00", [11 x i8] c"M\C3\A4rz\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juni\00\00\00\00\00\00\00", [11 x i8] c"Juli\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"Oktober\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"Dezember\00\00\00", [11 x i8] c"Janvier\00\00\00\00", [11 x i8] c"F\C3\A9vrier\00\00\00", [11 x i8] c"mars\00\00\00\00\00\00\00", [11 x i8] c"Avril\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juin\00\00\00\00\00\00\00", [11 x i8] c"Juillet\00\00\00\00", [11 x i8] c"Ao\C3\BBt\00\00\00\00\00\00", [11 x i8] c"Septembre\00\00", [11 x i8] c"Octobre\00\00\00\00", [11 x i8] c"Novembre\00\00\00", [11 x i8] c"Decembre\00\00\00"], [36 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mar\00", [4 x i8] c"Apr\00", [4 x i8] c"May\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00", [4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mrz\00", [4 x i8] c"Apr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Okt\00", [4 x i8] c"Nov\00", [4 x i8] c"Dez\00", [4 x i8] c"Jan\00", [4 x i8] c"Fev\00", [4 x i8] c"Mar\00", [4 x i8] c"Avr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aou\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00"], [48 x [4 x i8]] [[4 x i8] c"N\00\00\00", [4 x i8] c"NNE\00", [4 x i8] c"NE\00\00", [4 x i8] c"ENE\00", [4 x i8] c"E\00\00\00", [4 x i8] c"ESE\00", [4 x i8] c"SE\00\00", [4 x i8] c"SSE\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00"] } -@__CONSTANTS_LANGUAGE__init = unnamed_addr constant %CONSTANTS_LANGUAGE { i16 1, i16 3, [21 x [11 x i8]] [[11 x i8] c"Monday\00\00\00\00\00", [11 x i8] c"Tuesday\00\00\00\00", [11 x i8] c"Wednesday\00\00", [11 x i8] c"Thursday\00\00\00", [11 x i8] c"Friday\00\00\00\00\00", [11 x i8] c"Saturday\00\00\00", [11 x i8] c"Sunday\00\00\00\00\00", [11 x i8] c"Montag\00\00\00\00\00", [11 x i8] c"Dienstag\00\00\00", [11 x i8] c"Mittwoch\00\00\00", [11 x i8] c"Donnerstag\00", [11 x i8] c"Freitag\00\00\00\00", [11 x i8] c"Samstag\00\00\00\00", [11 x i8] c"Sonntag\00\00\00\00", [11 x i8] c"Lundi\00\00\00\00\00\00", [11 x i8] c"Mardi\00\00\00\00\00\00", [11 x i8] c"Mercredi\00\00\00", [11 x i8] c"Jeudi\00\00\00\00\00\00", [11 x i8] c"Vendredi\00\00\00", [11 x i8] c"Samedi\00\00\00\00\00", [11 x i8] c"Dimanche\00\00\00"], [21 x [3 x i8]] [[3 x i8] c"Mo\00", [3 x i8] c"Tu\00", [3 x i8] c"We\00", [3 x i8] c"Th\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"Su\00", [3 x i8] c"Mo\00", [3 x i8] c"Di\00", [3 x i8] c"Mi\00", [3 x i8] c"Do\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"So\00", [3 x i8] c"Lu\00", [3 x i8] c"Ma\00", [3 x i8] c"Me\00", [3 x i8] c"Je\00", [3 x i8] c"Ve\00", [3 x i8] c"Sa\00", [3 x i8] c"Di\00"], [36 x [11 x i8]] [[11 x i8] c"January\00\00\00\00", [11 x i8] c"February\00\00\00", [11 x i8] c"March\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"May\00\00\00\00\00\00\00\00", [11 x i8] c"June\00\00\00\00\00\00\00", [11 x i8] c"July\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"October\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"December\00\00\00", [11 x i8] c"Januar\00\00\00\00\00", [11 x i8] c"Februar\00\00\00\00", [11 x i8] c"M\C3\A4rz\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juni\00\00\00\00\00\00\00", [11 x i8] c"Juli\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"Oktober\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"Dezember\00\00\00", [11 x i8] c"Janvier\00\00\00\00", [11 x i8] c"F\C3\A9vrier\00\00\00", [11 x i8] c"mars\00\00\00\00\00\00\00", [11 x i8] c"Avril\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juin\00\00\00\00\00\00\00", [11 x i8] c"Juillet\00\00\00\00", [11 x i8] c"Ao\C3\BBt\00\00\00\00\00\00", [11 x i8] c"Septembre\00\00", [11 x i8] c"Octobre\00\00\00\00", [11 x i8] c"Novembre\00\00\00", [11 x i8] c"Decembre\00\00\00"], [36 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mar\00", [4 x i8] c"Apr\00", [4 x i8] c"May\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00", [4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mrz\00", [4 x i8] c"Apr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Okt\00", [4 x i8] c"Nov\00", [4 x i8] c"Dez\00", [4 x i8] c"Jan\00", [4 x i8] c"Fev\00", [4 x i8] c"Mar\00", [4 x i8] c"Avr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aou\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00"], [48 x [4 x i8]] [[4 x i8] c"N\00\00\00", [4 x i8] c"NNE\00", [4 x i8] c"NE\00\00", [4 x i8] c"ENE\00", [4 x i8] c"E\00\00\00", [4 x i8] c"ESE\00", [4 x i8] c"SE\00\00", [4 x i8] c"SSE\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00"] } - +@x = global %CONSTANTS_LANGUAGE { i16 1, i16 3, [21 x [11 x i8]] [[11 x i8] c"Monday\00\00\00\00\00", [11 x i8] c"Tuesday\00\00\00\00", [11 x i8] c"Wednesday\00\00", [11 x i8] c"Thursday\00\00\00", [11 x i8] c"Friday\00\00\00\00\00", [11 x i8] c"Saturday\00\00\00", [11 x i8] c"Sunday\00\00\00\00\00", [11 x i8] c"Montag\00\00\00\00\00", [11 x i8] c"Dienstag\00\00\00", [11 x i8] c"Mittwoch\00\00\00", [11 x i8] c"Donnerstag\00", [11 x i8] c"Freitag\00\00\00\00", [11 x i8] c"Samstag\00\00\00\00", [11 x i8] c"Sonntag\00\00\00\00", [11 x i8] c"Lundi\00\00\00\00\00\00", [11 x i8] c"Mardi\00\00\00\00\00\00", [11 x i8] c"Mercredi\00\00\00", [11 x i8] c"Jeudi\00\00\00\00\00\00", [11 x i8] c"Vendredi\00\00\00", [11 x i8] c"Samedi\00\00\00\00\00", [11 x i8] c"Dimanche\00\00\00"], [21 x [3 x i8]] [[3 x i8] c"Mo\00", [3 x i8] c"Tu\00", [3 x i8] c"We\00", [3 x i8] c"Th\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"Su\00", [3 x i8] c"Mo\00", [3 x i8] c"Di\00", [3 x i8] c"Mi\00", [3 x i8] c"Do\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"So\00", [3 x i8] c"Lu\00", [3 x i8] c"Ma\00", [3 x i8] c"Me\00", [3 x i8] c"Je\00", [3 x i8] c"Ve\00", [3 x i8] c"Sa\00", [3 x i8] c"Di\00"], [36 x [11 x i8]] [[11 x i8] c"January\00\00\00\00", [11 x i8] c"February\00\00\00", [11 x i8] c"March\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"May\00\00\00\00\00\00\00\00", [11 x i8] c"June\00\00\00\00\00\00\00", [11 x i8] c"July\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"October\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"December\00\00\00", [11 x i8] c"Januar\00\00\00\00\00", [11 x i8] c"Februar\00\00\00\00", [11 x i8] c"M\C3\A4rz\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juni\00\00\00\00\00\00\00", [11 x i8] c"Juli\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"Oktober\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"Dezember\00\00\00", [11 x i8] c"Janvier\00\00\00\00", [11 x i8] c"F\C3\A9vrier\00\00\00", [11 x i8] c"mars\00\00\00\00\00\00\00", [11 x i8] c"Avril\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juin\00\00\00\00\00\00\00", [11 x i8] c"Juillet\00\00\00\00", [11 x i8] c"Ao\C3\BBt\00\00\00\00\00\00", [11 x i8] c"Septembre\00\00", [11 x i8] c"Octobre\00\00\00\00", [11 x i8] c"Novembre\00\00\00", [11 x i8] c"Decembre\00\00\00"], [36 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mar\00", [4 x i8] c"Apr\00", [4 x i8] c"May\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00", [4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mrz\00", [4 x i8] c"Apr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Okt\00", [4 x i8] c"Nov\00", [4 x i8] c"Dez\00", [4 x i8] c"Jan\00", [4 x i8] c"Fev\00", [4 x i8] c"Mar\00", [4 x i8] c"Avr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aou\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00"], [48 x [4 x i8]] [[4 x i8] c"N\00\00\00", [4 x i8] c"NNE\00", [4 x i8] c"NE\00\00", [4 x i8] c"ENE\00", [4 x i8] c"E\00\00\00", [4 x i8] c"ESE\00", [4 x i8] c"SE\00\00", [4 x i8] c"SSE\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00"] }, section "var-x:v" +@__CONSTANTS_LANGUAGE__init = unnamed_addr constant %CONSTANTS_LANGUAGE { i16 1, i16 3, [21 x [11 x i8]] [[11 x i8] c"Monday\00\00\00\00\00", [11 x i8] c"Tuesday\00\00\00\00", [11 x i8] c"Wednesday\00\00", [11 x i8] c"Thursday\00\00\00", [11 x i8] c"Friday\00\00\00\00\00", [11 x i8] c"Saturday\00\00\00", [11 x i8] c"Sunday\00\00\00\00\00", [11 x i8] c"Montag\00\00\00\00\00", [11 x i8] c"Dienstag\00\00\00", [11 x i8] c"Mittwoch\00\00\00", [11 x i8] c"Donnerstag\00", [11 x i8] c"Freitag\00\00\00\00", [11 x i8] c"Samstag\00\00\00\00", [11 x i8] c"Sonntag\00\00\00\00", [11 x i8] c"Lundi\00\00\00\00\00\00", [11 x i8] c"Mardi\00\00\00\00\00\00", [11 x i8] c"Mercredi\00\00\00", [11 x i8] c"Jeudi\00\00\00\00\00\00", [11 x i8] c"Vendredi\00\00\00", [11 x i8] c"Samedi\00\00\00\00\00", [11 x i8] c"Dimanche\00\00\00"], [21 x [3 x i8]] [[3 x i8] c"Mo\00", [3 x i8] c"Tu\00", [3 x i8] c"We\00", [3 x i8] c"Th\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"Su\00", [3 x i8] c"Mo\00", [3 x i8] c"Di\00", [3 x i8] c"Mi\00", [3 x i8] c"Do\00", [3 x i8] c"Fr\00", [3 x i8] c"Sa\00", [3 x i8] c"So\00", [3 x i8] c"Lu\00", [3 x i8] c"Ma\00", [3 x i8] c"Me\00", [3 x i8] c"Je\00", [3 x i8] c"Ve\00", [3 x i8] c"Sa\00", [3 x i8] c"Di\00"], [36 x [11 x i8]] [[11 x i8] c"January\00\00\00\00", [11 x i8] c"February\00\00\00", [11 x i8] c"March\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"May\00\00\00\00\00\00\00\00", [11 x i8] c"June\00\00\00\00\00\00\00", [11 x i8] c"July\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"October\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"December\00\00\00", [11 x i8] c"Januar\00\00\00\00\00", [11 x i8] c"Februar\00\00\00\00", [11 x i8] c"M\C3\A4rz\00\00\00\00\00\00", [11 x i8] c"April\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juni\00\00\00\00\00\00\00", [11 x i8] c"Juli\00\00\00\00\00\00\00", [11 x i8] c"August\00\00\00\00\00", [11 x i8] c"September\00\00", [11 x i8] c"Oktober\00\00\00\00", [11 x i8] c"November\00\00\00", [11 x i8] c"Dezember\00\00\00", [11 x i8] c"Janvier\00\00\00\00", [11 x i8] c"F\C3\A9vrier\00\00\00", [11 x i8] c"mars\00\00\00\00\00\00\00", [11 x i8] c"Avril\00\00\00\00\00\00", [11 x i8] c"Mai\00\00\00\00\00\00\00\00", [11 x i8] c"Juin\00\00\00\00\00\00\00", [11 x i8] c"Juillet\00\00\00\00", [11 x i8] c"Ao\C3\BBt\00\00\00\00\00\00", [11 x i8] c"Septembre\00\00", [11 x i8] c"Octobre\00\00\00\00", [11 x i8] c"Novembre\00\00\00", [11 x i8] c"Decembre\00\00\00"], [36 x [4 x i8]] [[4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mar\00", [4 x i8] c"Apr\00", [4 x i8] c"May\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00", [4 x i8] c"Jan\00", [4 x i8] c"Feb\00", [4 x i8] c"Mrz\00", [4 x i8] c"Apr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aug\00", [4 x i8] c"Sep\00", [4 x i8] c"Okt\00", [4 x i8] c"Nov\00", [4 x i8] c"Dez\00", [4 x i8] c"Jan\00", [4 x i8] c"Fev\00", [4 x i8] c"Mar\00", [4 x i8] c"Avr\00", [4 x i8] c"Mai\00", [4 x i8] c"Jun\00", [4 x i8] c"Jul\00", [4 x i8] c"Aou\00", [4 x i8] c"Sep\00", [4 x i8] c"Oct\00", [4 x i8] c"Nov\00", [4 x i8] c"Dec\00"], [48 x [4 x i8]] [[4 x i8] c"N\00\00\00", [4 x i8] c"NNE\00", [4 x i8] c"NE\00\00", [4 x i8] c"ENE\00", [4 x i8] c"E\00\00\00", [4 x i8] c"ESE\00", [4 x i8] c"SE\00\00", [4 x i8] c"SSE\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00", [4 x i8] c"N\00\00\00", [4 x i8] c"NNO\00", [4 x i8] c"NO\00\00", [4 x i8] c"ONO\00", [4 x i8] c"O\00\00\00", [4 x i8] c"OSO\00", [4 x i8] c"SO\00\00", [4 x i8] c"SSO\00", [4 x i8] c"S\00\00\00", [4 x i8] c"SSW\00", [4 x i8] c"SW\00\00", [4 x i8] c"WSW\00", [4 x i8] c"W\00\00\00", [4 x i8] c"WNW\00", [4 x i8] c"NW\00\00", [4 x i8] c"NNW\00"] }, section "var-__CONSTANTS_LANGUAGE__init:v" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap index a85faa2de5..b59153d413 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap @@ -8,8 +8,8 @@ source_filename = "main" %prog = type { [81 x i8], [81 x i16] } %main = type { [7 x i8], [8 x i16] } -@prog_instance = global %prog zeroinitializer -@main_instance = global %main zeroinitializer +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @utf08_literal_0 = private unnamed_addr constant [7 x i8] c"string\00" @utf16_literal_0 = private unnamed_addr constant [8 x i16] [i16 119, i16 115, i16 116, i16 114, i16 105, i16 110, i16 103, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap index 3a57950c3b..6cbd7fc906 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf08_literal_1 = private unnamed_addr constant [18 x i8] c"im a utf16 genius\00" @utf16_literal_0 = private unnamed_addr constant [12 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap index bef912eb1d..627034fd44 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap @@ -7,9 +7,9 @@ source_filename = "main" %prg = type { [81 x i8], [100 x i8], [100 x i16] } -@prg_instance = global %prg { [81 x i8] zeroinitializer, [100 x i8] c"abc\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\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\00\00\00\00\00\00\00\00\00\00\00", [100 x i16] [i16 97, i16 98, i16 99, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0] } -@__MyString__init = unnamed_addr constant [100 x i8] c"abc\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\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\00\00\00\00\00\00\00\00\00\00\00" -@__MyWString__init = unnamed_addr constant [100 x i16] [i16 97, i16 98, i16 99, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0] +@prg_instance = global %prg { [81 x i8] zeroinitializer, [100 x i8] c"abc\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\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\00\00\00\00\00\00\00\00\00\00\00", [100 x i16] [i16 97, i16 98, i16 99, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0] }, section "var-prg_instance:v" +@__MyString__init = unnamed_addr constant [100 x i8] c"abc\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\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\00\00\00\00\00\00\00\00\00\00\00", section "var-__MyString__init:s8u100" +@__MyWString__init = unnamed_addr constant [100 x i16] [i16 97, i16 98, i16 99, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0], section "var-__MyWString__init:s16u100" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf08_literal_1 = private unnamed_addr constant [17 x i8] c"im also a genius\00" @utf16_literal_0 = private unnamed_addr constant [17 x i16] [i16 105, i16 109, i16 32, i16 97, i16 108, i16 115, i16 111, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__simple_string_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__simple_string_test.snap index 8b1a844a79..ecc1a0ba4b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__simple_string_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__simple_string_test.snap @@ -1,11 +1,9 @@ --- source: src/codegen/tests/string_tests.rs expression: result - --- ; ModuleID = 'main' source_filename = "main" -@str = global [21 x i8] zeroinitializer -@wstr = global [21 x i16] zeroinitializer - +@str = global [21 x i8] zeroinitializer, section "var-str:s8u21" +@wstr = global [21 x i16] zeroinitializer, section "var-wstr:s16u21" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap index 29b9c8ae6a..dfc49ed44a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [11 x i8], [81 x i8] } -@prg_instance = global %prg { [11 x i8] c"hello\00\00\00\00\00\00", [81 x i8] zeroinitializer } +@prg_instance = global %prg { [11 x i8] c"hello\00\00\00\00\00\00", [81 x i8] zeroinitializer }, section "var-prg_instance:v" @__prg.s__init = unnamed_addr constant [11 x i8] c"hello\00\00\00\00\00\00" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap index 3f72b2b1ff..532fc40edc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [16 x i8], [4 x i8], [16 x i16], [4 x i16] } -@prg_instance = global %prg { [16 x i8] zeroinitializer, [4 x i8] c"xyz\00", [16 x i16] zeroinitializer, [4 x i16] [i16 120, i16 121, i16 122, i16 0] } +@prg_instance = global %prg { [16 x i8] zeroinitializer, [4 x i8] c"xyz\00", [16 x i16] zeroinitializer, [4 x i16] [i16 120, i16 121, i16 122, i16 0] }, section "var-prg_instance:v" @__prg.z__init = unnamed_addr constant [4 x i8] c"xyz\00" @__prg.wz__init = unnamed_addr constant [4 x i16] [i16 120, i16 121, i16 122, i16 0] @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap index 28e7166105..68818d7f20 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap @@ -7,9 +7,9 @@ source_filename = "main" %prg = type { [16 x i8], [4 x i8], [31 x i16], [7 x i16] } -@LONG_STRING = unnamed_addr constant i16 15 -@SHORT_STRING = unnamed_addr constant i16 3 -@prg_instance = global %prg { [16 x i8] zeroinitializer, [4 x i8] c"xyz\00", [31 x i16] zeroinitializer, [7 x i16] [i16 120, i16 121, i16 122, i16 0, i16 0, i16 0, i16 0] } +@LONG_STRING = unnamed_addr constant i16 15, section "var-LONG_STRING:i16" +@SHORT_STRING = unnamed_addr constant i16 3, section "var-SHORT_STRING:i16" +@prg_instance = global %prg { [16 x i8] zeroinitializer, [4 x i8] c"xyz\00", [31 x i16] zeroinitializer, [7 x i16] [i16 120, i16 121, i16 122, i16 0, i16 0, i16 0, i16 0] }, section "var-prg_instance:v" @__prg.z__init = unnamed_addr constant [4 x i8] c"xyz\00" @__prg.wz__init = unnamed_addr constant [7 x i16] [i16 120, i16 121, i16 122, i16 0, i16 0, i16 0, i16 0] @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap index a9d938e499..b81612b04b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { [16 x i8], [31 x i8] } -@prg_instance = global %prg { [16 x i8] zeroinitializer, [31 x i8] c"xyz\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" } +@prg_instance = global %prg { [16 x i8] zeroinitializer, [31 x i8] c"xyz\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" }, section "var-prg_instance:v" @__prg.z__init = unnamed_addr constant [31 x i8] c"xyz\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" define void @prg(%prg* %0) section "fn-prg:v" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap index 4fec55113e..e02ab5480c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @__prg.z__init = unnamed_addr constant [31 x i8] c"xyz\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" define void @prg(%prg* %0) section "fn-prg:v" { diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap index d5c05a4597..93d7424943 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap index 404b889c93..8bd4e92075 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i32, i64, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap index a339a3e731..7326171db8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap index 61e0e8aa0b..3069e39e6f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap index 86ba11023f..27dd9c124d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, double, double } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap index dc8cee115c..72c3d100c1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap index 93ff27bfd5..193f02e9c6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, double } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap index f46afe0841..557265c496 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i16, i16, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap index 261e31be4a..4d106818a4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap index 7f2f3d4114..0d31d3709a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, i64 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap index 70ec202527..abfde7a6e7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { float, i16, float } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap index 6c790a5b78..6406cf00ac 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap @@ -7,7 +7,7 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer +@main_instance = global %main zeroinitializer, section "var-main_instance:v" @__main.s__init = unnamed_addr constant [81 x i8] c"\0A numbers: %f %f %f %d \0A \0A\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\00\00\00\00\00\00\00\00\00\00\00\00" declare i32 @printf(i8*, ...) section "fn-printf:i32[ps8u81]" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap index d7d78e7b45..a165faa323 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap @@ -7,7 +7,7 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap index 4681fafeb1..56cd50baf5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap @@ -7,7 +7,7 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap index 71d8b1c338..d2a52b38ac 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap @@ -7,8 +7,8 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@arr = global [2 x i16] zeroinitializer -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@arr = global [2 x i16] zeroinitializer, section "var-arr:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap index 2c464533af..877a9d7bc4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap @@ -7,7 +7,7 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define void @foo(%__foo_vla* %0) section "fn-foo:v[v]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap index 339ee6d6d3..cb21dea1f6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap @@ -7,7 +7,7 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap index a804f6e089..51da4684b4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap @@ -7,7 +7,7 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { entry: diff --git a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap index 001b53a48d..e664792060 100644 --- a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap +++ b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_enum_variable_default_value_compile_time_evaluation.snap @@ -5,8 +5,8 @@ expression: ir ; ModuleID = 'main' source_filename = "main" -@me = unnamed_addr constant i32 3 -@THREE = unnamed_addr constant i16 3 -@MyEnum.a = unnamed_addr constant i32 3 -@MyEnum.b = unnamed_addr constant i32 4 -@MyEnum.c = unnamed_addr constant i32 5 +@me = unnamed_addr constant i32 3, section "var-me:v" +@THREE = unnamed_addr constant i16 3, section "var-THREE:i16" +@MyEnum.a = unnamed_addr constant i32 3, section "var-a:v" +@MyEnum.b = unnamed_addr constant i32 4, section "var-b:v" +@MyEnum.c = unnamed_addr constant i32 5, section "var-c:v" diff --git a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap index 1ac4ac6da7..f78f2b9eb9 100644 --- a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap +++ b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap @@ -5,12 +5,12 @@ expression: ir ; ModuleID = 'main' source_filename = "main" -@false_bool = unnamed_addr constant i8 0 -@zero_int = unnamed_addr constant i16 0 -@zero_real = unnamed_addr constant double 0.000000e+00 -@empty_string = unnamed_addr constant [81 x i8] zeroinitializer -@null_ptr = unnamed_addr constant i16* null -@zero_enum = unnamed_addr constant i32 0 -@myEnum.a = unnamed_addr constant i32 0 -@myEnum.b = unnamed_addr constant i32 1 -@myEnum.c = unnamed_addr constant i32 2 +@false_bool = unnamed_addr constant i8 0, section "var-false_bool:u8" +@zero_int = unnamed_addr constant i16 0, section "var-zero_int:i16" +@zero_real = unnamed_addr constant double 0.000000e+00, section "var-zero_real:f64" +@empty_string = unnamed_addr constant [81 x i8] zeroinitializer, section "var-empty_string:s8u81" +@null_ptr = unnamed_addr constant i16* null, section "var-null_ptr:pi16" +@zero_enum = unnamed_addr constant i32 0, section "var-zero_enum:v" +@myEnum.a = unnamed_addr constant i32 0, section "var-a:v" +@myEnum.b = unnamed_addr constant i32 1, section "var-b:v" +@myEnum.c = unnamed_addr constant i32 2, section "var-c:v" diff --git a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap index f702fd1b49..1c057cb239 100644 --- a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap +++ b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__default_values_are_transitive_for_range_types.snap @@ -5,9 +5,8 @@ expression: src ; ModuleID = 'main' source_filename = "main" -@a = global i16 7 -@b = global i16 7 -@aa = unnamed_addr constant i16 7 -@bb = unnamed_addr constant i16 7 -@cc = unnamed_addr constant i16 14 - +@a = global i16 7, section "var-a:i16" +@b = global i16 7, section "var-b:v" +@aa = unnamed_addr constant i16 7, section "var-aa:i16" +@bb = unnamed_addr constant i16 7, section "var-bb:v" +@cc = unnamed_addr constant i16 14, section "var-cc:i16" diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index f2bcd2359a..bd716dcedf 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -18,7 +18,7 @@ fn declaring_an_array() { ; ModuleID = 'main' source_filename = "main" - @d = global [10 x i32] zeroinitializer + @d = global [10 x i32] zeroinitializer, section "var-d:v" "###); } @@ -40,8 +40,8 @@ fn initializing_an_array() { ; ModuleID = 'main' source_filename = "main" - @d = global [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] - @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] + @d = global [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], section "var-d:v" + @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], section "var-__Data__init:v" "###); } @@ -70,8 +70,8 @@ fn assigning_full_arrays() { %prg = type { [10 x i32], [10 x i32] } - @prg_instance = global %prg { [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] } - @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] + @prg_instance = global %prg { [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] }, section "var-prg_instance:v" + @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], section "var-__Data__init:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: @@ -122,8 +122,8 @@ fn accessing_array_elements() { %prg = type { [10 x i32], [3 x i32] } - @prg_instance = global %prg { [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], [3 x i32] [i32 3, i32 4, i32 5] } - @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] + @prg_instance = global %prg { [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], [3 x i32] [i32 3, i32 4, i32 5] }, section "var-prg_instance:v" + @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], section "var-__Data__init:v" @__prg.b__init = unnamed_addr constant [3 x i32] [i32 3, i32 4, i32 5] define void @prg(%prg* %0) section "fn-prg:v" { diff --git a/src/tests/adr/enum_adr.rs b/src/tests/adr/enum_adr.rs index 6cca156de8..e1b57a11ae 100644 --- a/src/tests/adr/enum_adr.rs +++ b/src/tests/adr/enum_adr.rs @@ -22,10 +22,10 @@ fn enums_generate_a_global_constants_for_each_element() { ; ModuleID = 'main' source_filename = "main" - @myColor = global i32 0 - @Color.red = unnamed_addr constant i32 0 - @Color.yellow = unnamed_addr constant i32 1 - @Color.green = unnamed_addr constant i32 2 + @myColor = global i32 0, section "var-myColor:v" + @Color.red = unnamed_addr constant i32 0, section "var-red:v" + @Color.yellow = unnamed_addr constant i32 1, section "var-yellow:v" + @Color.green = unnamed_addr constant i32 2, section "var-green:v" "###); } @@ -52,16 +52,16 @@ fn enums_constants_are_automatically_numbered_or_user_defined() { ; ModuleID = 'main' source_filename = "main" - @myColor = global i32 0 - @myState = global i8 0 - @Color.red = unnamed_addr constant i32 1 - @Color.yellow = unnamed_addr constant i32 2 - @Color.green = unnamed_addr constant i32 4 - @Color.blue = unnamed_addr constant i32 8 - @State.open = unnamed_addr constant i8 1 - @State.closed = unnamed_addr constant i8 4 - @State.idle = unnamed_addr constant i8 5 - @State.running = unnamed_addr constant i8 6 + @myColor = global i32 0, section "var-myColor:v" + @myState = global i8 0, section "var-myState:v" + @Color.red = unnamed_addr constant i32 1, section "var-red:v" + @Color.yellow = unnamed_addr constant i32 2, section "var-yellow:v" + @Color.green = unnamed_addr constant i32 4, section "var-green:v" + @Color.blue = unnamed_addr constant i32 8, section "var-blue:v" + @State.open = unnamed_addr constant i8 1, section "var-open:v" + @State.closed = unnamed_addr constant i8 4, section "var-closed:v" + @State.idle = unnamed_addr constant i8 5, section "var-idle:v" + @State.running = unnamed_addr constant i8 6, section "var-running:v" "###); } @@ -80,14 +80,14 @@ fn inline_declaration_of_enum_types() { ; ModuleID = 'main' source_filename = "main" - @frontColor = global i32 0 - @backColor = global i32 0 - @__global_frontColor.red = unnamed_addr constant i32 0 - @__global_frontColor.green = unnamed_addr constant i32 1 - @__global_frontColor.yellow = unnamed_addr constant i32 2 - @__global_backColor.red = unnamed_addr constant i32 0 - @__global_backColor.green = unnamed_addr constant i32 1 - @__global_backColor.yellow = unnamed_addr constant i32 2 + @frontColor = global i32 0, section "var-frontColor:v" + @backColor = global i32 0, section "var-backColor:v" + @__global_frontColor.red = unnamed_addr constant i32 0, section "var-red:v" + @__global_frontColor.green = unnamed_addr constant i32 1, section "var-green:v" + @__global_frontColor.yellow = unnamed_addr constant i32 2, section "var-yellow:v" + @__global_backColor.red = unnamed_addr constant i32 0, section "var-red:v" + @__global_backColor.green = unnamed_addr constant i32 1, section "var-green:v" + @__global_backColor.yellow = unnamed_addr constant i32 2, section "var-yellow:v" "###); } @@ -121,13 +121,13 @@ fn using_enums() { %prg = type { i32, i32, i32 } - @prg_instance = global %prg zeroinitializer - @ProcessState.open = unnamed_addr constant i32 1 - @ProcessState.closed = unnamed_addr constant i32 4 - @ProcessState.idle = unnamed_addr constant i32 5 - @ProcessState.running = unnamed_addr constant i32 6 - @Door.open = unnamed_addr constant i32 8 - @Door.closed = unnamed_addr constant i32 16 + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" + @ProcessState.open = unnamed_addr constant i32 1, section "var-open:v" + @ProcessState.closed = unnamed_addr constant i32 4, section "var-closed:v" + @ProcessState.idle = unnamed_addr constant i32 5, section "var-idle:v" + @ProcessState.running = unnamed_addr constant i32 6, section "var-running:v" + @Door.open = unnamed_addr constant i32 8, section "var-open:v" + @Door.closed = unnamed_addr constant i32 16, section "var-closed:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index 78e8f1359d..e62a1f4cc1 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -233,7 +233,7 @@ fn codegen_of_a_program_pou() { %main_prg = type { i16, i16*, i16, i16 } - @main_prg_instance = global %main_prg zeroinitializer + @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:v" define void @main_prg(%main_prg* %0) section "fn-main_prg:v[i16][pi16][i16]" { entry: @@ -271,7 +271,7 @@ fn calling_a_program() { %main_prg = type { i16, i16*, i16, i16 } - @main_prg_instance = global %main_prg zeroinitializer + @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:v" define i16 @foo() section "fn-foo:i16" { entry: @@ -335,7 +335,7 @@ fn function_blocks_get_a_method_with_a_self_parameter() { %main_fb = type { i16, i16*, i16, i16 } - @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 } + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-__main_fb__init:v" define void @main_fb(%main_fb* %0) section "fn-main_fb:v[i16][pi16][i16]" { entry: @@ -375,8 +375,8 @@ fn calling_a_function_block() { %foo = type { i16, i16, %main_fb } %main_fb = type { i16, i16*, i16, i16 } - @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } } - @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 } + @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } }, section "var-foo_instance:v" + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-__main_fb__init:v" define void @foo(%foo* %0) section "fn-foo:v" { entry: @@ -475,7 +475,7 @@ fn calling_a_function() { %prg = type { i16, i8 } - @prg_instance = global %prg zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: @@ -537,7 +537,7 @@ fn return_a_complex_type_from_function() { %prg = type { [81 x i8] } - @prg_instance = global %prg zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [13 x i8] c"hello world!\00" define void @foo([81 x i8]* %0) section "fn-foo:s8u81" { @@ -620,8 +620,8 @@ fn passing_aggregate_types_to_functions_by_value() { %myStruct = type { i32, i32, i32, [81 x i8] } %main = type { [81 x i8], [81 x i16], [30000 x i32], %myStruct } - @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer - @main_instance = global %main zeroinitializer + @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" + @main_instance = global %main zeroinitializer, section "var-main_instance:v" define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-foo:v[s8u81][s16u81][v][v]" { entry: @@ -705,7 +705,7 @@ fn passing_by_ref_to_functions() { %main = type { [81 x i8], [81 x i8] } - @main_instance = global %main zeroinitializer + @main_instance = global %main zeroinitializer, section "var-main_instance:v" define i8 @StrEqual(i8* %0, i8* %1) section "fn-StrEqual:u8[ps8u81][ps8u81]" { entry: diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index 6a8d00c484..a1ef5000a2 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -18,8 +18,8 @@ fn declaring_a_string() { ; ModuleID = 'main' source_filename = "main" - @myUtf8 = global [21 x i8] zeroinitializer - @myUtf16 = global [21 x i16] zeroinitializer + @myUtf8 = global [21 x i8] zeroinitializer, section "var-myUtf8:s8u21" + @myUtf16 = global [21 x i16] zeroinitializer, section "var-myUtf16:s16u21" "###); } @@ -41,8 +41,8 @@ fn strings_are_terminated_with_0byte() { ; ModuleID = 'main' source_filename = "main" - @myUtf8 = global [6 x i8] c"Hello\00" - @myUtf16 = global [6 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0] + @myUtf8 = global [6 x i8] c"Hello\00", section "var-myUtf8:s8u6" + @myUtf16 = global [6 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0], section "var-myUtf16:s16u6" "###); } @@ -68,7 +68,7 @@ fn assigning_strings() { %prg = type { [11 x i8], [11 x i8] } - @prg_instance = global %prg zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: @@ -109,7 +109,7 @@ fn assigning_string_literals() { %prg = type { [11 x i8], [11 x i8] } - @prg_instance = global %prg zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"world\00" diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index fd1e456a68..69c787df87 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -24,7 +24,7 @@ fn declaring_a_struct() { %Person = type { [81 x i8], [81 x i8], i16, i8 } - @__Person__init = unnamed_addr constant %Person zeroinitializer + @__Person__init = unnamed_addr constant %Person zeroinitializer, section "var-__Person__init:v" "###); } @@ -54,8 +54,8 @@ fn default_values_of_a_struct() { %Person = type { [6 x i8], [6 x i8], i16, i8 } - @p = global %Person { [6 x i8] c"Jane\00\00", [6 x i8] c"Row\00\00\00", i16 1988, i8 0 } - @__Person__init = unnamed_addr constant %Person { [6 x i8] c"Jane\00\00", [6 x i8] c"Row\00\00\00", i16 1988, i8 0 } + @p = global %Person { [6 x i8] c"Jane\00\00", [6 x i8] c"Row\00\00\00", i16 1988, i8 0 }, section "var-p:v" + @__Person__init = unnamed_addr constant %Person { [6 x i8] c"Jane\00\00", [6 x i8] c"Row\00\00\00", i16 1988, i8 0 }, section "var-__Person__init:v" "###); } @@ -97,9 +97,9 @@ fn initializing_a_struct() { %Rect = type { %Point, %Point } %Point = type { i16, i16 } - @prg_instance = global %prg { %Rect { %Point { i16 1, i16 5 }, %Point { i16 10, i16 15 } }, %Rect { %Point { i16 4, i16 6 }, %Point { i16 16, i16 22 } } } - @__Rect__init = unnamed_addr constant %Rect zeroinitializer - @__Point__init = unnamed_addr constant %Point zeroinitializer + @prg_instance = global %prg { %Rect { %Point { i16 1, i16 5 }, %Point { i16 10, i16 15 } }, %Rect { %Point { i16 4, i16 6 }, %Point { i16 16, i16 22 } } }, section "var-prg_instance:v" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:v" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:v" @__prg.rect1__init = unnamed_addr constant %Rect { %Point { i16 1, i16 5 }, %Point { i16 10, i16 15 } } @__prg.rect2__init = unnamed_addr constant %Rect { %Point { i16 4, i16 6 }, %Point { i16 16, i16 22 } } @@ -143,8 +143,8 @@ fn assigning_structs() { %prg = type { %Point, %Point } %Point = type { i16, i16 } - @prg_instance = global %prg zeroinitializer - @__Point__init = unnamed_addr constant %Point zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: @@ -200,9 +200,9 @@ fn accessing_struct_members() { %Rect = type { %Point, %Point } %Point = type { i16, i16 } - @prg_instance = global %prg zeroinitializer - @__Rect__init = unnamed_addr constant %Rect zeroinitializer - @__Point__init = unnamed_addr constant %Point zeroinitializer + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:v" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:v" define void @prg(%prg* %0) section "fn-prg:v" { entry: diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index a4b2d6430b..bdb45c4767 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -316,7 +316,7 @@ fn pass() { %__foo_arr = type { i32*, [2 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:v" define i32 @main() section "fn-main:i32" { entry: @@ -382,7 +382,7 @@ fn access() { %__foo_arr = type { i32*, [2 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:v" define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pv]" { entry: @@ -440,7 +440,7 @@ fn multi_dimensional() { %__foo_arr = type { i32*, [4 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:v" define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pv]" { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap index 9fdb73b521..cd119294f4 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %main = type { i32, i32 } -@main_instance = global %main zeroinitializer, !dbg !0 +@main_instance = global %main zeroinitializer, section "var-main_instance:v", !dbg !0 define void @main(%main* %0) section "fn-main:v" !dbg !12 { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap index 3f3583d993..e64bc35170 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer +@__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer, section "var-__conditional_return__init:v" define void @conditional_return(%conditional_return* %0) section "fn-conditional_return:v[i32]" { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap index 6a8c2cfb27..ea8d9d0be8 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = constant %conditional_return zeroinitializer +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:v" define i32 @main() section "fn-main:i32" { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap index 168d215254..d081cc4357 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = constant %conditional_return zeroinitializer +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:v" define i32 @main() section "fn-main:i32" { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap index 85a459500a..8625d20d66 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %foo = type { i32 } -@foo_instance = global %foo zeroinitializer, !dbg !0 +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:v", !dbg !0 define void @foo(%foo* %0) section "fn-foo:v" !dbg !11 { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap index 3e6e525f30..2a64d05306 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap @@ -4,7 +4,7 @@ expression: output_file_content_without_headers --- %main = type { i32 } -@main_instance = global %main zeroinitializer, !dbg !0 +@main_instance = global %main zeroinitializer, section "var-main_instance:v", !dbg !0 define void @main(%main* %0) section "fn-main:v" !dbg !11 { entry: