From 54c78d9cdb9669143a3583813a639b742d188deb Mon Sep 17 00:00:00 2001 From: Ghaith Hachem Date: Mon, 10 Jun 2024 16:25:08 +0200 Subject: [PATCH 01/40] ci: rename workflow, update readme --- .github/workflows/{rust.yml => linux.yml} | 0 README.md | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) rename .github/workflows/{rust.yml => linux.yml} (100%) diff --git a/.github/workflows/rust.yml b/.github/workflows/linux.yml similarity index 100% rename from .github/workflows/rust.yml rename to .github/workflows/linux.yml diff --git a/README.md b/README.md index e52386e6b0..151b2893c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ # RuSTy -[![Rust Build](https://github.com/PLC-lang/rusty/actions/workflows/rust.yml/badge.svg)](https://github.com/PLC-lang/ruSTy/actions) +[![Linux Build](https://github.com/PLC-lang/rusty/actions/workflows/linux.yml/badge.svg)](https://github.com/PLC-lang/ruSTy/actions) +[![Windows Build](https://github.com/PLC-lang/rusty/actions/workflows/windows.yml/badge.svg)](https://github.com/PLC-lang/rusty/actions/workflows/windows.yml) +[![Documentation](https://github.com/PLC-lang/rusty/actions/workflows/doc.yml/badge.svg)](https://plc-lang.github.io/rusty) [![codecov](https://codecov.io/gh/PLC-lang/rusty/branch/master/graph/badge.svg?token=7ZZ5XZYE9V)](https://codecov.io/gh/PLC-lang/rusty) +[![Metrics](https://github.com/PLC-lang/rusty/actions/workflows/metrics.yml/badge.svg)](https://plc-lang.github.io/metrics) + [![Lines of Code](https://tokei.rs/b1/github/PLC-lang/rusty)](https://github.com/XAMPPRocky/tokei) [Structured text](https://en.wikipedia.org/wiki/Structured_text) compiler written in Rust From c186d0eb59019a81db4c6a826e9890b1bff6e8ed Mon Sep 17 00:00:00 2001 From: Mathias Rieder Date: Wed, 12 Jun 2024 14:26:42 +0200 Subject: [PATCH 02/40] refactor(AST): introduce AstVisitor trait (#1231) * refactor(AST): introduce AstVisitor trait The AST-Visitor trait allows generic visiting of AST-nodes. A default Walking behavior is implemented for each AstStatement but it can be altered by any implementor. When overriding a visit_XXX method, the implementation can decide to continue with the default walking behavior (by calling the walk function on the passed AstStatement-Struct, to skip it, or to continue with an alternative walking bahavior. removed unused AST element CastStatement --- compiler/plc_ast/src/ast.rs | 4 - compiler/plc_ast/src/lib.rs | 1 + compiler/plc_ast/src/visitor.rs | 714 ++++++++++++++++++ src/builtins.rs | 14 - .../generators/expression_generator.rs | 1 - src/parser/tests.rs | 1 + src/parser/tests/ast_visitor_tests.rs | 628 +++++++++++++++ src/resolver.rs | 56 +- src/validation/statement.rs | 12 - 9 files changed, 1346 insertions(+), 85 deletions(-) create mode 100644 compiler/plc_ast/src/visitor.rs create mode 100644 src/parser/tests/ast_visitor_tests.rs diff --git a/compiler/plc_ast/src/ast.rs b/compiler/plc_ast/src/ast.rs index 83a218d5ec..7aa3a0a546 100644 --- a/compiler/plc_ast/src/ast.rs +++ b/compiler/plc_ast/src/ast.rs @@ -600,7 +600,6 @@ pub enum AstStatement { DefaultValue(DefaultValue), // Literals Literal(AstLiteral), - CastStatement(CastStatement), MultipliedStatement(MultipliedStatement), // Expressions ReferenceExpr(ReferenceExpr), @@ -735,9 +734,6 @@ impl Debug for AstNode { } AstStatement::ContinueStatement(..) => f.debug_struct("ContinueStatement").finish(), AstStatement::ExitStatement(..) => f.debug_struct("ExitStatement").finish(), - AstStatement::CastStatement(CastStatement { target, type_name }) => { - f.debug_struct("CastStatement").field("type_name", type_name).field("target", target).finish() - } AstStatement::ReferenceExpr(ReferenceExpr { access, base }) => { f.debug_struct("ReferenceExpr").field("kind", access).field("base", base).finish() } diff --git a/compiler/plc_ast/src/lib.rs b/compiler/plc_ast/src/lib.rs index 7e7d78a7de..33febadee0 100644 --- a/compiler/plc_ast/src/lib.rs +++ b/compiler/plc_ast/src/lib.rs @@ -7,3 +7,4 @@ pub mod control_statements; pub mod literals; mod pre_processor; pub mod provider; +pub mod visitor; diff --git a/compiler/plc_ast/src/visitor.rs b/compiler/plc_ast/src/visitor.rs new file mode 100644 index 0000000000..0aab9108ea --- /dev/null +++ b/compiler/plc_ast/src/visitor.rs @@ -0,0 +1,714 @@ +//! This module defines the `AstVisitor` trait and its associated macros. +//! The `AstVisitor` trait provides a set of methods for traversing and visiting ASTs + +use crate::ast::AstNode; +use crate::ast::*; +use crate::control_statements::{AstControlStatement, ConditionalBlock, ReturnStatement}; +use crate::literals::AstLiteral; + +/// Macro that calls the visitor's `visit` method for every AstNode in the passed iterator `iter`. +macro_rules! visit_all_nodes { + ($visitor:expr, $iter:expr) => { + for node in $iter { + $visitor.visit(node); + } + }; +} + +/// Macro that calls the visitor's `visit` method for every AstNode in the passed sequence of nodes. +macro_rules! visit_nodes { + ($visitor:expr, $($node:expr),*) => { + $( + $visitor.visit($node); + )* + }; +} + +/// The `Walker` implements the traversal of the AST nodes and Ast-related objects (e.g. CompilationUnit). +/// The `walk` method is called on the object to visit its children. +/// If the object passed to a `AstVisitor`'s `visit` method implements the `Walker` trait, +/// a call to the it's walk function continues the visiting process on its children. +/// +/// Spliting the traversal logic into a separate trait allows to call the default traversal logic +/// from the visitor while overriding the visitor's `visit` method for specific nodes. +/// +/// # Example +/// ``` +/// use plc_ast::ast::AstNode; +/// use plc_ast::visitor::Walker; +/// use plc_ast::visitor::AstVisitor; +/// +/// struct MyAssignment { +/// left: AstNode, +/// right: AstNode, +/// } +/// +/// impl Walker for MyAssignment { +/// fn walk(&self, visitor: &mut V) +/// where +/// V: AstVisitor, +/// { +/// visitor.visit(&self.right); +/// visitor.visit(&self.left); +/// } +/// } +/// ``` +/// +pub trait Walker { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor; +} + +/// The `AstVisitor` trait provides a set of methods for visiting different types of AST nodes. +/// Implementors can individually override the methods they are interested in. When overriding a method, +/// make sure to call `walk` on the visited statement to visit its children. DO NOT call walk on +/// the node itself to avoid a recursion (last parameter). Implementors may also decide to not call +/// the statement's `walk` method to avoid visiting the children of the statement. +/// +/// The visitor offers strongly typed `visit_X` functions for every node type. The function's signature +/// is `fn visit_X(&mut self, stmt: &X, node: &AstNode)`. The `stmt` parameter is the unwrapped, typed +/// node and the `node` parameter is the `AstNode` wrapping the stmt. The `AstNode` node offers access to location +/// information and the AstId. Note that some nodes are not wrapped in an `AstNode` node (e.g. `CompilationUnit`) +/// and therefore only the strongly typed node is passed to the `visit_X` function. +/// +/// # Example +/// ``` +/// use plc_ast::{ +/// ast::{Assignment, AstNode}, +/// visitor::{AstVisitor, Walker}, +/// }; +/// +/// struct AssignmentCounter { +/// count: usize, +/// } +/// +/// impl AstVisitor for AssignmentCounter { +/// fn visit_assignment(&mut self, stmt: &Assignment, _node: &AstNode) { +/// self.count += 1; +/// // visit child nodes +/// stmt.walk(self); +/// } +/// +/// fn visit_output_assignment(&mut self, stmt: &Assignment, _node: &AstNode) { +/// self.count += 1; +/// // visit child nodes +/// stmt.walk(self); +/// } +/// } +/// ``` +pub trait AstVisitor: Sized { + /// Visits this `AstNode`. The default implementation calls the `walk` method on the node + /// and will eventually call the strongly typed `visit` method for the node (e.g. visit_assignment + /// if the node is an `AstStatement::Assignment`). + /// # Arguments + /// * `node` - The `AstNode` node to visit. + fn visit(&mut self, node: &AstNode) { + node.walk(self) + } + + /// Visits a `CompilationUnit` node. + /// Make sure to call `walk` on the `CompilationUnit` node to visit its children. + /// # Arguments + /// * `unit` - The unwraped, typed `CompilationUnit` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_compilation_unit(&mut self, unit: &CompilationUnit) { + unit.walk(self) + } + + /// Visits an `Implementation` node. + /// Make sure to call `walk` on the `Implementation` node to visit its children. + /// # Arguments + /// * `implementation` - The unwraped, typed `Implementation` node to visit. + fn visit_implementation(&mut self, implementation: &Implementation) { + implementation.walk(self); + } + + /// Visits a `DataTypeDeclaration` node. + /// Make sure to call `walk` on the `VariableBlock` node to visit its children. + /// # Arguments + /// * `block` - The unwraped, typed `VariableBlock` node to visit. + fn visit_variable_block(&mut self, block: &VariableBlock) { + block.walk(self) + } + + /// Visits a `Variable` node. + /// Make sure to call `walk` on the `Variable` node to visit its children. + /// # Arguments + /// * `variable` - The unwraped, typed `Variable` node to visit. + fn visit_variable(&mut self, variable: &Variable) { + variable.walk(self); + } + + /// Visits an enum element `AstNode` node. + /// Make sure to call `walk` on the `AstNode` node to visit its children. + /// # Arguments + /// * `element` - The unwraped, typed `AstNode` node to visit. + fn visit_enum_element(&mut self, element: &AstNode) { + element.walk(self); + } + + /// Visits a `DataTypeDeclaration` node. + /// Make sure to call `walk` on the `DataTypeDeclaration` node to visit its children. + /// # Arguments + /// * `data_type_declaration` - The unwraped, typed `DataTypeDeclaration` node to visit. + fn visit_data_type_declaration(&mut self, data_type_declaration: &DataTypeDeclaration) { + data_type_declaration.walk(self); + } + + /// Visits a `UserTypeDeclaration` node. + /// Make sure to call `walk` on the `UserTypeDeclaration` node to visit its children. + /// # Arguments + /// * `user_type` - The unwraped, typed `UserTypeDeclaration` node to visit. + fn visit_user_type_declaration(&mut self, user_type: &UserTypeDeclaration) { + user_type.walk(self); + } + + /// Visits a `UserTypeDeclaration` node. + /// Make sure to call `walk` on the `DataType` node to visit its children. + /// # Arguments + /// * `data_type` - The unwraped, typed `DataType` node to visit. + fn visit_data_type(&mut self, data_type: &DataType) { + data_type.walk(self); + } + + /// Visits a `Pou` node. + /// Make sure to call `walk` on the `Pou` node to visit its children. + /// # Arguments + /// * `pou` - The unwraped, typed `Pou` node to visit. + fn visit_pou(&mut self, pou: &Pou) { + pou.walk(self); + } + + /// Visits an `EmptyStatement` node. + /// # Arguments + /// * `stmt` - The unwraped, typed `EmptyStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_empty_statement(&mut self, _stmt: &EmptyStatement, _node: &AstNode) {} + + /// Visits a `DefaultValue` node. + /// # Arguments + /// * `stmt` - The unwraped, typed `DefaultValue` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_default_value(&mut self, _stmt: &DefaultValue, _node: &AstNode) {} + + /// Visits an `AstLiteral` node. + /// Make sure to call `walk` on the `AstLiteral` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `AstLiteral` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_literal(&mut self, stmt: &AstLiteral, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `MultipliedStatement` node. + /// Make sure to call `walk` on the `MultipliedStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `MultipliedStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_multiplied_statement(&mut self, stmt: &MultipliedStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `ReferenceExpr` node. + /// Make sure to call `walk` on the `ReferenceExpr` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `ReferenceExpr` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_reference_expr(&mut self, stmt: &ReferenceExpr, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits an `Identifier` node. + /// Make sure to call `walk` on the `Identifier` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `Identifier` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_identifier(&mut self, _stmt: &str, _node: &AstNode) {} + + /// Visits a `DirectAccess` node. + /// Make sure to call `walk` on the `DirectAccess` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `DirectAccess` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_direct_access(&mut self, stmt: &DirectAccess, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `HardwareAccess` node. + /// Make sure to call `walk` on the `HardwareAccess` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `HardwareAccess` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_hardware_access(&mut self, stmt: &HardwareAccess, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `BinaryExpression` node. + /// Make sure to call `walk` on the `BinaryExpression` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `BinaryExpression` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_binary_expression(&mut self, stmt: &BinaryExpression, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `UnaryExpression` node. + /// Make sure to call `walk` on the `UnaryExpression` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `UnaryExpression` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_unary_expression(&mut self, stmt: &UnaryExpression, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits an `ExpressionList` node. + /// Make sure to call `walk` on the `Vec` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `ExpressionList` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_expression_list(&mut self, stmt: &Vec, _node: &AstNode) { + visit_all_nodes!(self, stmt); + } + + /// Visits a `ParenExpression` node. + /// Make sure to call `walk` on the inner `AstNode` node to visit its children. + /// # Arguments + /// * `inner` - The unwraped, typed inner `AstNode` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_paren_expression(&mut self, inner: &AstNode, _node: &AstNode) { + inner.walk(self) + } + + /// Visits a `RangeStatement` node. + /// Make sure to call `walk` on the `RangeStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `RangeStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_range_statement(&mut self, stmt: &RangeStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `VlaRangeStatement` node. + /// # Arguments + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_vla_range_statement(&mut self, _node: &AstNode) {} + + /// Visits an `Assignment` node. + /// Make sure to call `walk` on the `Assignment` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `Assignment` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_assignment(&mut self, stmt: &Assignment, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits an `OutputAssignment` node. + /// Make sure to call `walk` on the `Assignment` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `Assignment` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_output_assignment(&mut self, stmt: &Assignment, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `CallStatement` node. + /// Make sure to call `walk` on the `CallStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `CallStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_call_statement(&mut self, stmt: &CallStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits an `AstControlStatement` node. + /// Make sure to call `walk` on the `AstControlStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `AstControlStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_control_statement(&mut self, stmt: &AstControlStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `CaseCondition` node. + /// Make sure to call `walk` on the child-`AstNode` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `CaseCondition` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_case_condition(&mut self, child: &AstNode, _node: &AstNode) { + child.walk(self) + } + + /// Visits an `ExitStatement` node. + /// # Arguments + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_exit_statement(&mut self, _node: &AstNode) {} + + /// Visits a `ContinueStatement` node. + /// # Arguments + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_continue_statement(&mut self, _node: &AstNode) {} + + /// Visits a `ReturnStatement` node. + /// Make sure to call `walk` on the `ReturnStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `ReturnStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_return_statement(&mut self, stmt: &ReturnStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `JumpStatement` node. + /// Make sure to call `walk` on the `JumpStatement` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `JumpStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_jump_statement(&mut self, stmt: &JumpStatement, _node: &AstNode) { + stmt.walk(self) + } + + /// Visits a `LabelStatement` node. + /// # Arguments + /// * `stmt` - The unwraped, typed `LabelStatement` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_label_statement(&mut self, _stmt: &LabelStatement, _node: &AstNode) {} +} + +/// Helper method that walks through a slice of `ConditionalBlock` and applies the visitor's `walk` method to each node. +fn walk_conditional_blocks(visitor: &mut V, blocks: &[ConditionalBlock]) +where + V: AstVisitor, +{ + for b in blocks { + visit_nodes!(visitor, &b.condition); + visit_all_nodes!(visitor, &b.body); + } +} + +impl Walker for AstLiteral { + fn walk(&self, _visitor: &mut V) + where + V: AstVisitor, + { + // do nothing + } +} + +impl Walker for MultipliedStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visitor.visit(&self.element) + } +} + +impl Walker for ReferenceExpr { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + if let Some(base) = &self.base { + visitor.visit(base); + } + + match &self.access { + ReferenceAccess::Member(t) | ReferenceAccess::Index(t) | ReferenceAccess::Cast(t) => { + visitor.visit(t) + } + _ => {} + } + } +} + +impl Walker for DirectAccess { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.index); + } +} + +impl Walker for HardwareAccess { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_all_nodes!(visitor, &self.address); + } +} + +impl Walker for BinaryExpression { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.left, &self.right); + } +} + +impl Walker for UnaryExpression { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.value); + } +} + +impl Walker for Assignment { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.left, &self.right); + } +} + +impl Walker for RangeStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.start, &self.end); + } +} + +impl Walker for CallStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.operator); + if let Some(params) = &self.parameters { + visit_nodes!(visitor, params); + } + } +} + +impl Walker for AstControlStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + match self { + AstControlStatement::If(stmt) => { + walk_conditional_blocks(visitor, &stmt.blocks); + visit_all_nodes!(visitor, &stmt.else_block); + } + AstControlStatement::WhileLoop(stmt) | AstControlStatement::RepeatLoop(stmt) => { + visit_nodes!(visitor, &stmt.condition); + visit_all_nodes!(visitor, &stmt.body); + } + AstControlStatement::ForLoop(stmt) => { + visit_nodes!(visitor, &stmt.counter, &stmt.start, &stmt.end); + visit_all_nodes!(visitor, &stmt.by_step); + visit_all_nodes!(visitor, &stmt.body); + } + AstControlStatement::Case(stmt) => { + visit_nodes!(visitor, &stmt.selector); + walk_conditional_blocks(visitor, &stmt.case_blocks); + visit_all_nodes!(visitor, &stmt.else_block); + } + } + } +} + +impl Walker for ReturnStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_all_nodes!(visitor, &self.condition); + } +} + +impl Walker for JumpStatement { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_nodes!(visitor, &self.condition, &self.target); + } +} + +impl Walker for AstNode { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + let node = self; + match &self.stmt { + AstStatement::EmptyStatement(stmt) => visitor.visit_empty_statement(stmt, node), + AstStatement::DefaultValue(stmt) => visitor.visit_default_value(stmt, node), + AstStatement::Literal(stmt) => visitor.visit_literal(stmt, node), + AstStatement::MultipliedStatement(stmt) => visitor.visit_multiplied_statement(stmt, node), + AstStatement::ReferenceExpr(stmt) => visitor.visit_reference_expr(stmt, node), + AstStatement::Identifier(stmt) => visitor.visit_identifier(stmt, node), + AstStatement::DirectAccess(stmt) => visitor.visit_direct_access(stmt, node), + AstStatement::HardwareAccess(stmt) => visitor.visit_hardware_access(stmt, node), + AstStatement::BinaryExpression(stmt) => visitor.visit_binary_expression(stmt, node), + AstStatement::UnaryExpression(stmt) => visitor.visit_unary_expression(stmt, node), + AstStatement::ExpressionList(stmt) => visitor.visit_expression_list(stmt, node), + AstStatement::ParenExpression(stmt) => visitor.visit_paren_expression(stmt, node), + AstStatement::RangeStatement(stmt) => visitor.visit_range_statement(stmt, node), + AstStatement::VlaRangeStatement => visitor.visit_vla_range_statement(node), + AstStatement::Assignment(stmt) => visitor.visit_assignment(stmt, node), + AstStatement::OutputAssignment(stmt) => visitor.visit_output_assignment(stmt, node), + AstStatement::CallStatement(stmt) => visitor.visit_call_statement(stmt, node), + AstStatement::ControlStatement(stmt) => visitor.visit_control_statement(stmt, node), + AstStatement::CaseCondition(stmt) => visitor.visit_case_condition(stmt, node), + AstStatement::ExitStatement(_stmt) => visitor.visit_exit_statement(node), + AstStatement::ContinueStatement(_stmt) => visitor.visit_continue_statement(node), + AstStatement::ReturnStatement(stmt) => visitor.visit_return_statement(stmt, node), + AstStatement::JumpStatement(stmt) => visitor.visit_jump_statement(stmt, node), + AstStatement::LabelStatement(stmt) => visitor.visit_label_statement(stmt, node), + } + } +} + +impl Walker for CompilationUnit { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + for block in &self.global_vars { + visitor.visit_variable_block(block); + } + + for user_type in &self.user_types { + visitor.visit_user_type_declaration(user_type); + } + + for pou in &self.units { + visitor.visit_pou(pou); + } + + for i in &self.implementations { + visitor.visit_implementation(i); + } + } +} + +impl Walker for UserTypeDeclaration { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visitor.visit_data_type(&self.data_type); + visit_all_nodes!(visitor, &self.initializer); + } +} + +impl Walker for VariableBlock { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + for v in self.variables.iter() { + visitor.visit_variable(v); + } + } +} + +impl Walker for Variable { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + visit_all_nodes!(visitor, &self.address); + visitor.visit_data_type_declaration(&self.data_type_declaration); + visit_all_nodes!(visitor, &self.initializer); + } +} + +impl Walker for DataType { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + match self { + DataType::StructType { variables, .. } => { + for v in variables.iter() { + visitor.visit_variable(v); + } + } + DataType::EnumType { elements, .. } => { + for ele in flatten_expression_list(elements) { + visitor.visit_enum_element(ele); + } + } + DataType::SubRangeType { bounds, .. } => { + visit_all_nodes!(visitor, bounds); + } + DataType::ArrayType { bounds, referenced_type, .. } => { + visitor.visit(bounds); + visitor.visit_data_type_declaration(referenced_type); + } + DataType::PointerType { referenced_type, .. } => { + visitor.visit_data_type_declaration(referenced_type); + } + DataType::StringType { size, .. } => { + visit_all_nodes!(visitor, size); + } + DataType::VarArgs { referenced_type, .. } => { + if let Some(data_type_declaration) = referenced_type { + visitor.visit_data_type_declaration(data_type_declaration); + } + } + DataType::GenericType { .. } => { + //no further visits + } + } + } +} + +impl Walker for DataTypeDeclaration { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + if let DataTypeDeclaration::DataTypeDefinition { data_type, .. } = self { + visitor.visit_data_type(data_type); + } + } +} + +impl Walker for Option +where + T: Walker, +{ + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + if let Some(node) = self { + node.walk(visitor); + } + } +} + +impl Walker for Pou { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + for block in &self.variable_blocks { + visitor.visit_variable_block(block); + } + + self.return_type.as_ref().inspect(|rt| visitor.visit_data_type_declaration(rt)); + } +} + +impl Walker for Implementation { + fn walk(&self, visitor: &mut V) + where + V: AstVisitor, + { + for n in &self.statements { + visitor.visit(n); + } + } +} diff --git a/src/builtins.rs b/src/builtins.rs index 4deca18bb1..de6de63e59 100644 --- a/src/builtins.rs +++ b/src/builtins.rs @@ -846,20 +846,6 @@ fn generate_variable_length_array_bound_function<'ink>( let offset = if is_lower { (value - 1) as u64 * 2 } else { (value - 1) as u64 * 2 + 1 }; llvm.i32_type().const_int(offset, false) } - AstStatement::CastStatement(data) => { - let ExpressionValue::RValue(value) = generator.generate_expression_value(&data.target)? else { - unreachable!() - }; - - if !value.is_int_value() { - return Err(Diagnostic::codegen_error( - format!("Expected INT value, found {}", value.get_type()), - location, - )); - }; - - value.into_int_value() - } // e.g. LOWER_BOUND(arr, idx + 3) _ => { let expression_value = generator.generate_expression(params[1])?; diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index 404526afd6..5db678157f 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -1751,7 +1751,6 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } // if there is just one assignment, this may be an struct-initialization (TODO this is not very elegant :-/ ) AstStatement::Assignment { .. } => self.generate_literal_struct(literal_statement), - AstStatement::CastStatement(data) => self.generate_expression_value(&data.target), _ => Err(cannot_generate_literal()), } } diff --git a/src/parser/tests.rs b/src/parser/tests.rs index 8ee0e295b6..f9879edf50 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -5,6 +5,7 @@ use plc_ast::{ use plc_source::source_location::SourceLocation; // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder +mod ast_visitor_tests; mod class_parser_tests; mod container_parser_tests; mod control_parser_tests; diff --git a/src/parser/tests/ast_visitor_tests.rs b/src/parser/tests/ast_visitor_tests.rs new file mode 100644 index 0000000000..c97533c520 --- /dev/null +++ b/src/parser/tests/ast_visitor_tests.rs @@ -0,0 +1,628 @@ +use plc_ast::{ + ast::LinkageType, + provider::IdProvider, + visitor::{AstVisitor, Walker}, +}; +use plc_source::source_location::SourceLocationFactory; + +use crate::{lexer, parser}; + +/// This is a simple visitor that collects all identifiers and literals in a given body +/// It is used by unit tests, to easily see if all identifiers (even the deeply nested ones) were visited +/// and therefore that all subtrees of the AST were visited. +/// +/// e.g. if we have a source code like this: +/// ``` +/// PROGRAM prg +/// foo (a := b, c => 4); +/// END_PROGRAM +/// ``` +/// The visitor should collect the following identifiers/literals: "foo", "a", "b", "c" and "4" +#[derive(Default)] +struct IdentifierCollector { + identifiers: Vec, +} + +impl AstVisitor for IdentifierCollector { + fn visit_identifier(&mut self, stmt: &str, _node: &plc_ast::ast::AstNode) { + self.identifiers.push(stmt.to_string()); + } + + fn visit_literal(&mut self, stmt: &plc_ast::literals::AstLiteral, _node: &plc_ast::ast::AstNode) { + self.identifiers.push(stmt.get_literal_value()); + } +} + +/// Helper function to create a vector of strings with all characters in the range from start to end +fn get_character_range(start: char, end: char) -> Vec { + (start as u8..=end as u8).map(|c| c as char).map(|c| c.to_string()).collect() +} + +/// Helper function to collect all identifiers in a given source code +/// using the IdentifierCollector visitor +fn collect_identifiers(src: &str) -> IdentifierCollector { + let mut visitor = IdentifierCollector::default(); + visit(src, &mut visitor); + visitor.identifiers.sort(); + visitor +} + +/// Helper function to visit a given source code with a given visitor +fn visit(src: &str, visitor: &mut impl AstVisitor) { + let id_provider = IdProvider::default(); + let (compilation_unit, _) = parser::parse( + lexer::lex_with_ids(src, id_provider.clone(), SourceLocationFactory::internal(src)), + LinkageType::Internal, + "test.st", + ); + + visitor.visit_compilation_unit(&compilation_unit) +} + +#[test] +fn test_visit_arithmetic_expressions() { + // GIVEN a source code with arithmetic expressions + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a; + b; + c := NOT d; + e := f MOD g; + h := (i / j / k - (l + m)) * n; + END_PROGRAM", + ); + // THEN we expect to also visit subexpressions in binary and unary expressions + assert_eq!(get_character_range('a', 'n'), visitor.identifiers); +} + +#[test] +fn test_visit_expression_list() { + // GIVEN a source code with an expression list + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a,b,c; + END_PROGRAM", + ); + // THEN we expect to visit all identifiers in the expression list + assert_eq!(get_character_range('a', 'c'), visitor.identifiers); +} + +#[test] +fn test_if_statement() { + // GIVEN a source code with an if statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + IF a THEN + b := c; + ELSIF d THEN + e := f; + ELSE + g := h; + END_IF; + END_PROGRAM", + ); + // THEN we expect to visit the condition, the body, the elseif condition and body and the else body + assert_eq!(get_character_range('a', 'h'), visitor.identifiers); +} + +#[test] +fn test_visit_for_loop_statement() { + // GIVEN a source code with a for loop statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + FOR a := b TO c BY d DO + e; + f; + END_FOR; + END_PROGRAM", + ); + // THEN we expect to visit the loop variable, the start, end and step expressions and the loop body + assert_eq!(get_character_range('a', 'f'), visitor.identifiers); +} + +#[test] +fn test_visit_while_loop_statement() { + // GIVEN a source code with a while loop statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + WHILE a < b DO + c; + d; + END_WHILE; + END_PROGRAM", + ); + // THEN we expect to visit the condition and the loop body + assert_eq!(get_character_range('a', 'd'), visitor.identifiers); +} +#[test] +fn test_visit_repeat_loop_statement() { + // GIVEN a source code with a repeat loop statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + REPEAT + a; + b; + UNTIL c > d; + END_PROGRAM", + ); + // THEN we expect to visit the loop body and the condition + assert_eq!(get_character_range('a', 'd'), visitor.identifiers); +} + +#[test] +fn test_visit_case_statement() { + // GIVEN a source code with a case statement + + let visitor = collect_identifiers( + " + PROGRAM prg + CASE a OF + b: + c; + d; + e, f: + g; + h; + ELSE + i; + j; + END_CASE; + END_PROGRAM", + ); + // THEN we expect to visit the case expression, the case labels, their bodies and the else body + assert_eq!(get_character_range('a', 'j'), visitor.identifiers); +} + +#[test] +fn test_visit_multiplied_statement() { + // GIVEN a source code with a multiplied statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + 3(a+b); + END_PROGRAM", + ); + // THEN we expect to visit the multiplied expression and its subexpressions + assert_eq!(get_character_range('a', 'b'), visitor.identifiers); +} + +#[test] +fn test_visist_array_expressions() { + // GIVEN a source code with array expressions + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a[b]; + c[d,e+f]; + g[h+i][j+k]; + END_PROGRAM", + ); + // THEN we expect to visit the array expressions and the array-accessor expressions + assert_eq!(get_character_range('a', 'k'), visitor.identifiers); +} + +#[test] +fn test_visit_range_statement() { + // GIVEN a source code with range statements + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a..b; + END_PROGRAM", + ); + // THEN we expect to visit the start and end expressions of the range + assert_eq!(get_character_range('a', 'b'), visitor.identifiers); +} + +#[test] +fn test_visit_assignment_expressions() { + // GIVEN a source code with assignment expressions + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a := b; + c => d; + e =>; + END_PROGRAM", + ); + // THEN we expect to visit the left and right side of the assignment expressions + assert_eq!(get_character_range('a', 'e'), visitor.identifiers); +} + +#[test] +fn test_visit_direct_access_statement_expressions() { + // GIVEN a source code with direct access expressions + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + %IW1.2.3; + %MD4; + END_PROGRAM", + ); + // THEN we expect to visit all segments of the direct access + assert_eq!(get_character_range('1', '4'), visitor.identifiers); +} + +#[test] +fn test_visit_call_statements() { + // GIVEN a source code with call statements + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a(); + b(c,d); + e(f:=(g), h=>i); + END_PROGRAM", + ); + // THEN we expect to visit the function name and all arguments + assert_eq!(get_character_range('a', 'i'), visitor.identifiers); +} + +#[test] +fn test_visit_return_statement() { + // GIVEN a source code with a return statement + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + FUNCTION prg : INT + RETURN a + b; + END_PROGRAM", + ); + // THEN we expect to visit the return expression + assert_eq!(get_character_range('a', 'b'), visitor.identifiers); +} + +#[test] +fn test_visit_into_var_global() { + // GIVEN a source code with a var_global section + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + VAR_GLOBAL + a : INT := c; + c : INT := d; + END_VAR", + ); + // THEN we expect to visit all initializers (variable names are no AstStatements!) + assert_eq!(get_character_range('c', 'd'), visitor.identifiers); +} + +#[test] +fn test_visit_data_type_declaration() { + // GIVEN a visitor that collects variables, enum elements and range expressions + struct FieldCollector { + fields: Vec, + } + + // This is a simple visitor that collects all field names in a datatype + impl AstVisitor for FieldCollector { + fn visit_variable(&mut self, variable: &plc_ast::ast::Variable) { + self.fields.push(variable.name.clone()); + variable.walk(self); + } + + fn visit_enum_element(&mut self, element: &plc_ast::ast::AstNode) { + if let Some(name) = element.get_flat_reference_name() { + self.fields.push(name.to_string()); + } + element.walk(self); + } + + fn visit_range_statement( + &mut self, + stmt: &plc_ast::ast::RangeStatement, + _node: &plc_ast::ast::AstNode, + ) { + if let Some((start, end)) = + stmt.start.get_flat_reference_name().zip(stmt.end.get_flat_reference_name()) + { + self.fields.push(start.to_string()); + self.fields.push(end.to_string()); + } + stmt.walk(self); + } + } + let mut visitor = FieldCollector { fields: vec![] }; + // WHEN we visit a source code with a complex datatype + visit( + " + TYPE myStruct: STRUCT + a, b, c: DINT; + s: STRING; + e: (enum1, enum2, enum3); + END_STRUCT; + END_TYPE + + TYPE MyEnum: (myEnum1, myEnum2, myEnum3); + END_TYPE + + TYPE MySubRange: INT(max..min); END_TYPE + + TYPE MyArray: ARRAY[start..end] OF INT; END_TYPE + ", + &mut visitor, + ); + + visitor.fields.sort(); + // THEN we expect to visit all fields, enum elements and range expressions + assert_eq!( + vec![ + "a", "b", "c", "e", "end", "enum1", "enum2", "enum3", "max", "min", "myEnum1", "myEnum2", + "myEnum3", "s", "start" + ], + visitor.fields + ); +} + +#[test] +fn test_count_assignments() { + // GIVEN a visitor that counts assignments + struct AssignmentCounter { + count: usize, + } + + impl AstVisitor for AssignmentCounter { + fn visit_assignment(&mut self, stmt: &plc_ast::ast::Assignment, _node: &plc_ast::ast::AstNode) { + self.count += 1; + stmt.walk(self) + } + + fn visit_output_assignment( + &mut self, + stmt: &plc_ast::ast::Assignment, + _node: &plc_ast::ast::AstNode, + ) { + self.count += 1; + stmt.walk(self) + } + } + + let id_provider = IdProvider::default(); + let (compilation_unit, _) = parser::parse( + lexer::lex_with_ids( + " + PROGRAM prg + a := b; + c => d; + e := f; + foo(a := baz(x := 2, z => 3)); + END_PROGRAM", + id_provider.clone(), + SourceLocationFactory::internal(""), + ), + LinkageType::Internal, + "test.st", + ); + + let mut visitor = AssignmentCounter { count: 0 }; + // WHEN we visit a source code with assignments + for st in &compilation_unit.implementations[0].statements { + visitor.visit(st); + } + // THEN we expect to visit all assignments + assert_eq!(6, visitor.count); +} + +#[test] +fn test_visit_datatype_initializers_statement() { + // GIVEN a source code with datatype initializers + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + TYPE MyStruct: STRUCT + field1: DINT := a; + field2: DINT := (b + c); + field3: ARRAY[1..3] OF DINT := 4(d); + field4: ARRAY[4..7] OF DINT := (e, f, g, h); + field5: (i := j, k := l) := m; + + END_STRUCT + END_TYPE", + ); + // THEN we expect to visit all initializers and enum elements + let mut expected = ["1", "3", "4", "7"].iter().map(|c| c.to_string()).collect::>(); + + expected.extend(get_character_range('a', 'm')); + assert_eq!(expected, visitor.identifiers); +} + +#[test] +fn test_visit_array_declaration_statement() { + // GIVEN a source code with array declarations + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + TYPE MyArray: ARRAY[(a+b)..(c+d)] OF INT; END_TYPE", + ); + // THEN we expect to visit the start and end expressions of the array + assert_eq!(get_character_range('a', 'd'), visitor.identifiers); +} + +#[test] +fn test_visit_qualified_expressions() { + // GIVEN a source code with qualified expressions + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + a.b; + c.d^.e; + f.g[h].i; + END_PROGRAM", + ); + // THEN we expect to visit all segments in the qualified expressions + assert_eq!(get_character_range('a', 'i'), visitor.identifiers); +} + +#[test] +fn test_visit_variable_block() { + // GIVEN a source code with a variable block + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + VAR_INPUT + a : INT := X; + END_VAR + VAR_OUTPUT + b : INT := Y; + END_VAR + VAR CONSTANT + c : INT + END_VAR + END_PROGRAM", + ); + // THEN we expect to visit all variables and their initializers + assert_eq!(get_character_range('X', 'Y'), visitor.identifiers); +} + +#[test] +fn test_visit_continue_exit() { + // THIS test is mainly here to cover the default visit implementation of Continue, Exit and EmptyStatement + let visitor = collect_identifiers( + " + PROGRAM prg + CONTINUE; + EXIT; + ; + END_PROGRAM", + ); + assert_eq!(0, visitor.identifiers.len()); +} + +#[test] +fn test_visit_default_value() { + // GIVEN a Visitor that visits default values + struct DefaultValueCollector { + visited: bool, + } + + // This is a simple visitor that collects all field names in a datatype + impl AstVisitor for DefaultValueCollector { + fn visit_default_value(&mut self, _stmt: &plc_ast::ast::DefaultValue, _node: &plc_ast::ast::AstNode) { + self.visited = true; + } + } + + let mut visitor = DefaultValueCollector { visited: false }; + // WHEN we visit a source code with a default value + visit( + " + VAR_GLOBAL CONSTANT + a : INT; + END_VAR + ", + &mut visitor, + ); + // THEN we expect to visit the default value + assert!(visitor.visited); +} + +#[test] +fn test_visit_direct_access() { + // GIVEN a Visitor that visits direct accesses + struct Visited { + visited: bool, + } + + impl AstVisitor for Visited { + fn visit_direct_access(&mut self, _stmt: &plc_ast::ast::DirectAccess, _node: &plc_ast::ast::AstNode) { + self.visited = true; + } + } + + let mut visitor = Visited { visited: false }; + // WHEN we visit a source code with a direct access + visit( + " + PROGRAM prg + x.1; + ", + &mut visitor, + ); + // THEN we expect to visit the direct access + assert!(visitor.visited); + + let v = collect_identifiers( + " + PROGRAM prg + x.1; + ", + ); + assert_eq!(vec!["1", "x"], v.identifiers); +} + +#[test] +fn test_invalid_case_condition() { + // this tests ensures that we visit "invalid" statements. (see parser's behavior in parse_statement) + struct Visited { + visited: bool, + } + + impl AstVisitor for Visited { + fn visit_case_condition(&mut self, _child: &plc_ast::ast::AstNode, _node: &plc_ast::ast::AstNode) { + self.visited = true; + } + } + + let mut visitor = Visited { visited: false }; + + visit( + " + PROGRAM prg + x: + ", + &mut visitor, + ); + assert!(visitor.visited); +} + +#[test] +fn test_visit_string_declaration() { + // GIVEN a source code with a string declaration + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + VAR + str: STRING(X); + END_VAR + ", + ); + // THEN we expect to visit the string length + assert_eq!(vec!["X"], visitor.identifiers); +} + +#[test] +fn test_visit_pointer_declaration() { + // GIVEN a source code with a pointer declaration + // WHEN we visit all nodes in the AST + let visitor = collect_identifiers( + " + PROGRAM prg + VAR + str: POINTER TO ARRAY[a..b] OF INT := c; + END_VAR + ", + ); + // THEN we expect to visit the pointer type and the initializer + assert_eq!(get_character_range('a', 'c'), visitor.identifiers); +} diff --git a/src/resolver.rs b/src/resolver.rs index 3e6a29dcf8..6bf25261a2 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -11,9 +11,8 @@ use std::hash::Hash; use plc_ast::{ ast::{ self, flatten_expression_list, Assignment, AstFactory, AstId, AstNode, AstStatement, - BinaryExpression, CastStatement, CompilationUnit, DataType, DataTypeDeclaration, DirectAccessType, - JumpStatement, Operator, Pou, ReferenceAccess, ReferenceExpr, TypeNature, UserTypeDeclaration, - Variable, + BinaryExpression, CompilationUnit, DataType, DataTypeDeclaration, DirectAccessType, JumpStatement, + Operator, Pou, ReferenceAccess, ReferenceExpr, TypeNature, UserTypeDeclaration, Variable, }, control_statements::{AstControlStatement, ReturnStatement}, literals::{Array, AstLiteral, StringValue}, @@ -1442,57 +1441,6 @@ impl<'i> TypeAnnotator<'i> { AstStatement::CallStatement(..) => { self.visit_call_statement(statement, ctx); } - AstStatement::CastStatement(CastStatement { target, type_name }, ..) => { - //see if this type really exists - let data_type = self.index.find_effective_type_info(type_name); - let statement_to_annotation = if let Some(DataTypeInformation::Enum { name, .. }) = data_type - { - //enum cast - self.visit_statement(&ctx.with_qualifier(name.to_string()), target); - //use the type of the target - let type_name = self.annotation_map.get_type_or_void(target, self.index).get_name(); - vec![(statement, type_name.to_string())] - } else if let Some(t) = data_type { - // special handling for unlucky casted-strings where caste-type does not match the literal encoding - // ´STRING#"abc"´ or ´WSTRING#'abc'´ - match (t, target.as_ref().get_stmt()) { - ( - DataTypeInformation::String { encoding: StringEncoding::Utf8, .. }, - AstStatement::Literal(AstLiteral::String(StringValue { - value, - is_wide: is_wide @ true, - })), - ) - | ( - DataTypeInformation::String { encoding: StringEncoding::Utf16, .. }, - AstStatement::Literal(AstLiteral::String(StringValue { - value, - is_wide: is_wide @ false, - })), - ) => { - // visit the target-statement as if the programmer used the correct quotes to prevent - // a utf16 literal-global-variable that needs to be casted back to utf8 or vice versa - self.visit_statement( - ctx, - &AstNode::new_literal( - AstLiteral::new_string(value.clone(), !is_wide), - target.get_id(), - target.get_location(), - ), - ); - } - _ => {} - } - vec![(statement, t.get_name().to_string()), (target, t.get_name().to_string())] - } else { - //unknown type? what should we do here? - self.visit_statement(ctx, target); - vec![] - }; - for (stmt, annotation) in statement_to_annotation { - self.annotate(stmt, StatementAnnotation::value(annotation)); - } - } AstStatement::ReferenceExpr(data, ..) => { self.visit_reference_expr(&data.access, data.base.as_deref(), statement, ctx); } diff --git a/src/validation/statement.rs b/src/validation/statement.rs index 4e6d8af18c..d995ed440f 100644 --- a/src/validation/statement.rs +++ b/src/validation/statement.rs @@ -58,18 +58,6 @@ pub fn visit_statement( AstStatement::Literal(AstLiteral::Array(Array { elements: Some(elements) })) => { visit_statement(validator, elements.as_ref(), context); } - AstStatement::CastStatement(data) => { - if let AstStatement::Literal(literal) = data.target.get_stmt() { - validate_cast_literal( - validator, - literal, - statement, - &data.type_name, - &statement.get_location(), - context, - ); - } - } AstStatement::MultipliedStatement(data) => { visit_statement(validator, &data.element, context); } From b545e41d8ccf3ecedc3d561e33c1294592d11fb9 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 13:10:26 +0100 Subject: [PATCH 03/40] codegen: Add mangling for global variables --- src/codegen/generators/variable_generator.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 55a8194b05..6456a9e20a 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,18 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { } } + let section = section_mangler::SectionMangler::variable( + global_variable.get_name(), + // FIXME: Can we unwrap here? + section_names::mangle_type( + self.global_index, + self.global_index.get_effective_type_by_name(global_variable.get_type_name()).unwrap(), + ), + ) + .mangle(); + + global_ir_variable.set_section(Some(§ion)); + Ok(global_ir_variable) } } From 7a29d58f63612b99568b53836848d2c28f84ad04 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 13:11:33 +0100 Subject: [PATCH 04/40] rusty: Update testsuite for new global variable section names --- ...ernal_files__external_file_global_var.snap | 8 +-- ...n_different_locations_with_debug_info.snap | 4 +- ...files__multiple_files_with_debug_info.snap | 4 +- ...iles__multiple_source_files_generated.snap | 4 +- ...l_is_not_added_as_external_subroutine.snap | 4 +- ...g__implementation_added_as_subroutine.snap | 4 +- ...on_function_pous_have_struct_as_param.snap | 4 +- ...ring_size_correctly_set_in_dwarf_info.snap | 2 +- ...temp_variables_in_pous_added_as_local.snap | 4 +- ...initializer_gets_declared_initializer.snap | 2 +- ..._initializer_gets_default_initializer.snap | 2 +- ...l_values_in_global_constant_variables.snap | 39 ++++++------- ...s__initial_values_in_global_variables.snap | 9 +-- ...lues_in_global_variables_out_of_order.snap | 6 +- ...tializers__uninitialized_global_array.snap | 4 +- ..._class_struct_initialized_in_function.snap | 4 +- ...global_variables_in_inline_assignment.snap | 10 ++-- ..._block_struct_initialized_in_function.snap | 4 +- ..._function_return_value_is_initialized.snap | 2 +- ..._is_initialized_with_type_initializer.snap | 4 +- ...alue_with_initializers_is_initialized.snap | 6 +- ...e_without_initializers_is_initialized.snap | 2 +- ...tial_constant_values_in_pou_variables.snap | 8 +-- ...ial_values_in_array_of_array_variable.snap | 4 +- ..._initial_values_in_function_block_pou.snap | 4 +- ...lizers__initial_values_in_program_pou.snap | 2 +- ...s__initialized_array_type_in_function.snap | 2 +- ...for_struct_initialization_in_function.snap | 2 +- ..._for_struct_initialization_in_program.snap | 4 +- ...nt_functions_are_referenced_correctly.snap | 8 +-- ...imilar_names_are_referenced_correctly.snap | 16 ++--- ...alias_chain_with_lots_of_initializers.snap | 10 ++-- ...izers__array_of_struct_initialization.snap | 10 ++-- ...t_variable_using_multiplied_statement.snap | 7 +-- ...th_inline_initializer_are_initialized.snap | 30 +++++----- ...xpression_list_as_array_initilization.snap | 9 +-- ...zers__incomplete_array_initialization.snap | 5 +- ...initialization_with_custom_init_value.snap | 5 +- ...s__initial_nested_struct_delayed_init.snap | 9 ++- ...y_variable_using_multiplied_statement.snap | 10 ++-- ...lizers__initial_values_in_fb_variable.snap | 4 +- ...ues_in_multi_dimension_array_variable.snap | 5 +- ...values_in_single_dimension_array_type.snap | 5 +- ...es_in_single_dimension_array_variable.snap | 19 +++--- ...izers__initial_values_in_struct_types.snap | 5 +- ...rs__initial_values_in_struct_variable.snap | 7 +-- ...alues_in_struct_variable_missing_init.snap | 7 +-- ...ers__initial_values_in_sub_range_type.snap | 4 +- ...alizers__initial_values_in_type_alias.snap | 4 +- ..._const_struct_will_get_default_values.snap | 7 +-- ...array_of_structs_are_zero_initialized.snap | 6 +- ...t_initial_values_different_data_types.snap | 5 +- ...on_uses_types_default_if_not_provided.snap | 5 +- ...alizer_uses_fallback_to_field_default.snap | 5 +- ...uct_with_one_field_can_be_initialized.snap | 5 +- ..._are_used_for_uninitialized_constants.snap | 9 ++- src/codegen/tests/parameters_tests.rs | 14 ++--- ...enerates_in_separate_global_variables.snap | 6 +- ...sts__accessing_nested_array_in_struct.snap | 4 +- ...e_gen_tests__accessing_nested_structs.snap | 6 +- ...e_gen_tests__action_called_in_program.snap | 2 +- ...sts__array_of_cast_int_type_generated.snap | 2 +- ..._int_non_zero_negative_type_generated.snap | 2 +- ..._array_of_int_non_zero_type_generated.snap | 2 +- ...en_tests__array_of_int_type_generated.snap | 2 +- ...ode_gen_tests__array_of_int_type_used.snap | 2 +- ...ype_with_non_zero_negative_start_used.snap | 2 +- ..._of_int_type_with_non_zero_start_used.snap | 2 +- ...d_variable_declaration_is_initialized.snap | 6 +- ...mber_of_another_struct_is_initialized.snap | 6 +- ..._code_gen_tests__arrays_are_generated.snap | 6 +- ..._with_global_const_size_are_generated.snap | 19 +++--- ..._gen_tests__basic_datatypes_generated.snap | 29 +++++----- ...onstant_expressions_in_case_selectors.snap | 6 +- ...th_enum_expressions_in_case_selectors.snap | 8 +-- ...__case_with_multiple_labels_statement.snap | 2 +- ...gen_tests__case_with_ranges_statement.snap | 2 +- ...s__casted_literals_bool_code_gen_test.snap | 2 +- ..._tests__casted_literals_code_gen_test.snap | 2 +- ...ts__casted_literals_hex_code_gen_test.snap | 2 +- ...asted_literals_hex_ints_code_gen_test.snap | 2 +- ...__casted_literals_lreal_code_gen_test.snap | 2 +- ...s__casted_literals_real_code_gen_test.snap | 2 +- ...ests__class_member_access_from_method.snap | 2 +- ...__code_gen_tests__class_method_in_pou.snap | 4 +- ...sts__code_gen_tests__complex_pointers.snap | 2 +- ...ion_in_function_blocks_are_propagated.snap | 2 +- ...anged_type_declaration_are_propagated.snap | 4 +- ...gation_of_struct_fields_on_assignment.snap | 4 +- ..._contants_in_case_statements_resolved.snap | 2 +- ..._and_time_global_constants_initialize.snap | 34 +++++------ ...sts__code_gen_tests__date_comparisons.snap | 2 +- ..._gen_tests__different_case_references.snap | 2 +- ...lobal_variable_list_generates_nothing.snap | 2 +- ...ram_with_name_generates_void_function.snap | 2 +- ...pty_statements_dont_generate_anything.snap | 2 +- ...num_members_can_be_used_in_asignments.snap | 8 +-- ...__code_gen_tests__enums_are_generated.snap | 8 +-- ...ests__enums_custom_type_are_generated.snap | 10 ++-- ...xpression_list_as_array_initilization.snap | 9 +-- ...__external_function_called_in_program.snap | 2 +- ...global_variable_generates_as_external.snap | 6 +- ...ternal_program_global_var_is_external.snap | 2 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 4 +- ...ode_gen_tests__for_statement_continue.snap | 2 +- ...ts__code_gen_tests__for_statement_int.snap | 2 +- ...s__code_gen_tests__for_statement_lint.snap | 2 +- ...s__code_gen_tests__for_statement_sint.snap | 2 +- ...en_tests__for_statement_with_continue.snap | 2 +- ...de_gen_tests__for_statement_with_exit.snap | 2 +- ..._statement_with_references_steps_test.snap | 2 +- ..._tests__for_statement_with_steps_test.snap | 2 +- ...sts__for_statement_without_steps_test.snap | 2 +- ...n_tests__function_block_instance_call.snap | 4 +- ...unction_block_qualified_instance_call.snap | 6 +- ...on_call_with_same_name_as_return_type.snap | 2 +- ...gen_tests__function_called_in_program.snap | 2 +- ..._tests__function_called_when_shadowed.snap | 2 +- ...on_with_local_temp_var_initialization.snap | 2 +- ...ith_local_var_initialization_and_call.snap | 2 +- ...ion_with_parameters_called_in_program.snap | 2 +- ...with_two_parameters_called_in_program.snap | 2 +- ...lobal_variable_reference_is_generated.snap | 4 +- ...n_tests__if_elsif_else_generator_test.snap | 2 +- ...ts__code_gen_tests__if_generator_test.snap | 2 +- ...ts__if_with_expression_generator_test.snap | 2 +- ...gen_tests__inline_enums_are_generated.snap | 8 +-- ...n_tests__inline_structs_are_generated.snap | 5 +- ...rray_size_from_local_scoped_constants.snap | 8 +-- ...code_gen_tests__method_codegen_return.snap | 2 +- ...__code_gen_tests__method_codegen_void.snap | 2 +- ...do_not_result_in_an_under_or_overflow.snap | 2 +- ...code_gen_tests__multidim_array_access.snap | 2 +- ...gen_tests__multidim_array_declaration.snap | 2 +- ...__code_gen_tests__nested_array_access.snap | 2 +- ...e_gen_tests__nested_array_cube_writes.snap | 2 +- ...sted_array_cube_writes_negative_start.snap | 2 +- ...e_gen_tests__nested_array_declaration.snap | 2 +- ...ts__nested_function_called_in_program.snap | 2 +- ...n_tests__order_var_and_var_temp_block.snap | 2 +- ...__code_gen_tests__pass_inout_to_inout.snap | 6 +- ...s__code_gen_tests__pointers_generated.snap | 2 +- ..._gen_tests__program_called_in_program.snap | 4 +- ...gen_tests__program_with_and_statement.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._program_with_casted_chars_assignment.snap | 2 +- ...s__code_gen_tests__program_with_chars.snap | 2 +- ...n_tests__program_with_date_assignment.snap | 2 +- ..._assignment_whit_short_datatype_names.snap | 2 +- ...arison_assignment_generates_correctly.snap | 2 +- ...am_with_local_temp_var_initialization.snap | 4 +- ...ts__program_with_long_date_assignment.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._gen_tests__program_with_or_statement.snap | 2 +- ...en_tests__program_with_real_additions.snap | 2 +- ...n_tests__program_with_real_assignment.snap | 2 +- ...ts__program_with_real_cast_assignment.snap | 2 +- ...gram_with_signed_combined_expressions.snap | 2 +- ..._program_with_special_chars_in_string.snap | 2 +- ...tests__program_with_string_assignment.snap | 2 +- ...n_tests__program_with_time_assignment.snap | 2 +- ...__program_with_time_of_day_assignment.snap | 2 +- ...explicit_parameters_called_in_program.snap | 4 +- ...with_two_parameters_called_in_program.snap | 4 +- ...gram_with_var_inout_called_in_program.snap | 4 +- ...rogram_with_var_out_called_in_program.snap | 4 +- ..._with_var_out_called_mixed_in_program.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...es_generates_void_function_and_struct.snap | 2 +- ...gen_tests__program_with_xor_statement.snap | 2 +- ...fied_action_from_fb_called_in_program.snap | 4 +- ...fied_foreign_action_called_in_program.snap | 4 +- ...lified_local_action_called_in_program.snap | 2 +- ...ests__real_function_called_in_program.snap | 2 +- ...e_gen_tests__reference_qualified_name.snap | 6 +- ...nce_assignments_in_function_arguments.snap | 18 +++--- ...sts__code_gen_tests__repeat_statement.snap | 2 +- ...ts__returning_early_in_function_block.snap | 2 +- ...e_gen_tests__simple_case_i8_statement.snap | 2 +- ...code_gen_tests__simple_case_statement.snap | 2 +- ...code_gen_tests__structs_are_generated.snap | 9 ++- ...ts__structs_members_can_be_referenced.snap | 4 +- ..._gen_tests__sub_range_check_functions.snap | 2 +- ...nge_type_calls_check_function_missing.snap | 2 +- ...ype_calls_check_function_on_assigment.snap | 2 +- ...ariables_have_nano_seconds_resolution.snap | 2 +- ...enerates_in_separate_global_variables.snap | 8 +-- ..._gen_tests__typed_enums_are_generated.snap | 24 ++++---- ..._tests__typed_enums_are_used_properly.snap | 20 +++---- ...enums_with_initializers_are_generated.snap | 24 ++++---- ...ith_partly_initializers_are_generated.snap | 24 ++++---- ...ng_cast_statement_as_const_expression.snap | 2 +- ..._using_const_expression_in_range_type.snap | 6 +- ...s__using_global_consts_in_expressions.snap | 8 +-- ..._variable_with_same_name_as_data_type.snap | 2 +- ...de_gen_tests__while_loop_with_if_exit.snap | 2 +- ...ests__code_gen_tests__while_statement.snap | 2 +- ...ests__while_with_expression_statement.snap | 2 +- ...uctions_tests__compare_datetime_types.snap | 2 +- ...uction_functions_with_different_types.snap | 2 +- ...are_instructions_with_different_types.snap | 2 +- ...s_tests__pointer_compare_instructions.snap | 2 +- ...er_function_call_compare_instructions.snap | 2 +- ...tests__assigning_const_array_variable.snap | 4 +- ...ests__assigning_const_string_variable.snap | 4 +- ...ests__assigning_const_struct_variable.snap | 6 +- ...__debug_tests__dwarf_version_override.snap | 3 +- ...tests__debug_tests__global_alias_type.snap | 3 +- ..._global_var_array_added_to_debug_info.snap | 6 +- ...lobal_var_byteseq_added_to_debug_info.snap | 11 ++-- ...__global_var_enum_added_to_debug_info.snap | 20 +++---- ..._global_var_float_added_to_debug_info.snap | 5 +- ...s__global_var_int_added_to_debug_info.snap | 17 +++--- ...var_nested_struct_added_to_debug_info.snap | 7 +-- ...lobal_var_pointer_added_to_debug_info.snap | 3 +- ...global_var_string_added_to_debug_info.snap | 4 +- ...global_var_struct_added_to_debug_info.snap | 6 +- ..._test__qualified_reference_assignment.snap | 2 +- ...n_tests__access_string_via_byte_array.snap | 2 +- ...ssion_tests__allowed_assignable_types.snap | 2 +- ...sion_tests__builtin_function_call_adr.snap | 2 +- ...ts__builtin_function_call_lower_bound.snap | 4 +- ...ion_tests__builtin_function_call_move.snap | 2 +- ...sion_tests__builtin_function_call_mux.snap | 2 +- ...function_call_mux_with_aggregate_type.snap | 2 +- ...sion_tests__builtin_function_call_ref.snap | 2 +- ...sion_tests__builtin_function_call_sel.snap | 2 +- ...iltin_function_call_sel_as_expression.snap | 2 +- ...n_tests__builtin_function_call_sizeof.snap | 2 +- ...ts__builtin_function_call_upper_bound.snap | 4 +- ...uiltin_function_call_upper_bound_expr.snap | 6 +- ...s__calling_strings_in_function_return.snap | 2 +- ...ion_tests__cast_between_pointer_types.snap | 2 +- ...ion_tests__compare_date_time_literals.snap | 2 +- ...tests__hardware_access_assign_codegen.snap | 2 +- ...ession_tests__hardware_access_codegen.snap | 2 +- ...ression_tests__nested_call_statements.snap | 2 +- ...expression_tests__pointer_arithmetics.snap | 2 +- ...ts__pointer_arithmetics_function_call.snap | 2 +- ...ion_tests__structs_in_function_return.snap | 2 +- ..._tests__unary_expressions_can_be_real.snap | 2 +- ...necessary_casts_between_pointer_types.snap | 2 +- ...t_argument_literals_for_function_call.snap | 2 +- ...argument_references_for_function_call.snap | 2 +- ...ized_string_varargs_called_in_program.snap | 2 +- ..._with_sized_varargs_called_in_program.snap | 2 +- ...nction_with_varargs_called_in_program.snap | 2 +- ...literal_string_argument_passed_by_ref.snap | 2 +- ...tests__passing_a_string_to_a_function.snap | 2 +- ...g_a_string_to_a_function_as_reference.snap | 2 +- ...arguments_to_functions_by_ref_and_val.snap | 2 +- ...n__tests__function_tests__simple_call.snap | 2 +- ...on_tests__var_output_in_function_call.snap | 2 +- ...t__any_real_function_called_with_ints.snap | 2 +- ...unction_call_generates_real_type_call.snap | 2 +- ...nerics_test__generic_output_parameter.snap | 2 +- ...pe_defined_in_external_file_in_module.snap | 6 +- ...ed_in_external_file_no_deps_in_module.snap | 4 +- ...nitialized_in_external_file_in_module.snap | 2 +- ...n_tests__enum_referenced_in_fb_nested.snap | 20 +++---- ...ts__function_defined_in_external_file.snap | 14 ++--- ...sts__global_value_from_different_file.snap | 20 +++---- ...ct_with_custom_init_in_different_file.snap | 10 ++-- ...ccepts_empty_statement_as_input_param.snap | 4 +- ...cepts_empty_statement_as_output_param.snap | 4 +- ...ccepts_empty_statement_as_input_param.snap | 2 +- ...cepts_empty_statement_as_output_param.snap | 2 +- ...sts__function_all_parameters_assigned.snap | 2 +- ...function_default_value_parameter_type.snap | 2 +- ...ests__function_empty_inout_assignment.snap | 2 +- ...ests__function_empty_input_assignment.snap | 2 +- ...sts__function_empty_output_assignment.snap | 2 +- ...empty_output_default_value_assignment.snap | 2 +- ...ts__function_missing_inout_assignment.snap | 2 +- ...ts__function_missing_input_assignment.snap | 2 +- ...issing_input_default_value_assignment.snap | 2 +- ...s__function_missing_output_assignment.snap | 2 +- ...ssing_output_default_value_assignment.snap | 2 +- ...unction_block_pointer_are_assigned_to.snap | 4 +- ...ccepts_empty_statement_as_input_param.snap | 4 +- ...cepts_empty_statement_as_output_param.snap | 4 +- ...gram_all_parameters_assigned_explicit.snap | 4 +- ...gram_all_parameters_assigned_implicit.snap | 4 +- ...tests__program_empty_inout_assignment.snap | 4 +- ...sts__program_missing_input_assignment.snap | 4 +- ...ts__program_missing_output_assignment.snap | 4 +- ...var_in_out_params_can_be_out_of_order.snap | 4 +- ...taccess_generated_as_rsh_and_trunc_i1.snap | 2 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 2 +- ...access_generated_as_rsh_and_trunc_i32.snap | 2 +- ...t_codegen_test__nested_bitwise_access.snap | 2 +- ...n_test__variable_based_bitwise_access.snap | 2 +- ...access_generated_as_rsh_and_trunc_i16.snap | 2 +- ..._casted_string_assignment_uses_memcpy.snap | 2 +- ...g_generic_string_should_return_by_ref.snap | 2 +- ...ts__function_returns_a_literal_string.snap | 2 +- ...es_string_paramter_and_returns_string.snap | 2 +- ...ialization_of_multi_dim_string_arrays.snap | 5 +- ...__string_tests__program_string_output.snap | 4 +- ...program_with_casted_string_assignment.snap | 2 +- ...__program_with_string_type_assignment.snap | 6 +- ...sts__string_tests__simple_string_test.snap | 6 +- ...ing_tests__string_function_parameters.snap | 2 +- ...ariable_length_strings_can_be_created.snap | 2 +- ...trings_using_constants_can_be_created.snap | 6 +- ...ests__variable_string_assignment_test.snap | 2 +- ...string_tests__vartmp_string_init_test.snap | 2 +- ...ed_datatypes_respect_conversion_rules.snap | 2 +- ...r_than_int_promote_the_second_operand.snap | 2 +- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...all_sint_expressions_fallback_to_dint.snap | 2 +- ...at_and_double_mix_converted_to_double.snap | 2 +- ...m_test__float_assigned_to_int_is_cast.snap | 2 +- ...t__float_assinged_to_double_to_double.snap | 2 +- ...m_test__int_assigned_to_float_is_cast.snap | 2 +- ...an_byte_promoted_on_compare_statement.snap | 2 +- ...bigger_than_float_converted_to_double.snap | 2 +- ..._or_equal_to_float_converted_to_float.snap | 2 +- ...ariadic_functions_without_declaration.snap | 2 +- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...e_calls_with_differently_sized_arrays.snap | 2 +- ...al_variable_passed_to_function_as_vla.snap | 4 +- ...ruct_is_generated_for_call_statements.snap | 2 +- ...sts__vla_tests__multi_dimensional_vla.snap | 2 +- ...en__tests__vla_tests__vla_read_access.snap | 2 +- ...default_value_compile_time_evaluation.snap | 10 ++-- ...default_value_compile_time_evaluation.snap | 18 +++--- ...values_are_transitive_for_range_types.snap | 11 ++-- src/tests/adr/arrays_adr.rs | 14 ++--- src/tests/adr/enum_adr.rs | 58 +++++++++---------- src/tests/adr/pou_adr.rs | 20 +++---- src/tests/adr/strings_adr.rs | 12 ++-- src/tests/adr/structs_adr.rs | 22 +++---- src/tests/adr/vla_adr.rs | 6 +- ...__integration__cfc__ir__actions_debug.snap | 2 +- ...egration__cfc__ir__conditional_return.snap | 2 +- ...r__conditional_return_evaluating_true.snap | 2 +- ...tional_return_evaluating_true_negated.snap | 2 +- ...sts__integration__cfc__ir__jump_debug.snap | 2 +- ...tegration__cfc__ir__sink_source_debug.snap | 2 +- 347 files changed, 780 insertions(+), 849 deletions(-) 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/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: From f880974595ca6d5500c85a64234e2d547fe93f35 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 18 Apr 2024 12:53:12 +0200 Subject: [PATCH 05/40] section_mangler: Change API for `SectionMangler::with_return_type` --- compiler/section_mangler/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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."), } } From 15b8704583902985fc73bbd407d33d4da716a139 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 18 Apr 2024 12:54:05 +0200 Subject: [PATCH 06/40] codegen: Propagate errors better when creating section names --- src/codegen/generators/pou_generator.rs | 22 ++++++++++++-------- src/codegen/generators/section_names.rs | 11 ++++++---- src/codegen/generators/variable_generator.rs | 5 ++--- 3 files changed, 22 insertions(+), 16 deletions(-) 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 6456a9e20a..08b99db2fb 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -173,11 +173,10 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { let section = section_mangler::SectionMangler::variable( global_variable.get_name(), - // FIXME: Can we unwrap here? section_names::mangle_type( self.global_index, - self.global_index.get_effective_type_by_name(global_variable.get_type_name()).unwrap(), - ), + self.global_index.get_effective_type_by_name(global_variable.get_type_name())?, + )?, ) .mangle(); From 823dc5442211a78ef8bf0c933bd4313fc8cf298d Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 14:25:50 +0100 Subject: [PATCH 07/40] section_mangler: Encode structs and enums --- compiler/section_mangler/src/lib.rs | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index db20711f74..3717f025b7 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -160,7 +160,9 @@ pub enum Type { semantic_size: Option, }, /// Encoded as `f` - Float { size: u32 }, + Float { + size: u32, + }, /// Encoded as `s` String { size: usize, // FIXME: Is that okay? will all the constant expressions be folded at that point? Can we have TypeSize::Undetermined still? @@ -172,23 +174,12 @@ pub enum Type { // TODO: Is changing the `auto_deref` mode an ABI break? // auto_deref: bool, }, - - // --- UNIMPLEMENTED - - // FIXME: Do we need any info here? How are structs codegened? Struct { - // name: TypeId, - // members: Vec, - // source: StructSource, + members: Vec, }, - - // FIXME: Same here Enum { - // name: TypeId, - // referenced_type: TypeId, - // // TODO: Would it make sense to store `VariableIndexEntry`s similar to how the `Struct` variant does? - // // This would allow us to pattern match in the index `find_member` method - // elements: Vec, + referenced_type: Box, + elements: usize, }, Array { inner: Box, @@ -227,8 +218,15 @@ impl fmt::Display for Type { Type::String { size, encoding } => write!(f, "s{encoding}{size}",), Type::Pointer { inner } => write!(f, "p{}", inner), // -- Unimplemented - Type::Struct {} => todo!(), - Type::Enum {} => todo!(), + Type::Struct { members } => { + write!( + f, + "r{}{}", + members.len(), + members.iter().fold(String::new(), |acc, m| format!("{acc}{m}")) + ) + } + Type::Enum { referenced_type, elements } => write!(f, "e{elements}{referenced_type}"), Type::Array { .. } => todo!(), Type::SubRange {} => todo!(), Type::Alias {} => todo!(), From 28b6b41bbc1a7e265913a78f3dfcebd45c6a6c65 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 14:25:59 +0100 Subject: [PATCH 08/40] codegen: Mangle struct and enum types properly --- src/codegen/generators/section_names.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/codegen/generators/section_names.rs b/src/codegen/generators/section_names.rs index 0d7cefaa1c..8006866fac 100644 --- a/src/codegen/generators/section_names.rs +++ b/src/codegen/generators/section_names.rs @@ -4,6 +4,8 @@ use plc_diagnostics::diagnostics::Diagnostic; use section_mangler::{StringEncoding as SectionStringEncoding, Type}; pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> Result { + let access_inner = |ty_name| mangle_type(index, index.get_effective_type_by_name(ty_name)?); + // 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 @@ -23,8 +25,20 @@ pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> Result Type::Pointer { - inner: Box::new(mangle_type(index, index.get_effective_type_by_name(inner_type_name)?)?), + DataTypeInformation::Pointer { inner_type_name, .. } => { + Type::Pointer { inner: Box::new(access_inner(inner_type_name)?) } + } + DataTypeInformation::Enum { referenced_type, variants, .. } => { + Type::Enum { referenced_type: Box::new(access_inner(referenced_type)?), elements: variants.len() } + } + DataTypeInformation::Struct { members, .. } => Type::Struct { + members: members.iter().try_fold(Vec::new(), |mut acc, m| -> Result, Diagnostic> { + let inner = access_inner(m.get_type_name())?; + + acc.push(inner); + + Ok(acc) + })?, }, // 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 From 06ece680b8f25da68e9dd59d3bfeb65bc3a4216f Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 15:25:46 +0100 Subject: [PATCH 09/40] section-mangler: Add base for handling arrays --- compiler/section_mangler/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 3717f025b7..3d4c64e6cc 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -217,7 +217,6 @@ impl fmt::Display for Type { Type::Float { size } => write!(f, "f{size}"), Type::String { size, encoding } => write!(f, "s{encoding}{size}",), Type::Pointer { inner } => write!(f, "p{}", inner), - // -- Unimplemented Type::Struct { members } => { write!( f, @@ -227,7 +226,8 @@ impl fmt::Display for Type { ) } Type::Enum { referenced_type, elements } => write!(f, "e{elements}{referenced_type}"), - Type::Array { .. } => todo!(), + Type::Array { inner } => write!(f, "a{inner}"), + // -- Unimplemented Type::SubRange {} => todo!(), Type::Alias {} => todo!(), Type::Generic {} => todo!(), From 2e628eafbc521a2f842dd94f9fafc0be0bc26145 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 15:26:04 +0100 Subject: [PATCH 10/40] codegen: Handle more complex types in mangle_type --- src/codegen/generators/section_names.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/codegen/generators/section_names.rs b/src/codegen/generators/section_names.rs index 8006866fac..70a1f7d81e 100644 --- a/src/codegen/generators/section_names.rs +++ b/src/codegen/generators/section_names.rs @@ -40,6 +40,18 @@ pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> Result { + Type::Array { inner: Box::new(access_inner(inner_type_name)?) } + } + // FIXME: Is that correct? + // For code generation, the actual range does not matter - it is not a breaking change + // if a variable's range changes, at least not for codegen, since the underlying type will stay + // the same. Therefore, only encode it as its underlying type. + DataTypeInformation::SubRange { referenced_type, .. } => access_inner(referenced_type)?, + DataTypeInformation::Generic { .. } | DataTypeInformation::Alias { .. } => { + // FIXME: Is that correct? + unreachable!("generic types and type aliases should not exist at codegen") + } // 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. From 8c8f973f966a46a20e7918beaf9f8a46a6182230 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 15:36:08 +0100 Subject: [PATCH 11/40] codegen: Mangle type aliases properly --- src/codegen/generators/section_names.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/codegen/generators/section_names.rs b/src/codegen/generators/section_names.rs index 70a1f7d81e..15e4b48064 100644 --- a/src/codegen/generators/section_names.rs +++ b/src/codegen/generators/section_names.rs @@ -47,12 +47,14 @@ pub fn mangle_type(index: &Index, ty: &typesystem::DataType) -> Result access_inner(referenced_type)?, - DataTypeInformation::Generic { .. } | DataTypeInformation::Alias { .. } => { + DataTypeInformation::SubRange { referenced_type, .. } + // Similarly, we do not care about the alias - only the type which is being codegen'd + | DataTypeInformation::Alias { referenced_type, .. } => access_inner(referenced_type)?, + DataTypeInformation::Generic { .. } => { // FIXME: Is that correct? - unreachable!("generic types and type aliases should not exist at codegen") + unreachable!("generic types should not exist at codegen") } - // FIXME: For now, encode all unknown types as "void" since this is not required for + // 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, From 54e08eb7604d38c8533b42b9ad32b47fdec6e336 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 15:37:07 +0100 Subject: [PATCH 12/40] rusty: Accept snapshots with new section names --- ...n_different_locations_with_debug_info.snap | 4 +- ...files__multiple_files_with_debug_info.snap | 4 +- ...iles__multiple_source_files_generated.snap | 4 +- ...l_is_not_added_as_external_subroutine.snap | 4 +- ...g__implementation_added_as_subroutine.snap | 4 +- ...on_function_pous_have_struct_as_param.snap | 4 +- ...temp_variables_in_pous_added_as_local.snap | 4 +- ...initializer_gets_declared_initializer.snap | 2 +- ..._initializer_gets_default_initializer.snap | 2 +- ...lues_in_global_variables_out_of_order.snap | 6 +- ...tializers__uninitialized_global_array.snap | 2 +- ..._class_struct_initialized_in_function.snap | 6 +- ...global_variables_in_inline_assignment.snap | 8 +-- ..._block_struct_initialized_in_function.snap | 6 +- ..._function_return_value_is_initialized.snap | 6 +- ..._is_initialized_with_type_initializer.snap | 6 +- ...alue_with_initializers_is_initialized.snap | 10 ++-- ...e_without_initializers_is_initialized.snap | 8 +-- ...tial_constant_values_in_pou_variables.snap | 2 +- ...ial_values_in_array_of_array_variable.snap | 2 +- ..._initial_values_in_function_block_pou.snap | 4 +- ...lizers__initial_values_in_program_pou.snap | 2 +- ...s__initialized_array_type_in_function.snap | 2 +- ...for_struct_initialization_in_function.snap | 2 +- ..._for_struct_initialization_in_program.snap | 4 +- ...nt_functions_are_referenced_correctly.snap | 8 +-- ...imilar_names_are_referenced_correctly.snap | 16 ++--- ...izers__array_of_struct_initialization.snap | 10 ++-- ...t_variable_using_multiplied_statement.snap | 6 +- ...th_inline_initializer_are_initialized.snap | 30 +++++----- ...xpression_list_as_array_initilization.snap | 6 +- ...zers__incomplete_array_initialization.snap | 2 +- ...initialization_with_custom_init_value.snap | 2 +- ...s__initial_nested_struct_delayed_init.snap | 8 +-- ...y_variable_using_multiplied_statement.snap | 8 +-- ...lizers__initial_values_in_fb_variable.snap | 4 +- ...ues_in_multi_dimension_array_variable.snap | 2 +- ...values_in_single_dimension_array_type.snap | 4 +- ...es_in_single_dimension_array_variable.snap | 16 ++--- ...izers__initial_values_in_struct_types.snap | 4 +- ...rs__initial_values_in_struct_variable.snap | 6 +- ...alues_in_struct_variable_missing_init.snap | 6 +- ...ers__initial_values_in_sub_range_type.snap | 2 +- ..._const_struct_will_get_default_values.snap | 6 +- ...array_of_structs_are_zero_initialized.snap | 6 +- ...t_initial_values_different_data_types.snap | 4 +- ...on_uses_types_default_if_not_provided.snap | 4 +- ...alizer_uses_fallback_to_field_default.snap | 4 +- ...uct_with_one_field_can_be_initialized.snap | 4 +- src/codegen/tests/parameters_tests.rs | 24 ++++---- ...enerates_in_separate_global_variables.snap | 2 +- ...sts__accessing_nested_array_in_struct.snap | 4 +- ...e_gen_tests__accessing_nested_structs.snap | 6 +- ...e_gen_tests__action_called_in_program.snap | 2 +- ...sts__array_of_cast_int_type_generated.snap | 2 +- ..._int_non_zero_negative_type_generated.snap | 2 +- ..._array_of_int_non_zero_type_generated.snap | 2 +- ...en_tests__array_of_int_type_generated.snap | 2 +- ...ode_gen_tests__array_of_int_type_used.snap | 2 +- ...ype_with_non_zero_negative_start_used.snap | 2 +- ..._of_int_type_with_non_zero_start_used.snap | 2 +- ...d_variable_declaration_is_initialized.snap | 6 +- ...mber_of_another_struct_is_initialized.snap | 6 +- ..._code_gen_tests__arrays_are_generated.snap | 4 +- ..._with_global_const_size_are_generated.snap | 10 ++-- ...th_enum_expressions_in_case_selectors.snap | 6 +- ...__case_with_multiple_labels_statement.snap | 2 +- ...gen_tests__case_with_ranges_statement.snap | 2 +- ...s__casted_literals_bool_code_gen_test.snap | 2 +- ..._tests__casted_literals_code_gen_test.snap | 2 +- ...ts__casted_literals_hex_code_gen_test.snap | 2 +- ...asted_literals_hex_ints_code_gen_test.snap | 2 +- ...__casted_literals_lreal_code_gen_test.snap | 2 +- ...s__casted_literals_real_code_gen_test.snap | 2 +- ...ests__class_member_access_from_method.snap | 2 +- ...__code_gen_tests__class_method_in_pou.snap | 4 +- ...sts__code_gen_tests__complex_pointers.snap | 2 +- ...ion_in_function_blocks_are_propagated.snap | 2 +- ...anged_type_declaration_are_propagated.snap | 2 +- ...gation_of_struct_fields_on_assignment.snap | 4 +- ..._contants_in_case_statements_resolved.snap | 2 +- ..._and_time_global_constants_initialize.snap | 2 +- ...sts__code_gen_tests__date_comparisons.snap | 2 +- ..._gen_tests__different_case_references.snap | 2 +- ...lobal_variable_list_generates_nothing.snap | 2 +- ...ram_with_name_generates_void_function.snap | 2 +- ...pty_statements_dont_generate_anything.snap | 2 +- ...num_members_can_be_used_in_asignments.snap | 8 +-- ...__code_gen_tests__enums_are_generated.snap | 8 +-- ...ests__enums_custom_type_are_generated.snap | 10 ++-- ...xpression_list_as_array_initilization.snap | 6 +- ...__external_function_called_in_program.snap | 2 +- ...global_variable_generates_as_external.snap | 2 +- ...ternal_program_global_var_is_external.snap | 2 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 4 +- ...ode_gen_tests__for_statement_continue.snap | 2 +- ...ts__code_gen_tests__for_statement_int.snap | 2 +- ...s__code_gen_tests__for_statement_lint.snap | 2 +- ...s__code_gen_tests__for_statement_sint.snap | 2 +- ...en_tests__for_statement_with_continue.snap | 2 +- ...de_gen_tests__for_statement_with_exit.snap | 2 +- ..._statement_with_references_steps_test.snap | 2 +- ..._tests__for_statement_with_steps_test.snap | 2 +- ...sts__for_statement_without_steps_test.snap | 2 +- ...n_tests__function_block_instance_call.snap | 4 +- ...unction_block_qualified_instance_call.snap | 6 +- ...on_call_with_same_name_as_return_type.snap | 2 +- ...gen_tests__function_called_in_program.snap | 2 +- ..._tests__function_called_when_shadowed.snap | 2 +- ...on_with_local_temp_var_initialization.snap | 2 +- ...ith_local_var_initialization_and_call.snap | 2 +- ...ion_with_parameters_called_in_program.snap | 2 +- ...with_two_parameters_called_in_program.snap | 2 +- ...lobal_variable_reference_is_generated.snap | 2 +- ...n_tests__if_elsif_else_generator_test.snap | 2 +- ...ts__code_gen_tests__if_generator_test.snap | 2 +- ...ts__if_with_expression_generator_test.snap | 2 +- ...gen_tests__inline_enums_are_generated.snap | 8 +-- ...n_tests__inline_structs_are_generated.snap | 4 +- ...rray_size_from_local_scoped_constants.snap | 2 +- ...code_gen_tests__method_codegen_return.snap | 2 +- ...__code_gen_tests__method_codegen_void.snap | 2 +- ...do_not_result_in_an_under_or_overflow.snap | 2 +- ...code_gen_tests__multidim_array_access.snap | 2 +- ...gen_tests__multidim_array_declaration.snap | 2 +- ...__code_gen_tests__nested_array_access.snap | 2 +- ...e_gen_tests__nested_array_cube_writes.snap | 2 +- ...sted_array_cube_writes_negative_start.snap | 2 +- ...e_gen_tests__nested_array_declaration.snap | 2 +- ...ts__nested_function_called_in_program.snap | 2 +- ...n_tests__order_var_and_var_temp_block.snap | 2 +- ...__code_gen_tests__pass_inout_to_inout.snap | 6 +- ...s__pointer_and_array_access_to_in_out.snap | 2 +- ...s__code_gen_tests__pointers_generated.snap | 2 +- ..._gen_tests__program_called_in_program.snap | 4 +- ...gen_tests__program_with_and_statement.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._program_with_casted_chars_assignment.snap | 2 +- ...s__code_gen_tests__program_with_chars.snap | 2 +- ...n_tests__program_with_date_assignment.snap | 2 +- ..._assignment_whit_short_datatype_names.snap | 2 +- ...arison_assignment_generates_correctly.snap | 2 +- ...am_with_local_temp_var_initialization.snap | 4 +- ...ts__program_with_long_date_assignment.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._gen_tests__program_with_or_statement.snap | 2 +- ...en_tests__program_with_real_additions.snap | 2 +- ...n_tests__program_with_real_assignment.snap | 2 +- ...ts__program_with_real_cast_assignment.snap | 2 +- ...gram_with_signed_combined_expressions.snap | 2 +- ..._program_with_special_chars_in_string.snap | 2 +- ...tests__program_with_string_assignment.snap | 2 +- ...n_tests__program_with_time_assignment.snap | 2 +- ...__program_with_time_of_day_assignment.snap | 2 +- ...explicit_parameters_called_in_program.snap | 4 +- ...with_two_parameters_called_in_program.snap | 4 +- ...gram_with_var_inout_called_in_program.snap | 4 +- ...rogram_with_var_out_called_in_program.snap | 4 +- ..._with_var_out_called_mixed_in_program.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...es_generates_void_function_and_struct.snap | 2 +- ...gen_tests__program_with_xor_statement.snap | 2 +- ...fied_action_from_fb_called_in_program.snap | 4 +- ...fied_foreign_action_called_in_program.snap | 4 +- ...lified_local_action_called_in_program.snap | 2 +- ...ests__real_function_called_in_program.snap | 2 +- ...e_gen_tests__reference_qualified_name.snap | 8 +-- ...nce_assignments_in_function_arguments.snap | 14 ++--- ...sts__code_gen_tests__repeat_statement.snap | 2 +- ...ts__returning_early_in_function_block.snap | 2 +- ...e_gen_tests__simple_case_i8_statement.snap | 2 +- ...code_gen_tests__simple_case_statement.snap | 2 +- ...code_gen_tests__structs_are_generated.snap | 8 +-- ...ts__structs_members_can_be_referenced.snap | 4 +- ..._gen_tests__sub_range_check_functions.snap | 2 +- ...nge_type_calls_check_function_missing.snap | 2 +- ...ype_calls_check_function_on_assigment.snap | 2 +- ...ariables_have_nano_seconds_resolution.snap | 2 +- ...enerates_in_separate_global_variables.snap | 2 +- ..._gen_tests__typed_enums_are_generated.snap | 24 ++++---- ..._tests__typed_enums_are_used_properly.snap | 20 +++---- ...enums_with_initializers_are_generated.snap | 24 ++++---- ...ith_partly_initializers_are_generated.snap | 22 +++---- ...ng_cast_statement_as_const_expression.snap | 2 +- ..._using_const_expression_in_range_type.snap | 2 +- ...s__using_global_consts_in_expressions.snap | 2 +- ..._variable_with_same_name_as_data_type.snap | 2 +- ...de_gen_tests__while_loop_with_if_exit.snap | 2 +- ...ests__code_gen_tests__while_statement.snap | 2 +- ...ests__while_with_expression_statement.snap | 2 +- ...uctions_tests__compare_datetime_types.snap | 2 +- ...uction_functions_with_different_types.snap | 2 +- ...are_instructions_with_different_types.snap | 2 +- ...s_tests__pointer_compare_instructions.snap | 2 +- ...er_function_call_compare_instructions.snap | 2 +- ...tests__assigning_const_array_variable.snap | 4 +- ...ests__assigning_const_string_variable.snap | 2 +- ...ests__assigning_const_struct_variable.snap | 6 +- ..._global_var_array_added_to_debug_info.snap | 6 +- ...__global_var_enum_added_to_debug_info.snap | 20 +++---- ...var_nested_struct_added_to_debug_info.snap | 6 +- ...global_var_struct_added_to_debug_info.snap | 6 +- ..._test__qualified_reference_assignment.snap | 2 +- ...n_tests__access_string_via_byte_array.snap | 2 +- ...ssion_tests__allowed_assignable_types.snap | 2 +- ...sion_tests__builtin_function_call_adr.snap | 2 +- ...ts__builtin_function_call_lower_bound.snap | 6 +- ...ion_tests__builtin_function_call_move.snap | 2 +- ...sion_tests__builtin_function_call_mux.snap | 2 +- ...function_call_mux_with_aggregate_type.snap | 2 +- ...sion_tests__builtin_function_call_ref.snap | 2 +- ...sion_tests__builtin_function_call_sel.snap | 2 +- ...iltin_function_call_sel_as_expression.snap | 2 +- ...n_tests__builtin_function_call_sizeof.snap | 2 +- ...ts__builtin_function_call_upper_bound.snap | 6 +- ...uiltin_function_call_upper_bound_expr.snap | 6 +- ...s__calling_strings_in_function_return.snap | 2 +- ...ion_tests__cast_between_pointer_types.snap | 2 +- ...ion_tests__compare_date_time_literals.snap | 2 +- ...tests__hardware_access_assign_codegen.snap | 2 +- ...ession_tests__hardware_access_codegen.snap | 2 +- ...ression_tests__nested_call_statements.snap | 2 +- ...expression_tests__pointer_arithmetics.snap | 2 +- ...ts__pointer_arithmetics_function_call.snap | 2 +- ...ion_tests__structs_in_function_return.snap | 4 +- ..._tests__unary_expressions_can_be_real.snap | 2 +- ...necessary_casts_between_pointer_types.snap | 2 +- ...ests__argument_fed_by_ref_then_by_val.snap | 4 +- ...t_argument_literals_for_function_call.snap | 2 +- ...argument_references_for_function_call.snap | 2 +- ...ized_string_varargs_called_in_program.snap | 2 +- ..._with_sized_varargs_called_in_program.snap | 2 +- ...nction_with_varargs_called_in_program.snap | 2 +- ...literal_string_argument_passed_by_ref.snap | 2 +- ...tests__passing_a_string_to_a_function.snap | 2 +- ...g_a_string_to_a_function_as_reference.snap | 2 +- ...arguments_to_functions_by_ref_and_val.snap | 2 +- ...n__tests__function_tests__simple_call.snap | 2 +- ...on_tests__var_output_in_function_call.snap | 2 +- ...t__any_real_function_called_with_ints.snap | 2 +- ...unction_call_generates_real_type_call.snap | 2 +- ...nerics_test__generic_output_parameter.snap | 2 +- ...pe_defined_in_external_file_in_module.snap | 6 +- ...ed_in_external_file_no_deps_in_module.snap | 4 +- ...nitialized_in_external_file_in_module.snap | 2 +- ...n_tests__enum_referenced_in_fb_nested.snap | 20 +++---- ...ts__function_defined_in_external_file.snap | 14 ++--- ...sts__global_value_from_different_file.snap | 2 +- ...ct_with_custom_init_in_different_file.snap | 10 ++-- ...ccepts_empty_statement_as_input_param.snap | 4 +- ...cepts_empty_statement_as_output_param.snap | 4 +- ...ccepts_empty_statement_as_input_param.snap | 2 +- ...cepts_empty_statement_as_output_param.snap | 2 +- ...sts__function_all_parameters_assigned.snap | 2 +- ...function_default_value_parameter_type.snap | 2 +- ...ests__function_empty_inout_assignment.snap | 2 +- ...ests__function_empty_input_assignment.snap | 2 +- ...sts__function_empty_output_assignment.snap | 2 +- ...empty_output_default_value_assignment.snap | 2 +- ...ts__function_missing_inout_assignment.snap | 2 +- ...ts__function_missing_input_assignment.snap | 2 +- ...issing_input_default_value_assignment.snap | 2 +- ...s__function_missing_output_assignment.snap | 2 +- ...ssing_output_default_value_assignment.snap | 2 +- ...unction_block_pointer_are_assigned_to.snap | 4 +- ...ccepts_empty_statement_as_input_param.snap | 4 +- ...cepts_empty_statement_as_output_param.snap | 4 +- ...gram_all_parameters_assigned_explicit.snap | 4 +- ...gram_all_parameters_assigned_implicit.snap | 4 +- ...tests__program_empty_inout_assignment.snap | 4 +- ...sts__program_missing_input_assignment.snap | 4 +- ...ts__program_missing_output_assignment.snap | 4 +- ...var_in_out_params_can_be_out_of_order.snap | 4 +- ...taccess_generated_as_rsh_and_trunc_i1.snap | 2 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 2 +- ...access_generated_as_rsh_and_trunc_i32.snap | 2 +- ...t_codegen_test__nested_bitwise_access.snap | 2 +- ...n_test__variable_based_bitwise_access.snap | 2 +- ...access_generated_as_rsh_and_trunc_i16.snap | 2 +- ..._casted_string_assignment_uses_memcpy.snap | 2 +- ...g_generic_string_should_return_by_ref.snap | 2 +- ...ts__function_returns_a_literal_string.snap | 2 +- ...es_string_paramter_and_returns_string.snap | 2 +- ...rings_should_be_collected_as_literals.snap | 2 +- ...ialization_of_multi_dim_string_arrays.snap | 4 +- ...__string_tests__program_string_output.snap | 4 +- ...program_with_casted_string_assignment.snap | 2 +- ...__program_with_string_type_assignment.snap | 2 +- ...ing_tests__string_function_parameters.snap | 2 +- ...stant_var_string_should_be_memcpyable.snap | 2 +- ...ar_string_should_be_memcpyable_nonref.snap | 2 +- ...ariable_length_strings_can_be_created.snap | 2 +- ...trings_using_constants_can_be_created.snap | 2 +- ...ests__variable_string_assignment_test.snap | 2 +- ...string_tests__vartmp_string_init_test.snap | 2 +- ...ed_datatypes_respect_conversion_rules.snap | 2 +- ...r_than_int_promote_the_second_operand.snap | 2 +- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...all_sint_expressions_fallback_to_dint.snap | 2 +- ...at_and_double_mix_converted_to_double.snap | 2 +- ...m_test__float_assigned_to_int_is_cast.snap | 2 +- ...t__float_assinged_to_double_to_double.snap | 2 +- ...m_test__int_assigned_to_float_is_cast.snap | 2 +- ...an_byte_promoted_on_compare_statement.snap | 2 +- ...bigger_than_float_converted_to_double.snap | 2 +- ..._or_equal_to_float_converted_to_float.snap | 2 +- ...ariadic_functions_without_declaration.snap | 2 +- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...e_calls_with_differently_sized_arrays.snap | 4 +- ...al_variable_passed_to_function_as_vla.snap | 6 +- ...ruct_is_generated_for_call_statements.snap | 4 +- ...sts__vla_tests__multi_dimensional_vla.snap | 4 +- ...en__tests__vla_tests__vla_read_access.snap | 4 +- ...default_value_compile_time_evaluation.snap | 8 +-- ...default_value_compile_time_evaluation.snap | 8 +-- ...values_are_transitive_for_range_types.snap | 4 +- src/tests/adr/arrays_adr.rs | 14 ++--- src/tests/adr/enum_adr.rs | 58 +++++++++---------- src/tests/adr/pou_adr.rs | 22 +++---- src/tests/adr/strings_adr.rs | 4 +- src/tests/adr/structs_adr.rs | 22 +++---- src/tests/adr/vla_adr.rs | 12 ++-- ...__integration__cfc__ir__actions_debug.snap | 2 +- ...egration__cfc__ir__conditional_return.snap | 2 +- ...r__conditional_return_evaluating_true.snap | 2 +- ...tional_return_evaluating_true_negated.snap | 2 +- ...sts__integration__cfc__ir__jump_debug.snap | 2 +- ...tegration__cfc__ir__sink_source_debug.snap | 2 +- 335 files changed, 670 insertions(+), 670 deletions(-) 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 1e6d9d5d84..f222c8c139 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, section "var-mainProg_instance:v", !dbg !0 +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0", !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, section "var-mainProg_instance:v", !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0", !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 f4e07003b1..7d0ea4dbac 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, section "var-mainProg_instance:v", !dbg !0 +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0", !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, section "var-mainProg_instance:v", !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0", !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 3caea93db8..af0669184c 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, section "var-mainProg_instance:v" +@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0" define i16 @main() section "fn-main:i16" { entry: @@ -25,7 +25,7 @@ source_filename = "external_file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:v" +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0" define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { entry: 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 01893fd7c4..8716e8c483 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, section "var-myPrg_instance:v", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !5 +@myPrg_instance = external global %myPrg, section "var-myPrg_instance:r0", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r0", !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 7d396b08f5..aeb8159021 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, section "var-myPrg_instance:v", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !5 +@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:r0", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r0", !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 a5be82a1c0..72144e9bdb 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, section "var-myProg_instance:v", !dbg !0 -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v", !dbg !7 +@myProg_instance = global %myProg zeroinitializer, section "var-myProg_instance:r1i32", !dbg !0 +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32", !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__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 0662946bc3..f5f3b5abdf 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, section "var-myPrg_instance:v", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:v", !dbg !9 +@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:r3i32i32i32", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r3i32i32i32", !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 e853d64321..bd08390653 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 }, section "var-__commands__init:v" +@__commands__init = unnamed_addr constant %commands { i8 1, i8 0 }, section "var-__commands__init:r2u8u8" 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 853cf1cfc2..4f46ab41ec 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, section "var-__commands__init:v" +@__commands__init = unnamed_addr constant %commands zeroinitializer, section "var-__commands__init:r2u8u8" @__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_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 45ac8563ca..9c3506940d 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 }, 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" +@x = global %MyFB { i16 77 }, section "var-x:r1i16" +@__MyFB__init = unnamed_addr constant %MyFB { i16 77 }, section "var-__MyFB__init:r1i16" +@prg_instance = global %prg { %MyFB { i16 77 } }, section "var-prg_instance:r1r1i16" 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 47f6e67f71..80a3245948 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [2 x i8] zeroinitializer, section "var-a:v" +@a = global [2 x i8] zeroinitializer, section "var-a:au8" 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 ccaeb66ab5..ea3ce2be28 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 }, section "var-__fb__init:v" -@main_instance = global %main { %fb { i16 9 } }, section "var-main_instance:v" +@__fb__init = unnamed_addr constant %fb { i16 9 }, section "var-__fb__init:r1i16" +@main_instance = global %main { %fb { i16 9 } }, section "var-main_instance:r1r1i16" define void @fb(%fb* %0) section "fn-fb:v" { entry: @@ -17,7 +17,7 @@ entry: ret void } -define i32 @func(%fb* %0) section "fn-func:i32[v]" { +define i32 @func(%fb* %0) section "fn-func:i32[r1i16]" { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 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 491a95ed7c..a6ef37ca32 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 @@ -6,10 +6,10 @@ expression: function source_filename = "main" @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" +@__foo_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" +@__bar_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" +@__foo_position.y = unnamed_addr constant i32 2, section "var-y:e2i32" +@__bar_position.y = unnamed_addr constant i32 4, section "var-y:e2i32" 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 b5ee8c7258..39afc2b803 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,15 +8,15 @@ source_filename = "main" %fb = type {} %main = type { %fb } -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r0" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1r0" define void @fb(%fb* %0) section "fn-fb:v" { entry: ret void } -define i32 @func(%fb* %0) section "fn-func:i32[v]" { +define i32 @func(%fb* %0) section "fn-func:i32[r0]" { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 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 55750e7c54..2293bdca13 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, section "var-__MyStruct__init:v" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i16" define i16 @foo_int() section "fn-foo_int:i16" { entry: @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:v" { +define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_struct(%MyStruct* %0) section "fn-foo_struct:v" { +define void @foo_struct(%MyStruct* %0) section "fn-foo_struct:r2i32i16" { entry: %foo_struct = alloca %MyStruct*, align 8 store %MyStruct* %0, %MyStruct** %foo_struct, align 8 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 2dbcf8c413..e7368126fe 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,10 +7,10 @@ source_filename = "main" %main = type { [4 x i32], [4 x i32] } -@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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32ai32" +@__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__myArray__init:ai32" -define void @target([4 x i32]* %0) section "fn-target:v" { +define void @target([4 x i32]* %0) section "fn-target:ai32" { entry: %target = alloca [4 x i32]*, align 8 store [4 x i32]* %0, [4 x i32]** %target, align 8 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 a6d4cec2d0..3e177922d8 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 @@ -8,10 +8,10 @@ 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", 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" +@__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:af32" +@__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 }, section "var-__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-foo_int:v" { +define i16 @foo_int() section "fn-foo_int:i16" { entry: %foo_int = alloca i16, align 2 store i16 7, i16* %foo_int, align 2 @@ -29,7 +29,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:v" { +define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -39,7 +39,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:v" { +define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:r3i32i32i32" { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 a0989f4e3a..88b5aef7f0 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,9 +7,9 @@ source_filename = "main" %MyStrct = type { i32, i32, i32 } -@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-__MyStrct__init:v" +@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-foo_int:v" { +define i16 @foo_int() section "fn-foo_int:i16" { entry: %foo_int = alloca i16, align 2 store i16 0, i16* %foo_int, align 2 @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:v" { +define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:v" { +define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:r3i32i32i32" { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 451b11526a..dca6c4b57f 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 @@ -10,7 +10,7 @@ source_filename = "main" @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" +@prg_instance = global %prg { i16 24, i16 89 }, section "var-prg_instance:r2i16i16" 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 ccea431152..76fdcca816 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 @@ -5,4 +5,4 @@ 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"], section "var-a:v" +@a = global [2 x [2 x i8]] [[2 x i8] c"\01\02", [2 x i8] c"\03\04"], section "var-a:aau8" 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 2a173a8804..257d474369 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 }, 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" +@__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-__FB__init:r6i16i16u8u8f32f32" +@main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } }, section "var-main_instance:r1r6i16i16u8u8f32f32" 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 fa41bb40f5..5af9b87696 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 }, section "var-Main_instance:v" +@Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-Main_instance:r6i16i16u8u8f32f32" 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 d27868f830..517184cfc8 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], section "var-__arr__init:v" +@__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__arr__init:ai32" 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 abe7965daa..0f683507e0 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, section "var-____func_a__init:v" +@____func_a__init = unnamed_addr constant %__func_a zeroinitializer, section "var-____func_a__init:r1i16" 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 531f81468c..87e15105e6 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, section "var-prog_instance:v" -@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-____prog_a__init:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r1i16" +@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-____prog_a__init:r1i16" 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 71a651bc7a..142a358164 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, 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" +@__foo_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" +@__bar_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" +@__foo_position.y = unnamed_addr constant i32 2, section "var-y:e2i32" +@__bar_position.y = unnamed_addr constant i32 4, section "var-y:e2i32" 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 ee17653176..78b4f0ca58 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, 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" +@__a_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" +@__aa_position.x = unnamed_addr constant i32 2, section "var-x:e2i32" +@__bb_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" +@__b_position.x = unnamed_addr constant i32 4, section "var-x:e2i32" +@__a_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" +@__aa_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" +@__bb_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" +@__b_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" define i32 @a() section "fn-a:i32" { entry: 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 5707989bc5..1e9766978f 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] }, 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" +@str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-str:r3i32i32ai32" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r3i32i32ai32" +@alias_str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-alias_str:r3i32i32ai32" +@global_arr = unnamed_addr constant [2 x i32] [i32 30, i32 40], section "var-global_arr:ai32" +@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:r2ar3i32i32ai32ar3i32i32ai32" @__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 b9ac16eb15..1f85dca6fc 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,6 +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 }, 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" +@a = global %MyStruct { %MyPoint { i32 1, i32 2 }, [4 x i16] [i16 0, i16 1, i16 2, i16 3], i32 7 }, section "var-a:r3r2i32i32ai16i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r3r2i32i32ai16i32" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:r2i32i32" 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 bbb173cac9..1dc7d9700a 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, 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" +@x = global i32 2, section "var-x:e3i32" +@__main_var1.x1 = unnamed_addr constant i32 1, section "var-x1:e3i32" +@__main_var2.x7 = unnamed_addr constant i32 2, section "var-x7:e3i32" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" +@__main_y.redy = unnamed_addr constant i32 1, section "var-redy:e3i32" +@__main_y.yellowy = unnamed_addr constant i32 2, section "var-yellowy:e3i32" +@__main_y.greeny = unnamed_addr constant i32 3, section "var-greeny:e3i32" +@__main_var1.x2 = unnamed_addr constant i32 2, section "var-x2:e3i32" +@__main_var1.x3 = unnamed_addr constant i32 3, section "var-x3:e3i32" +@__main_var2.x5 = unnamed_addr constant i32 0, section "var-x5:e3i32" +@__main_var2.x6 = unnamed_addr constant i32 1, section "var-x6:e3i32" +@__main_var3.x8 = unnamed_addr constant i32 0, section "var-x8:e2i32" +@__main_var3.x9 = unnamed_addr constant i32 1, section "var-x9:e2i32" +@__global_x.red = unnamed_addr constant i32 0, section "var-red:e3i32" +@__global_x.green = unnamed_addr constant i32 2, section "var-green:e3i32" 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 778c2ba1be..c7d6f828a2 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 @@ -5,6 +5,6 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@arr = global [5 x i16] [i16 1, i16 2, i16 3, i16 0, i16 0], section "var-arr:ai16" +@b_exp = global [6 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0, i32 0], section "var-b_exp:ai32" +@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:as8u81" 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 b44485541e..7532c3e952 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0], section "var-arr:v" +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0], section "var-arr:ai16" 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 8cff67b366..dec5bf5907 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7], section "var-arr:v" +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7], section "var-arr:ai16" 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 de5683b641..a100b26cbb 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,7 +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 } }, 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" +@a = global %MyStruct2 { %MyStruct { i32 5, i32 7 }, %MyStruct { i32 3, i32 2 } }, section "var-a:r2r2i32i32r2i32i32" +@__MyStruct2__init = unnamed_addr constant %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 0, i32 7 } }, section "var-__MyStruct2__init:r2r2i32i32r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" +@b = global %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 9, i32 0 } }, section "var-b:r2r2i32i32r2i32i32" 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 8a24ff596a..8f74c62cbd 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 @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@a = global [4 x i8] c"\07\07\07\07", section "var-a:au8" +@b = global [4 x i8] c"\02\07\07\03", section "var-b:au8" +@c = global [10 x i8] c"\00\01\00\01\00\01\00\01\00\01", section "var-c:au8" +@d = global [10 x i8] c"\00\00\01\01\02\00\00\01\01\02", section "var-d:au8" 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 5c689524b3..80d5415d71 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, 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" +@__TON__init = unnamed_addr constant %TON zeroinitializer, section "var-__TON__init:r2i16i16" +@main_instance = global %main { i16 10, %TON { i16 10, i16 17 }, %TON { i16 17, i16 10 } }, section "var-main_instance:r3i16r2i16i16r2i16i16" @__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 41c629a124..6bc86ef519 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [4 x i8] c"\01\02\03\04", section "var-a:v" +@a = global [4 x i8] c"\01\02\03\04", section "var-a:au8" 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 999b7620ae..9e2736b9c0 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,5 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@x = global [3 x i16] [i16 1, i16 2, i16 3], section "var-x:ai16" +@__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3], section "var-__MyArray__init:ai16" 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 efda6d9b39..3d3e438447 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 @@ -5,11 +5,11 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@a = global [3 x i8] c"\01\02\03", section "var-a:ai8" +@b = global [3 x i16] [i16 1, i16 2, i16 3], section "var-b:ai16" +@c = global [3 x i32] [i32 1, i32 2, i32 3], section "var-c:ai32" +@d = global [3 x i64] [i64 1, i64 2, i64 3], section "var-d:ai64" +@e = global [3 x i8] c"\01\02\03", section "var-e:au8" +@f = global [3 x i16] [i16 1, i16 2, i16 3], section "var-f:au16" +@g = global [3 x i64] [i64 1, i64 2, i64 3], section "var-g:au64" +@h = global [3 x i8] [i8 true, i8 false, i8 true], section "var-h:au8" 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 8805826663..d05e4262a6 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,5 +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 }, 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" +@x = global %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-x:r6i16i16u8u8f32f32" +@__MyStruct__init = unnamed_addr constant %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-__MyStruct__init:r6i16i16u8u8f32f32" 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 488abaf68d..76bf94ca96 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,6 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32 } -@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" +@a = global %MyStruct { i32 3, i32 5 }, section "var-a:r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" +@b = global %MyStruct { i32 5, i32 3 }, section "var-b:r2i32i32" 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 71d7ba8efe..1a511ec3ea 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,6 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32, i32 } -@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" +@a = global %MyStruct { i32 5, i32 0, i32 10 }, section "var-a:r3i32i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r3i32i32i32" +@b = global %MyStruct { i32 0, i32 3, i32 10 }, section "var-b:r3i32i32i32" 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 2a32557473..8bb5bfa260 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i16 7, section "var-x:v" +@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 bf139b3e04..f99f254ef8 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,6 +7,6 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@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" +@x = unnamed_addr constant %Point { i32 1, i32 2, i32 3 }, section "var-x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:r3i32i32i32" +@empty = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-empty:r3i32i32i32" 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 831c8f33c5..a65386d8f9 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 }] }] }, 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_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:r1ar2i32ar2i32i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i32ar2i32i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2i32i32" @__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 261439bd1a..b7cab869e9 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,5 +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 }, 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" +@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:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" +@__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:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" 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 92af7e5756..caa93e5bae 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,5 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@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" +@x = global %Point { i32 1, i32 2, i32 7 }, section "var-x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 }, section "var-__Point__init:r3i32i32i32" 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 cfe33d4ef5..be0a36782f 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,5 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@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" +@x = global %Point { i32 1, i32 2, i32 3 }, section "var-x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:r3i32i32i32" 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 6eb8a9cec5..e1d91826ca 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,5 +7,5 @@ source_filename = "main" %MyPoint = type { i32 } -@a = global %MyPoint { i32 7 }, section "var-a:v" -@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:v" +@a = global %MyPoint { i32 7 }, section "var-a:r1i32" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:r1i32" diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index 99022f7e3c..5d9b2f03e0 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -842,7 +842,7 @@ fn by_value_function_arg_arrays_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i32* %0) section "fn-foo:i32[v]" { + define i32 @foo(i32* %0) section "fn-foo:i32[ai32]" { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i32], align 4 @@ -897,9 +897,9 @@ fn by_value_function_arg_structs_are_memcopied() { %S_TY = type { i8, i8 } - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:v" + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:r2u8u8" - define i32 @foo(%S_TY* %0) section "fn-foo:i32[v]" { + define i32 @foo(%S_TY* %0) section "fn-foo:i32[r2u8u8]" { entry: %foo = alloca i32, align 4 %val = alloca %S_TY, align 8 @@ -969,10 +969,10 @@ 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, section "var-__AGGREGATE_COLLECTOR_TY__init:v" - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:v" + @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer, section "var-__AGGREGATE_COLLECTOR_TY__init:r3ai32s8u65537r2u8u8" + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:r2u8u8" - define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-foo:i32[v]" { + define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-foo:i32[r3ai32s8u65537r2u8u8]" { entry: %foo = alloca i32, align 4 %val = alloca %AGGREGATE_COLLECTOR_TY, align 8 @@ -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, section "var-__FOO__init:v" + @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-__FOO__init:r2s8u65537ai32" define i32 @main() section "fn-main:i32" { entry: @@ -1059,7 +1059,7 @@ fn by_value_fb_arg_aggregates_are_memcopied() { ret i32 %main_ret } - define void @FOO(%FOO* %0) section "fn-FOO:v[s8u65537][v]" { + define void @FOO(%FOO* %0) section "fn-FOO:v[s8u65537][ai32]" { entry: %val = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 %field = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 @@ -1121,11 +1121,11 @@ 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, 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" + @__FB__init = unnamed_addr constant %FB zeroinitializer, section "var-__FB__init:r5r1u8ai32ar1u8s8u81s16u81" + @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer, section "var-__OUT_TYPE__init:r1u8" + @PRG_instance = global %PRG zeroinitializer, section "var-PRG_instance:r6r1u8ai32ar1u8s8u81s16u81r5r1u8ai32ar1u8s8u81s16u81" - define void @FB(%FB* %0) section "fn-FB:v[v][v][v][s8u81][s16u81]" { + define void @FB(%FB* %0) section "fn-FB:v[r1u8][ai32][ar1u8][s8u81][s16u81]" { entry: %output = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 %output2 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 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 39f90d2d94..ff73aeec02 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 @@ -9,7 +9,7 @@ source_filename = "main" @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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 b5fde29a6b..cc6ccd7ed7 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, section "var-Main_instance:v" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1r1ai16" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r1ai16" 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 0b7669df5e..1127cd9463 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, 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" +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1r2r2i16i16r2i16i16" +@__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer, section "var-__OuterStruct__init:r2r2i16i16r2i16i16" +@__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer, section "var-__InnerStruct__init:r2i16i16" 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 5a7808a1f9..2495ecde32 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 d904f97dcd..d4b44a28d2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 b211c44700..5b8a4f66db 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 d904f97dcd..d4b44a28d2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 d904f97dcd..d4b44a28d2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 8d526cba33..5499eda1fc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" 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 01cf64c261..1603bf5598 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" 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 805d18d8fd..f520cd93c1 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" 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 a448d714a5..f05606b0cf 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] }, 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_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:r1ar2i16ar2u8i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i16ar2u8i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2u8i32" @__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 e82cd0917c..9bc2dfa990 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] } }, 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_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:r1r2i16ar2u8i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i16ar2u8i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2u8i32" @__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 e7684f026a..ce4feac296 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 @@ -5,5 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global [10 x i16] zeroinitializer, section "var-x:v" -@y = global [6 x float] zeroinitializer, section "var-y:v" +@x = global [10 x i16] zeroinitializer, section "var-x:ai16" +@y = global [6 x float] zeroinitializer, section "var-y:af32" 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 d415094ef2..73318da96d 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 @@ -8,8 +8,8 @@ source_filename = "main" @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" +@x = global [10 x i16] zeroinitializer, section "var-x:ai16" +@y = global [11 x i32] zeroinitializer, section "var-y:ai32" +@z = global [19 x i8] zeroinitializer, section "var-z:au8" +@zz = global [100 x i8] zeroinitializer, section "var-zz:au8" +@zzz = global [10 x [8 x i8]] zeroinitializer, section "var-zzz:aau8" 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 6c3c76bf44..32d74942ba 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 @@ -6,9 +6,9 @@ expression: result source_filename = "main" @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" +@Direction.FORWARD = unnamed_addr constant i32 7, section "var-FORWARD:e3i32" +@Direction.UP = unnamed_addr constant i32 8, section "var-UP:e3i32" +@Direction.DOWN = unnamed_addr constant i32 28, section "var-DOWN:e3i32" 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 7a2d169008..88bdd2eaf4 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 847e44b515..2f76e8001c 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 72c809cde4..592c32891f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 8a99fdab2a..c039599ac5 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" 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 8e610ce9a3..b48928f56d 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" 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 4f8a269f2f..123246918a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 66a6076d05..3e1b446471 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f32" 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 1ac3a679b5..79d67cef2c 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16f32" 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 aa7d5adcda..1e2f09db58 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, section "var-__MyClass__init:v" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" 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 09a0ce8494..b168c9e853 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, section "var-__MyClass__init:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16i16" 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 6c81c6b042..fba893df45 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i16ai16api16pai16" 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 579aa492ba..8d59fac302 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 }, section "var-__fbWithConstant__init:v" +@__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 }, section "var-__fbWithConstant__init:r2i16i16" 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 28b4f07ee5..6e86311ca0 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 @@ -8,7 +8,7 @@ source_filename = "main" %prg = type { i16 } @MIN = unnamed_addr constant i16 7, section "var-MIN:i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" 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 a070a3a8e5..1bc1235805 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 }, section "var-MyStruct:v" -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:v" +@MyStruct = unnamed_addr constant %STRUCT1 { i32 99 }, section "var-MyStruct:r1i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r1i32" 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 992ba3b9e3..fc6023595a 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 }, section "var-main_instance:v" +@main_instance = global %main { i32 0, i32 60 }, section "var-main_instance:r2i32i32" 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 946a4a5571..20428eede9 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 @@ -23,7 +23,7 @@ source_filename = "main" @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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r16i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64" 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 ba1197e20a..10622eafa2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" 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 5b3ec7d4ba..9c9143edae 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 }, section "var-prg_instance:v" +@prg_instance = global %prg { i16 0, i16 1, i32 2 }, section "var-prg_instance:r3i16i16i32" 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 ec20c50f5a..74963d49f4 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 66f8e99d2a..7e3d63f4c4 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 e8aec06d46..b7df37b6ec 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 2d3211324f..e5102d71ac 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, 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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1e3i32" +@MyEnum.red = unnamed_addr constant i32 0, section "var-red:e3i32" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" +@MyEnum.green = unnamed_addr constant i32 2, section "var-green:e3i32" 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 647b058535..17b48f893e 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, 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" +@x = global i32 0, section "var-x:e3i32" +@MyEnum.red = unnamed_addr constant i32 0, section "var-red:e3i32" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" +@MyEnum.green = unnamed_addr constant i32 2, section "var-green:e3i32" 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 b4bf2f72b3..0182f252f5 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, 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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1e4i32" +@TrafficLight.White = unnamed_addr constant i32 0, section "var-White:e4i32" +@TrafficLight.Red = unnamed_addr constant i32 1, section "var-Red:e4i32" +@TrafficLight.Yellow = unnamed_addr constant i32 2, section "var-Yellow:e4i32" +@TrafficLight.Green = unnamed_addr constant i32 3, section "var-Green:e4i32" 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 cea8e93594..4f1449bc28 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 @@ -5,6 +5,6 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@arr = global [4 x i16] [i16 1, i16 2, i16 3, i16 0], section "var-arr:ai16" +@b_exp = global [5 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0], section "var-b_exp:ai32" +@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:as8u81" 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 32b97e6a6c..5fa176e94f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 c758e511fa..31dfda4a83 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 @@ -9,7 +9,7 @@ source_filename = "main" @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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 16868bff70..5d2b8c7b5f 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, section "var-prg_instance:v" +@prg_instance = external global %prg, section "var-prg_instance:r2i32i32" 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 09a0ce8494..b168c9e853 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, section "var-__MyClass__init:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16i16" 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 a6abd6d3ca..64cc3f50ca 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 5af170e92c..34d434f4f5 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" 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 11841d6f87..35c6bd11ad 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" 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 7fcb763bf1..c02a08c835 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i8" 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 13dfc6a4c4..cc119b14f8 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 ddafb0720d..148ba80830 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 2a48ebe922..7f76e8b1d3 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i32i32i32i32" 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 9aa5a4ab85..79c35bead6 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 ca30b8320f..2caf02266a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 3d563d6337..0d79872195 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, section "var-__foo__init:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1r2i16i16" 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 b96816ef8f..e47d0b86cd 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, 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" +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:r1r0" +@__bar__init = unnamed_addr constant %bar zeroinitializer, section "var-__bar__init:r0" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1r1r0" 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 fe859851d6..4263bbdbdb 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 6d325566f4..84aae2155e 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 2e459bfef3..d144832670 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 82da9a43f1..647f17447a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 07e09ae604..0e828faee2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 29d534651e..1d8e7f7822 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 d76c0047f8..3fde489efb 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 210223b212..48744eb903 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 @@ -8,7 +8,7 @@ source_filename = "main" %prg = type { i16 } @gX = global i16 0, section "var-gX:i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" 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 f9cddf4300..24cfe619b9 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r7i32i32i32i32u8u8u8" 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 faa729d015..821be14774 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" 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 c81742ec6d..819de23ac9 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" 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 d62aabbf1e..6fbfe7951c 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, 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" +@x = global i32 0, section "var-x:e3i32" +@__global_x.red = unnamed_addr constant i32 0, section "var-red:e3i32" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" +@__global_x.green = unnamed_addr constant i32 2, section "var-green:e3i32" 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 45e507a435..5df9248f0b 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,5 +7,5 @@ source_filename = "main" %__global_x = type { i32, i32 } -@x = global %__global_x zeroinitializer, section "var-x:v" -@____global_x__init = unnamed_addr constant %__global_x zeroinitializer, section "var-____global_x__init:v" +@x = global %__global_x zeroinitializer, section "var-x:r2i32i32" +@____global_x__init = unnamed_addr constant %__global_x zeroinitializer, section "var-____global_x__init:r2i32i32" 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 9a6d576a47..9366806347 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 @@ -10,7 +10,7 @@ source_filename = "main" @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" +@aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer }, section "var-aaa_instance:r4i16i16au8au8" 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 0d6facb11e..a6a812cb69 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, section "var-__MyClass__init:v" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r0" 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 39680edf7a..0f6c73e9ae 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, section "var-__MyClass__init:v" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r0" 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 c830b6219b..8a48e525ec 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 }, section "var-main_instance:v" +@main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF }, section "var-main_instance:r4f32f32f64f64" 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 c7fe776470..f480411b35 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" 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 f9fb3913e5..b370dd5317 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 4eccd3299c..9fe81c037e 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1aai32" 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 b78d13f280..bb371c4436 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16i16i16ai32" 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 370df99d56..04b13ead9f 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16i16i16ai32" 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 a00527b422..466f334246 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1aai16" 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 80f14aa14e..5bee306bcc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 f63b04e325..ca78e6e50c 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2i16i16" 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 bc6ef42e23..854de40cb7 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, 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" +@foo2_instance = global %foo2 zeroinitializer, section "var-foo2_instance:r2pi32i32" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1pi32" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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__pointer_and_array_access_to_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap index 8bc8d5535d..f1c0ea918b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @main(i16** %0, i16* %1) section "fn-main:i16[ppi16][pv]" { +define i16 @main(i16** %0, i16* %1) section "fn-main:i16[ppi16][pai16]" { entry: %main = alloca i16, align 2 %a = alloca i16**, align 8 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 2bb37784a5..0e342dc23c 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8pu8pu8" 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 c816607801..29fcb3984a 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 c06c88c7ed..195b7709c7 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" 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 bbe38ca83a..7c3c418f5c 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" 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 5f60119b4b..f8ee63df5e 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 94f41ef783..015a8da609 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, section "var-mainPROG_instance:v" +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-mainPROG_instance:r2u8u16" @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 b9cc155b92..89cb1e4b03 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, section "var-mainPROG_instance:v" +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-mainPROG_instance:r2u8u16" @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 d5b4c9e78d..2f7111f762 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" 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 fea90adb3d..c67512b2b9 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" 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 8cccf01f2e..b02fd61580 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32u8" 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 33b8e8d5c5..9433a61ce8 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 }, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo { i16 7 }, section "var-foo_instance:r3i16i16i16" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 39484794b0..5dd7601660 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" 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 ae89278889..6739086a20 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" 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 246faf2ff7..b1895e5d6f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" 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 2ec898b86d..05f2cce8a9 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" 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 f9f0af42c6..a67762dbd8 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32f32f32" 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 64e34c494e..b03a2e730a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1f32" 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 742b197551..2c37498a13 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32i16" 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 ed93a327f7..c6a10795cb 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 966eebf603..c82b2ac7dd 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4s8u81s8u81s16u81s16u81" @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 fcc84444fc..d0953a9451 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" @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 20d7b23148..884daaab3b 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" 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 73b59829c1..c8b8ea6807 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" 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 e58c7b03b5..88b3a6a6bc 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 21c26aa540..076ca001cf 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" 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 9ce9a29a66..c37a86bca4 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1pi32" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 7f865906c2..4ba9b1bc8e 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 7f865906c2..4ba9b1bc8e 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, section "var-foo_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 95dd021991..be6a92f757 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 0a9e308cdc..604f7c4020 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 4f9b87ff07..33e2084dd0 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" 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 f6eb9e2915..462d1c7550 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 b6fcf23a6a..c7fe8ea017 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 e8aec06d46..b7df37b6ec 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 bbfc899e40..d00ce675cd 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 dd6a561a3d..d6266264d2 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" 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 2e3dc2726a..2691ebfd78 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, section "var-bar_instance:v" -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" +@bar_instance = global %bar zeroinitializer, section "var-bar_instance:r1r1i32" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32" 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 eeb19565d0..9f9f81bbe3 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, section "var-bar_instance:v" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" +@bar_instance = global %bar zeroinitializer, section "var-bar_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 62f570c3ec..ecbb0f4dfc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 1122991393..801597c15a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 2865d3ee7c..17dd24c687 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, 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" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32" +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r3i32i32r1i32" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" define void @fb(%fb* %0) section "fn-fb:v[i32]" { entry: @@ -19,7 +19,7 @@ entry: ret void } -define void @foo(%foo* %0) section "fn-foo:v[i32][i32][v]" { +define void @foo(%foo* %0) section "fn-foo:v[i32][i32][r1i32]" { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 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 36cedc9a82..ca6c818fbf 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,17 +9,17 @@ source_filename = "main" %prog = type { %STRUCT_params*, %STRUCT_params* } %main = type {} -@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" +@global1 = global %STRUCT_params zeroinitializer, section "var-global1:r3u8u8u8" +@__STRUCT_params__init = unnamed_addr constant %STRUCT_params zeroinitializer, section "var-__STRUCT_params__init:r3u8u8u8" +@global2 = global %STRUCT_params zeroinitializer, section "var-global2:r3u8u8u8" +@global3 = global %STRUCT_params zeroinitializer, section "var-global3:r3u8u8u8" @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" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2pr3u8u8u8pr3u8u8u8" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" -define void @prog(%prog* %0) section "fn-prog:v[pv][pv]" { +define void @prog(%prog* %0) section "fn-prog:v[pr3u8u8u8][pr3u8u8u8]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %input2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 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 6854c1b39b..3bb98b718a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 2e2de34c9d..a078a7059a 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, section "var-__abcdef__init:v" +@__abcdef__init = unnamed_addr constant %abcdef zeroinitializer, section "var-__abcdef__init:r1i8" 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 c3c6f880e0..4ab6f71f30 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" 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 fecc1370f3..3756addffc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" 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 cb3d6bf2b3..93c596227f 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,7 +8,7 @@ source_filename = "main" %MyStruct = type { i32, i16 } %__global_y = type { i8, i8 } -@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" +@x = global %MyStruct zeroinitializer, section "var-x:r2i32i16" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i16" +@y = global %__global_y zeroinitializer, section "var-y:r2u8u8" +@____global_y__init = unnamed_addr constant %__global_y zeroinitializer, section "var-____global_y__init:r2u8u8" 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 4e7e457154..e1eb24573b 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, section "var-MainProg_instance:v" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:v" +@MainProg_instance = global %MainProg zeroinitializer, section "var-MainProg_instance:r1r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" 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 2148629e2e..9b01c2c51a 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r10u8i8u8u16i16u16i32u32i64u64" 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 e9ef6db4be..406c77df70 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, section "var-Main_instance:v" +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1i16" 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 650199f450..6c549be149 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, section "var-Main_instance:v" +@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1i16" 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 b14d1efc02..c83545dd6a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" 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 91b8c1d6d2..164bfd55f7 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 @@ -10,7 +10,7 @@ source_filename = "main" @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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 22236a29d8..11e03c29cf 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, 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" +@x = global i8 0, section "var-x:e3u8" +@y = global i16 0, section "var-y:e3u16" +@z = global i32 0, section "var-z:e3i32" +@MyEnum.red = unnamed_addr constant i8 0, section "var-red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 1, section "var-yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 2, section "var-green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 0, section "var-red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 1, section "var-yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 2, section "var-green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 0, section "var-red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 2, section "var-green:e3i32" 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 ce2fd10fb4..e1a6f27a37 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, 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" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u16i32" +@MyEnum.red = unnamed_addr constant i8 5, section "var-red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 6, section "var-yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 7, section "var-green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 15, section "var-red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 16, section "var-yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 17, section "var-green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 25, section "var-red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 26, section "var-yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 27, section "var-green:e3i32" 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 8431d9f966..0e7216538e 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, 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" +@x = global i8 0, section "var-x:e3u8" +@y = global i16 0, section "var-y:e3u16" +@z = global i32 0, section "var-z:e3i32" +@MyEnum.red = unnamed_addr constant i8 1, section "var-red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 2, section "var-yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 3, section "var-green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 10, section "var-red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 11, section "var-yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 12, section "var-green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 22, section "var-red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 33, section "var-yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 44, section "var-green:e3i32" 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 4cf179a5d0..58eb488941 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 @@ -6,14 +6,14 @@ expression: result source_filename = "main" @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" +@x = global i8 0, section "var-x:e3u8" +@MyEnum.red = unnamed_addr constant i8 7, section "var-red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 8, section "var-yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 9, section "var-green:e3u8" +@MyEnum2.a = unnamed_addr constant i8 0, section "var-a:e7u8" +@MyEnum2.b = unnamed_addr constant i8 1, section "var-b:e7u8" +@MyEnum2.c = unnamed_addr constant i8 7, section "var-c:e7u8" +@MyEnum2.d = unnamed_addr constant i8 8, section "var-d:e7u8" +@MyEnum2.e = unnamed_addr constant i8 9, section "var-e:e7u8" +@MyEnum2.f = unnamed_addr constant i8 20, section "var-f:e7u8" +@MyEnum2.g = unnamed_addr constant i8 21, section "var-g:e7u8" 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 15527837e9..1d440f1def 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" 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 e3dace6f49..4855798e14 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 @@ -9,7 +9,7 @@ source_filename = "main" @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" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" 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 47c9a60953..fe586b20b5 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 @@ -10,7 +10,7 @@ source_filename = "main" @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" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 5017a0cb63..014acc0aad 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, section "var-prog_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1i64" 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 4991a22782..ba6405638e 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 dc8b34ad26..6499a7cdce 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 55ec760895..8fc4c23721 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" 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 dd70b3d707..5ea8368310 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r4i64i64i64i64" 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 e6a8ff09fb..a30144e84e 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r13pf32i16i32f32f64i8i16i32i64u8u16u32u64" 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 7f1a63acca..0a2655bde5 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r11pi16i16i32i8i16i32i64u8u16u32u64" 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 8c253b338b..8bc13195d1 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 }, section "var-main_instance:v" +@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 }, section "var-main_instance:r4i16i16pi16u8" 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 b6723ad329..557b0230de 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3pi16i16u8" 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 2883b8f331..c79d310443 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], section "var-const_arr:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4], section "var-const_arr:ai16" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1ai16" 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 5e5b107187..392c465798 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 @@ -8,7 +8,7 @@ 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", section "var-const_str:s8u81" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" 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 14e257a166..e75e39f6c7 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 }, 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" +@const_strct = unnamed_addr constant %Point { i16 1, i16 2 }, section "var-const_strct:r2i16i16" +@__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1r2i16i16" define void @main(%main* %0) section "fn-main:v" { entry: 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 6cffe50f33..c1eb695a51 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, 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 +@a = global [11 x i32] zeroinitializer, section "var-a:ai32", !dbg !0 +@b = global [110 x i32] zeroinitializer, section "var-b:ai32", !dbg !7 +@c = global [11 x [10 x i32]] zeroinitializer, section "var-c:aai32", !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_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 30c8ed22bc..dff210faf8 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, 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 +@en3 = global i64 0, section "var-en3:e3i64", !dbg !0 +@en1.a = unnamed_addr constant i32 0, section "var-a:e3i32", !dbg !5 +@en1.b = unnamed_addr constant i32 1, section "var-b:e3i32", !dbg !9 +@en1.c = unnamed_addr constant i32 2, section "var-c:e3i32", !dbg !11 +@en2.d = unnamed_addr constant i8 0, section "var-d:e3u8", !dbg !13 +@en2.e = unnamed_addr constant i8 1, section "var-e:e3u8", !dbg !17 +@en2.f = unnamed_addr constant i8 2, section "var-f:e3u8", !dbg !19 +@__global_en3.a = unnamed_addr constant i64 0, section "var-a:e3i64", !dbg !21 +@__global_en3.b = unnamed_addr constant i64 1, section "var-b:e3i64", !dbg !23 +@__global_en3.c = unnamed_addr constant i64 2, section "var-c:e3i64", !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_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 35c9255e19..d027803f33 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, 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 +@gStruct = global %myStruct zeroinitializer, section "var-gStruct:r2i32r2i32f64", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r2i32r2i32f64", !dbg !13 +@__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, section "var-__myStruct2__init:r2i32f64", !dbg !15 !llvm.module.flags = !{!17, !18} !llvm.dbg.cu = !{!19} 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 acfca65649..871f67630c 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, 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 +@gStruct = global %myStruct zeroinitializer, section "var-gStruct:r3i32f64ai32", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r3i32f64ai32", !dbg !13 +@b = global [11 x %myStruct] zeroinitializer, section "var-b:ar3i32f64ai32", !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 852b8bbcc3..76d125b683 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 }, section "var-__myStruct__init:v" +@__myStruct__init = unnamed_addr constant %myStruct { i8 1 }, section "var-__myStruct__init:r1u8" 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 8365d18676..30190c2d92 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, section "var-baz_instance:v" +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r3s8u11pu8pau8" 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 1fb7467225..418072e370 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16ai16pi16pai16" 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 8d924769bd..d909619bfc 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi32i32" 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 4b4e671304..5a1062dd9c 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, section "var-main_instance:v" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" define void @main(%main* %0) section "fn-main:v" { entry: @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pv]" { +define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 a01ca57d25..e719b32b32 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i32" 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 d993b2a874..3251d79a90 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r5i32i32i32i32i32" 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 14d9e59034..339ed086af 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" @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 57cb4c4bfc..941a404562 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi32i32" 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 4d28c4bfe1..faddb1b318 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 df881a2995..20eea20d29 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 4f2697c148..5ebe343440 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i64" 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 5b8b790aaf..3e9bc8b502 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, section "var-main_instance:v" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" define void @main(%main* %0) section "fn-main:v" { entry: @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pv]" { +define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 fae443b0e1..e0c48db175 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 @@ -9,8 +9,8 @@ source_filename = "main" %__foo_vla = type { i32*, [2 x i32] } @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" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" define void @main(%main* %0) section "fn-main:v" { entry: @@ -31,7 +31,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pv]" { +define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 2474067f63..dc1e351f58 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" @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 a6576b99ad..f50b36c79d 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, section "var-baz_instance:v" +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r2pu8u16" 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 0f29f527dc..579ebc7de7 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r8u8u8u8u8u8u8u8u8" 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 50ce6556e2..804684043d 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" 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 11f8d11c27..65df51d924 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" 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 8a9f1e2af2..3142e5aa7b 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 8b71bf56b3..814c9e121b 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 }, section "var-main_instance:v" +@main_instance = global %main { i16 10, i16 20, i16* null }, section "var-main_instance:r3i16i16pi16" 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 312813a759..6e7a8d78b1 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi16i16" 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 f2fbd7f269..8eb22c56cb 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,9 +7,9 @@ source_filename = "main" %myStruct = type { i16 } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:v" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r1i16" -define void @func(%myStruct* %0, %myStruct* %1) section "fn-func:v[pv]" { +define void @func(%myStruct* %0, %myStruct* %1) section "fn-func:r1i16[pr1i16]" { entry: %func = alloca %myStruct*, align 8 store %myStruct* %0, %myStruct** %func, align 8 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 ad58df9992..04abb1c5ae 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f32" 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 cb4fcae29d..f408a0f347 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, section "var-baz_instance:v" +@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r4pu8u8i8u8" define void @baz(%baz* %0) section "fn-baz:v" { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index ef7538caae..039a280c66 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -18,7 +18,7 @@ entry: ret i32 %main_ret } -define i32 @fn_by_ref(i32* %0) section "fn-fn_by_ref:i32[pv]" { +define i32 @fn_by_ref(i32* %0) section "fn-fn_by_ref:i32[pau32]" { entry: %fn_by_ref = alloca i32, align 4 %arg_by_ref = alloca i32*, align 8 @@ -30,7 +30,7 @@ entry: ret i32 %fn_by_ref_ret } -define i32 @fn_by_val(i32* %0) section "fn-fn_by_val:i32[v]" { +define i32 @fn_by_val(i32* %0) section "fn-fn_by_val:i32[au32]" { entry: %fn_by_val = alloca i32, align 4 %arg_by_val = alloca [5 x i32], align 4 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 8e55a24c6a..55a26d3a53 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 9eae4a3172..101a120980 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 }, section "var-main_instance:v" +@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:r12i8i8i16i16i32i32i64i64f32f32f64f64" 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 5427d5b246..b4a5ccef09 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" @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 78ccdde51d..7faa691833 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 c65db915e6..d07d8c348c 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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 60a625e8a9..076dfa6aff 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" @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 df13425d9b..f5cba9ee45 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u6" @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 ae3be6cc10..19351d4bdd 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u6" @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 c8b71d1ec1..4d5da158e8 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 707a9b3525..dfbd09c0c3 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" 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 74f1e520d6..0469748b1a 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 }, section "var-main_instance:v" +@main_instance = global %main { i16 4 }, section "var-main_instance:r1i16" 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 ecbe9bd12a..156a335211 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r10f32f32f32f64f32f32f32f64i32i32" 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 9c2ad044df..9d2a97cdb4 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" 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 538862dbde..80ec25a385 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16i16i64" 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 1e6033b615..bd9e6010e9 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, section "var-__myStruct__init:v" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r2i32pi16" ; 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, section "var-prog_instance:v" -@__myStruct__init = external global %myStruct.1, section "var-__myStruct__init:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r2i32pi16" +@__myStruct__init = external global %myStruct.1, section "var-__myStruct__init:r2i32pi16" 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 ec27b63904..7181b2163f 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 }, section "var-__myStruct__init:v" +@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null }, section "var-__myStruct__init:r2i32pi16" ; ModuleID = 'prog.st' source_filename = "prog.st" %prog = type { i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1i32" 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 a7d14c05d1..a2bf90b85b 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 }, section "var-prog_instance:v" +@prog_instance = global %prog { i16 5 }, section "var-prog_instance:r1i16" 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 fde171e602..3bbd7d6b6e 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, 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" +@myEnum.a = unnamed_addr constant i32 1, section "var-a:e3i32" +@myEnum.b = unnamed_addr constant i32 2, section "var-b:e3i32" +@myEnum.c = unnamed_addr constant i32 3, section "var-c:e3i32" ; ModuleID = 'fb.st' source_filename = "fb.st" %fb = type { i32 } -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:v" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1e3i32" 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, section "var-__myStruct__init:v" -@__fb__init = external global %fb.2, section "var-__fb__init:v" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r1r1e3i32" +@__fb__init = external global %fb.2, section "var-__fb__init:r1e3i32" 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, 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" +@__fb2__init = unnamed_addr constant %fb2 zeroinitializer, section "var-__fb2__init:r1r1r1e3i32" +@__myStruct__init = external global %myStruct.4, section "var-__myStruct__init:r1r1e3i32" +@__fb__init = external global %fb.5, section "var-__fb__init:r1e3i32" 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, section "var-__fb3__init:v" +@__fb3__init = unnamed_addr constant %fb3 zeroinitializer, section "var-__fb3__init:r0" 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 3140940c5c..375a6aa974 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, section "var-__fb__init:v" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r0" 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" 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, section "var-prg2_instance:v" +@prg2_instance = global %prg2 zeroinitializer, section "var-prg2_instance:r1i32" 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, 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" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r0" +@__fb__init = external global %fb.4, section "var-__fb__init:r0" +@prg_instance = external global %prg.5, section "var-prg_instance:r1i32" +@prg2_instance = external global %prg2.6, section "var-prg2_instance:r1i32" 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 d45dd7fb2d..b1505566c4 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 @@ -22,7 +22,7 @@ source_filename = "prog.st" %prog = type {} -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r0" @c = external global i32, section "var-c:i32" @x = external global i32, section "var-x:i32" 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 6ecf811475..7290eddb92 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 }, section "var-__myStruct__init:v" +@__myStruct__init = unnamed_addr constant %myStruct { i32 6, i16 2 }, section "var-__myStruct__init:r2i32i16" ; ModuleID = 'myStruct2.st' source_filename = "myStruct2.st" %myStruct2 = type { i32, i16 } -@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 }, section "var-__myStruct2__init:v" +@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 }, section "var-__myStruct2__init:r2i32i16" ; 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 } }, 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_instance = global %prog { %myStruct.2 { i32 5, i16 2 }, %myStruct2.3 { i32 6, i16 2 } }, section "var-prog_instance:r2r2i32i16r2i32i16" +@__myStruct__init = external global %myStruct.2, section "var-__myStruct__init:r2i32i16" +@__myStruct2__init = external global %myStruct2.3, section "var-__myStruct2__init:r2i32i16" @__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 8aa2ef52d2..3f8ee5cafc 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, section "var-__fb_t__init:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1r2i32i32" 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 d203962ab0..bf9e60e0bd 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, section "var-__fb_t__init:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2r2i32i32i32" 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 79faff54bf..6b43aada59 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 f5f85480ae..98e324b2f2 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" 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 ad19dbff8e..bb8ff92a05 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 152ae2b777..6d5db97967 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 ca59b0dffc..d1a5e70923 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 ba4da1bbdb..63c5532e99 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 a75139b5ab..50aab291b4 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 b0eba6e62d..6c826b2e29 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 ca59b0dffc..d1a5e70923 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 ba4da1bbdb..63c5532e99 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 f15f075d3b..c209f084d0 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 a75139b5ab..50aab291b4 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 b0eba6e62d..6c826b2e29 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 dd36b72451..f213af0c9f 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, section "var-main_instance:v" -@__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-__file_t__init:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2r2u8u8pr2u8u8" +@__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-__file_t__init:r2u8u8" 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 bb3a04b207..25645a131f 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r0" 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 f8f06b81d0..7b1a478347 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" 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 28081ea3bf..f6e4b5c8ef 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 39f9ee1290..69ced22379 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 40d149c5ae..99127cc833 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 3ca8523346..6ba1817e97 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 3a1552ea87..5e5a0c59bd 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" 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 46abbbe981..6c8ea69008 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, section "var-mainProg_instance:v" -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:v" +@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r3r5u8u8pu8u8pu8u8u8" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r5u8u8pu8u8pu8" 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 1962aca319..a5c7408fcf 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u32i32" 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 550e84edf2..e08cd1363f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u32i32" 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 0bd1ef0850..87438a209a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u32u64i64" 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 2752af52dd..aa5bbd223a 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u64" 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 4e0c92574f..2bd94429d0 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4u8u8i16i16" 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 4649fd564a..8a7461c178 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u16u32i32" 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 eabb2fc255..36c0cb1a3f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" @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 4be8d97e52..81ea3ef0ec 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u61s8u81" @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 d6f51b8c4a..3158219458 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" @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 c4eca647fb..535b73c274 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" @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__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index abd14006e4..c4e8c10585 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -10,7 +10,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"#\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"*\00" -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:v" { +define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 a6cca9e6c2..e48fa4fca0 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,5 +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"] }, 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" +@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:r7i16i16as8u11as8u3as8u11as8u4as8u4" +@__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:r7i16i16as8u11as8u3as8u11as8u4as8u4" 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 b59153d413..0745dd2a53 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, section "var-prog_instance:v" -@main_instance = global %main zeroinitializer, section "var-main_instance:v" +@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2s8u81s16u81" +@main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u7s16u8" @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 6cbd7fc906..bafe2c9a54 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" @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 627034fd44..be13625db7 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,7 +7,7 @@ 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] }, section "var-prg_instance:v" +@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:r3s8u81s8u100s16u100" @__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" 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 dfc49ed44a..e34aaf4ee2 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 }, section "var-prg_instance:v" +@prg_instance = global %prg { [11 x i8] c"hello\00\00\00\00\00\00", [81 x i8] zeroinitializer }, section "var-prg_instance:r2s8u11s8u81" @__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__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index 16bcbdf9ad..f259984e72 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -20,7 +20,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:v" { +define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index 4c7455e8c0..304fc17870 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:v" { +define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 532fc40edc..001dbe34cc 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] }, section "var-prg_instance:v" +@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:r4s8u16s8u4s16u16s16u4" @__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 68818d7f20..e08a85e5a0 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 @@ -9,7 +9,7 @@ source_filename = "main" @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_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:r4vvvv" @__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 b81612b04b..9be88378c4 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" }, section "var-prg_instance:v" +@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:r2s8u16s8u31" @__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 e02ab5480c..a24052d74f 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u16s8u31" @__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 93d7424943..e1aee8df9b 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i32i32" 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 8bd4e92075..09078036db 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i32i64i64" 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 7326171db8..a286e68b10 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i32i32" 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 3069e39e6f..a879767657 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i8i8" 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 27dd9c124d..2a3bf60b05 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32f64f64" 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 72c3d100c1..4d67d6bda4 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16u16f32" 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 193f02e9c6..5096cda6dc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f64" 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 557265c496..ff04806a83 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16u16f32" 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 4d106818a4..50cc461748 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8i64" 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 0d31d3709a..3cc9f39a88 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32i64" 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 abfde7a6e7..e63cd784fc 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32i16f32" 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 6406cf00ac..a4e6979224 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, section "var-main_instance:v" +@main_instance = global %main zeroinitializer, section "var-main_instance:r4s8u81f32f64i16" @__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 a165faa323..0aad22f5c3 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, section "var-prg_instance:v" +@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8i32i32" 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 56cd50baf5..674b5c1710 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { +define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 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 d2a52b38ac..55013f1237 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,10 +7,10 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@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" +@arr = global [2 x i16] zeroinitializer, section "var-arr:ai16" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { +define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 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 877a9d7bc4..637a64fd7a 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" -define void @foo(%__foo_vla* %0) section "fn-foo:v[v]" { +define void @foo(%__foo_vla* %0) section "fn-foo:v[r2pai16ai32]" { entry: %vla = alloca %__foo_vla, align 8 %1 = bitcast %__foo_vla* %vla to i8* 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 cb21dea1f6..2d020fa3cd 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { +define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 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 51da4684b4..d0798dcfc1 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:v" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[v]" { +define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 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 e664792060..53c5fe5437 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, section "var-me:v" +@me = unnamed_addr constant i32 3, section "var-me:e3i32" @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" +@MyEnum.a = unnamed_addr constant i32 3, section "var-a:e3i32" +@MyEnum.b = unnamed_addr constant i32 4, section "var-b:e3i32" +@MyEnum.c = unnamed_addr constant i32 5, section "var-c:e3i32" 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 f78f2b9eb9..7babccc22d 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 @@ -10,7 +10,7 @@ source_filename = "main" @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" +@zero_enum = unnamed_addr constant i32 0, section "var-zero_enum:e3i32" +@myEnum.a = unnamed_addr constant i32 0, section "var-a:e3i32" +@myEnum.b = unnamed_addr constant i32 1, section "var-b:e3i32" +@myEnum.c = unnamed_addr constant i32 2, section "var-c:e3i32" 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 1c057cb239..d1091674cf 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 @@ -6,7 +6,7 @@ expression: src source_filename = "main" @a = global i16 7, section "var-a:i16" -@b = global i16 7, section "var-b:v" +@b = global i16 7, section "var-b:i16" @aa = unnamed_addr constant i16 7, section "var-aa:i16" -@bb = unnamed_addr constant i16 7, section "var-bb:v" +@bb = unnamed_addr constant i16 7, section "var-bb:i16" @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 bd716dcedf..1ecf6498f0 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, section "var-d:v" + @d = global [10 x i32] zeroinitializer, section "var-d:ai32" "###); } @@ -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], 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" + @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:ai32" + @__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:ai32" "###); } @@ -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] }, 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_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:r2ai32ai32" + @__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:ai32" 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] }, 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_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:r2ai32ai32" + @__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:ai32" @__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 e1b57a11ae..e98713a338 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, 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" + @myColor = global i32 0, section "var-myColor:e3i32" + @Color.red = unnamed_addr constant i32 0, section "var-red:e3i32" + @Color.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" + @Color.green = unnamed_addr constant i32 2, section "var-green:e3i32" "###); } @@ -52,16 +52,16 @@ fn enums_constants_are_automatically_numbered_or_user_defined() { ; ModuleID = 'main' source_filename = "main" - @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" + @myColor = global i32 0, section "var-myColor:e4i32" + @myState = global i8 0, section "var-myState:e4u8" + @Color.red = unnamed_addr constant i32 1, section "var-red:e4i32" + @Color.yellow = unnamed_addr constant i32 2, section "var-yellow:e4i32" + @Color.green = unnamed_addr constant i32 4, section "var-green:e4i32" + @Color.blue = unnamed_addr constant i32 8, section "var-blue:e4i32" + @State.open = unnamed_addr constant i8 1, section "var-open:e4u8" + @State.closed = unnamed_addr constant i8 4, section "var-closed:e4u8" + @State.idle = unnamed_addr constant i8 5, section "var-idle:e4u8" + @State.running = unnamed_addr constant i8 6, section "var-running:e4u8" "###); } @@ -80,14 +80,14 @@ fn inline_declaration_of_enum_types() { ; ModuleID = 'main' source_filename = "main" - @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" + @frontColor = global i32 0, section "var-frontColor:e3i32" + @backColor = global i32 0, section "var-backColor:e3i32" + @__global_frontColor.red = unnamed_addr constant i32 0, section "var-red:e3i32" + @__global_frontColor.green = unnamed_addr constant i32 1, section "var-green:e3i32" + @__global_frontColor.yellow = unnamed_addr constant i32 2, section "var-yellow:e3i32" + @__global_backColor.red = unnamed_addr constant i32 0, section "var-red:e3i32" + @__global_backColor.green = unnamed_addr constant i32 1, section "var-green:e3i32" + @__global_backColor.yellow = unnamed_addr constant i32 2, section "var-yellow:e3i32" "###); } @@ -121,13 +121,13 @@ fn using_enums() { %prg = type { i32, i32, i32 } - @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" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i32i32i32" + @ProcessState.open = unnamed_addr constant i32 1, section "var-open:e4i32" + @ProcessState.closed = unnamed_addr constant i32 4, section "var-closed:e4i32" + @ProcessState.idle = unnamed_addr constant i32 5, section "var-idle:e4i32" + @ProcessState.running = unnamed_addr constant i32 6, section "var-running:e4i32" + @Door.open = unnamed_addr constant i32 8, section "var-open:e2i32" + @Door.closed = unnamed_addr constant i32 16, section "var-closed:e2i32" 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 e62a1f4cc1..9f9bcbaab4 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, section "var-main_prg_instance:v" + @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:r5i16pi16i16i16i16" 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, section "var-main_prg_instance:v" + @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:r5i16pi16i16i16i16" 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 }, section "var-__main_fb__init:v" + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-__main_fb__init:r5i16pi16i16i16i16" 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 } }, 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" + @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } }, section "var-foo_instance:r3i16i16r5i16pi16i16i16i16" + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-__main_fb__init:r5i16pi16i16i16i16" 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, section "var-prg_instance:v" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i8" 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, section "var-prg_instance:v" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1s8u81" @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,10 +620,10 @@ 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, section "var-__myStruct__init:v" - @main_instance = global %main zeroinitializer, section "var-main_instance:v" + @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r4i32i32i32s8u81" + @main_instance = global %main zeroinitializer, section "var-main_instance:r4s8u81s16u81ai32r4i32i32i32s8u81" - define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-foo:v[s8u81][s16u81][v][v]" { + define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-foo:v[s8u81][s16u81][ai32][r4i32i32i32s8u81]" { entry: %s = alloca [81 x i8], align 1 %bitcast = bitcast [81 x i8]* %s to i8* @@ -705,7 +705,7 @@ fn passing_by_ref_to_functions() { %main = type { [81 x i8], [81 x i8] } - @main_instance = global %main zeroinitializer, section "var-main_instance:v" + @main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u81s8u81" 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 a1ef5000a2..e723c446bd 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -68,7 +68,7 @@ fn assigning_strings() { %prg = type { [11 x i8], [11 x i8] } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:v" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u11s8u11" 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, section "var-prg_instance:v" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u11s8u11" @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 69c787df87..e27599f623 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, section "var-__Person__init:v" + @__Person__init = unnamed_addr constant %Person zeroinitializer, section "var-__Person__init:r4s8u81s8u81i16u8" "###); } @@ -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 }, 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" + @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:r4s8u6s8u6i16u8" + @__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:r4s8u6s8u6i16u8" "###); } @@ -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 } } }, 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_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:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" @__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, section "var-prg_instance:v" - @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:v" + @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" 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, 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_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" 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 bdb45c4767..b01c2126b7 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, section "var-____foo_arr__init:v" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" define i32 @main() section "fn-main:i32" { entry: @@ -340,7 +340,7 @@ fn pass() { ret i32 %main_ret } - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pv]" { + define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -382,9 +382,9 @@ fn access() { %__foo_arr = type { i32*, [2 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:v" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pv]" { + define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -440,9 +440,9 @@ fn multi_dimensional() { %__foo_arr = type { i32*, [4 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:v" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pv]" { + define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 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 cd119294f4..bcf9e58c69 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, section "var-main_instance:v", !dbg !0 +@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i32", !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 e64bc35170..0df95ae131 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, section "var-__conditional_return__init:v" +@__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" 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 ea8d9d0be8..ec422bce16 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, section "var-__conditional_return__init:v" +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" 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 d081cc4357..ac96dd44cf 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, section "var-__conditional_return__init:v" +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" 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 8625d20d66..47b62ed2e3 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, section "var-foo_instance:v", !dbg !0 +@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1i32", !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 2a64d05306..8d5e93d8d4 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, section "var-main_instance:v", !dbg !0 +@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32", !dbg !0 define void @main(%main* %0) section "fn-main:v" !dbg !11 { entry: From 07e893fe35665227a584c4b9e7af7ff515c1bcd9 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 20 Mar 2024 17:03:13 +0100 Subject: [PATCH 13/40] section_mangler: Add base for decoding mangled names --- Cargo.lock | 3 + compiler/section_mangler/Cargo.toml | 1 + compiler/section_mangler/src/lib.rs | 2 + compiler/section_mangler/src/parser.rs | 141 +++++++++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 compiler/section_mangler/src/parser.rs diff --git a/Cargo.lock b/Cargo.lock index 2dea6b2af6..c4f0e6aa9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3023,6 +3023,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "section_mangler" version = "0.0.1" +dependencies = [ + "nom", +] [[package]] name = "security-framework" diff --git a/compiler/section_mangler/Cargo.toml b/compiler/section_mangler/Cargo.toml index f3386a21e0..f0cfaf92a4 100644 --- a/compiler/section_mangler/Cargo.toml +++ b/compiler/section_mangler/Cargo.toml @@ -4,3 +4,4 @@ version = "0.0.1" edition = "2021" [dependencies] +nom = "7.1" diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 3d4c64e6cc..a7bfd098e4 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -44,6 +44,8 @@ use std::fmt; +mod parser; + /// The main builder type of this crate. Use it to create mangling contexts, in /// order to encode and decode binary type information. // TODO: Add example code for using this builder diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs new file mode 100644 index 0000000000..092d12c982 --- /dev/null +++ b/compiler/section_mangler/src/parser.rs @@ -0,0 +1,141 @@ +use crate::{SectionMangler, Type}; + +use nom::branch::alt; +use nom::bytes::complete::{tag, take_until1}; +use nom::character::complete::{char, digit1}; +use nom::combinator::map_res; +use nom::sequence::delimited; +use nom::{IResult, Parser}; + +type ParseResult<'i, O> = IResult<&'i str, O>; + +enum Prefix { + Fn, + Var, +} + +fn parse_prefix(input: &str) -> ParseResult { + let fn_prefix = tag("fn").map(|_| Prefix::Fn); + let var_prefix = tag("var").map(|_| Prefix::Var); + + let (input, prefix) = alt((fn_prefix, var_prefix))(input)?; + + Ok((input, prefix)) +} + +fn parse_entity_name(input: &str) -> ParseResult<&str> { + delimited(char('-'), take_until1(":"), char(':'))(input) +} + +fn type_void(input: &str) -> ParseResult { + char('v').map(|_| Type::Void).parse(input) +} + +fn take_u32(input: &str) -> ParseResult { + map_res(digit1, str::parse)(input) +} + +fn type_integer(input: &str) -> ParseResult { + fn parse_signedness(input: &str) -> ParseResult { + let signed = char('i').map(|_| true); + let unsigned = char('u').map(|_| false); + + alt((signed, unsigned))(input) + } + + parse_signedness + .and(take_u32) + .map(|(signed, size)| Type::Integer { signed, size, semantic_size: None }) + .parse(input) +} + +fn type_float(input: &str) -> ParseResult { + char('f').and(take_u32).map(|(_, size)| Type::Float { size }).parse(input) +} + +fn type_pointer(input: &str) -> ParseResult { + char('p').and(parse_type).map(|(_, inner)| Type::Pointer { inner: Box::new(inner) }).parse(input) +} + +fn parse_type(input: &str) -> ParseResult { + alt((type_void, type_integer, type_float, type_pointer))(input) +} + +fn parse_var_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMangler> { + let (input, ty) = parse_type(input)?; + + Ok((input, SectionMangler::variable(name, ty))) +} + +// We don't need to handle any kind of errors, because an invalid mangled string can only be +// caused by a programming error or a mismatch in versions +impl From<&str> for SectionMangler { + fn from(input: &str) -> SectionMangler { + let (input, prefix) = parse_prefix(input).unwrap(); + let (input, name) = parse_entity_name(input).unwrap(); + + match prefix { + Prefix::Var => parse_var_content(input, name).unwrap().1, + Prefix::Fn => todo!(), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn parse_prefix_valid() { + assert!(parse_prefix("fn").is_ok()); + assert!(parse_prefix("var").is_ok()); + + assert!(parse_prefix("").is_err()); + assert!(parse_prefix("a random prefix").is_err()); + } + + #[test] + fn parse_name_valid() { + assert_eq!(parse_entity_name("-foo:").unwrap().1, "foo"); + + // empty name + assert!(parse_entity_name("-:").is_err()); + } + + #[test] + fn parse_integer() { + assert!(type_integer("i15").is_ok()); + assert!(type_integer("u49").is_ok()); + assert!(type_integer("i0").is_ok()); + + assert!(type_integer("i").is_err()); + assert!(type_integer("b49").is_err()); + } + + #[test] + fn parse_void() { + assert!(type_void("v").is_ok()); + + assert!(type_void("i15").is_err()); + } + + #[test] + fn parse_float() { + assert!(type_float("f15").is_ok()); + assert!(type_float("f2560").is_ok()); + + assert!(type_float("f").is_err()); + assert!(type_float("i0").is_err()); + } + + #[test] + fn parse_ptr() { + assert!(type_pointer("pf15").is_ok()); + assert!(type_pointer("pv").is_ok()); + assert!(type_pointer("pi45").is_ok()); + assert!(type_pointer("pppppppi45").is_ok()); + + assert!(type_pointer("p").is_err()); + assert!(type_pointer("i0").is_err()); + } +} From 10363b51bc73132fded4fcb526372bc8c4489e7e Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 27 Mar 2024 14:47:50 +0100 Subject: [PATCH 14/40] section-mangler: Add prefix constant, derive Debug and PartialEq --- compiler/section_mangler/src/lib.rs | 12 ++++++++++-- compiler/section_mangler/src/parser.rs | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index a7bfd098e4..4605d4104a 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -49,17 +49,20 @@ mod parser; /// The main builder type of this crate. Use it to create mangling contexts, in /// order to encode and decode binary type information. // TODO: Add example code for using this builder +#[derive(Debug, PartialEq)] pub enum SectionMangler { Function(FunctionMangler), Variable(VariableMangler), } +#[derive(Debug, PartialEq)] pub struct FunctionMangler { name: String, parameters: Vec, return_type: Option, } +#[derive(Debug, PartialEq)] pub struct VariableMangler { name: String, ty: Type, @@ -115,6 +118,7 @@ impl SectionMangler { // NOTE: This is called `variable_linkage` in the `MemberInfo` struct. /// We have to encode this because if it changes, the function needs to be reloaded - this is an ABI breakage +#[derive(Debug, PartialEq)] pub enum FunctionArgument { ByValue(Type), ByRef(Type), @@ -131,6 +135,7 @@ impl fmt::Display for FunctionArgument { } // TODO: Do we have to encode this? Does that affect ABI? Probably +#[derive(Debug, PartialEq)] pub enum StringEncoding { // TODO: Should we encode this differently? this could cause problems compared to encoding unsigned types /// Encoded as `8u` @@ -150,6 +155,7 @@ impl fmt::Display for StringEncoding { // This maps directly to the [`DataTypeInformation`] enum in RuSTy - we simply remove some fields and add the ability to encode/decode serialize/deserialize // TODO: Do we have to handle Generic? +#[derive(Debug, PartialEq)] pub enum Type { /// Encoded as `v` Void, @@ -237,6 +243,8 @@ impl fmt::Display for Type { } } +pub const PREFIX: &str = "$RUSTY$"; + // TODO: How to encode variadics? fn mangle_function(FunctionMangler { name, parameters, return_type }: FunctionMangler) -> String { let mangled = parameters @@ -244,9 +252,9 @@ fn mangle_function(FunctionMangler { name, parameters, return_type }: FunctionMa /* FIXME: Is that correct? */ .fold(return_type.unwrap_or(Type::Void).to_string(), |mangled, arg| format!("{mangled}[{arg}]")); - format!("{name}:{mangled}") + format!("{PREFIX}{name}:{mangled}") } fn mangle_variable(VariableMangler { name, ty }: VariableMangler) -> String { - format!("{name}:{ty}") + format!("{PREFIX}{name}:{ty}") } diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index 092d12c982..e466974e1c 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -18,6 +18,7 @@ fn parse_prefix(input: &str) -> ParseResult { let fn_prefix = tag("fn").map(|_| Prefix::Fn); let var_prefix = tag("var").map(|_| Prefix::Var); + let (input, _) = tag(crate::PREFIX)(input)?; let (input, prefix) = alt((fn_prefix, var_prefix))(input)?; Ok((input, prefix)) @@ -87,8 +88,12 @@ mod tests { #[test] fn parse_prefix_valid() { - assert!(parse_prefix("fn").is_ok()); - assert!(parse_prefix("var").is_ok()); + assert!(parse_prefix("$RUSTY$fn").is_ok()); + assert!(parse_prefix("$RUSTY$var").is_ok()); + + assert!(parse_prefix("$RUSTY$random").is_err()); + assert!(parse_prefix("fn").is_err()); + assert!(parse_prefix("var").is_err()); assert!(parse_prefix("").is_err()); assert!(parse_prefix("a random prefix").is_err()); @@ -138,4 +143,9 @@ mod tests { assert!(type_pointer("p").is_err()); assert!(type_pointer("i0").is_err()); } + + #[test] + fn parse_variable() { + SectionMangler::from("$RUSTY$var-name:u8"); + } } From 9d1ef35b3a32f23e0d336863c3d0a97421ca28e3 Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Thu, 28 Mar 2024 11:56:19 +0100 Subject: [PATCH 15/40] section_mangler: Add struct decoding --- compiler/section_mangler/src/parser.rs | 36 ++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index e466974e1c..8487d196ed 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -1,9 +1,12 @@ use crate::{SectionMangler, Type}; +use std::str; + use nom::branch::alt; use nom::bytes::complete::{tag, take_until1}; use nom::character::complete::{char, digit1}; use nom::combinator::map_res; +use nom::multi::many_m_n; use nom::sequence::delimited; use nom::{IResult, Parser}; @@ -32,7 +35,7 @@ fn type_void(input: &str) -> ParseResult { char('v').map(|_| Type::Void).parse(input) } -fn take_u32(input: &str) -> ParseResult { +fn number(input: &str) -> ParseResult { map_res(digit1, str::parse)(input) } @@ -45,21 +48,27 @@ fn type_integer(input: &str) -> ParseResult { } parse_signedness - .and(take_u32) + .and(number::) .map(|(signed, size)| Type::Integer { signed, size, semantic_size: None }) .parse(input) } fn type_float(input: &str) -> ParseResult { - char('f').and(take_u32).map(|(_, size)| Type::Float { size }).parse(input) + char('f').and(number::).map(|(_, size)| Type::Float { size }).parse(input) } fn type_pointer(input: &str) -> ParseResult { char('p').and(parse_type).map(|(_, inner)| Type::Pointer { inner: Box::new(inner) }).parse(input) } +fn type_struct(input: &str) -> ParseResult { + let (input, (_, n)) = char('r').and(number::).parse(input)?; + + many_m_n(n, n, parse_type).map(|members| Type::Struct { members }).parse(input) +} + fn parse_type(input: &str) -> ParseResult { - alt((type_void, type_integer, type_float, type_pointer))(input) + alt((type_void, type_integer, type_float, type_pointer, type_struct))(input) } fn parse_var_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMangler> { @@ -144,8 +153,25 @@ mod tests { assert!(type_pointer("i0").is_err()); } + #[test] + fn parse_struct() { + assert!(type_struct("r1u8").is_ok()); + assert!(type_struct("r1r2u8u49").is_ok()); + assert!(type_struct("r5pu8r1u8u32u32pv").is_ok()); + + // these are fine - we parse a struct which is valid, but we have remaining input. + // this needs to be handled by the toplevel parse function + assert!(type_struct("r0u8u8").is_ok()); + assert!(type_struct("r1u8u8").is_ok()); + + // invalid number of elements + assert!(type_struct("r15u8").is_err()); + assert!(type_struct("r1").is_err()); + assert!(type_struct("r2r1u8").is_err()); + } + #[test] fn parse_variable() { - SectionMangler::from("$RUSTY$var-name:u8"); + let _ = SectionMangler::from("$RUSTY$var-name:u8"); } } From a261e79fa4620aa00be674e494a634bec2c057ba Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Thu, 28 Mar 2024 12:03:47 +0100 Subject: [PATCH 16/40] section_mangler: Add decoding of enum types --- compiler/section_mangler/src/parser.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index 8487d196ed..b93dd2999e 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -67,8 +67,16 @@ fn type_struct(input: &str) -> ParseResult { many_m_n(n, n, parse_type).map(|members| Type::Struct { members }).parse(input) } +fn type_enum(input: &str) -> ParseResult { + char('e') + .and(number::) + .and(parse_type) + .map(|((_, elements), ty)| Type::Enum { referenced_type: Box::new(ty), elements }) + .parse(input) +} + fn parse_type(input: &str) -> ParseResult { - alt((type_void, type_integer, type_float, type_pointer, type_struct))(input) + alt((type_void, type_integer, type_float, type_pointer, type_struct, type_enum))(input) } fn parse_var_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMangler> { @@ -170,6 +178,15 @@ mod tests { assert!(type_struct("r2r1u8").is_err()); } + #[test] + fn parse_enum() { + assert!(type_enum("e15u8").is_ok()); + assert!(type_enum("e12pv").is_ok()); + + assert!(type_enum("e1").is_err()); + assert!(type_enum("eu8").is_err()); + } + #[test] fn parse_variable() { let _ = SectionMangler::from("$RUSTY$var-name:u8"); From 2df65612a5d7d69502a521272462a143137e4940 Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Fri, 29 Mar 2024 17:34:33 +0100 Subject: [PATCH 17/40] section_mangler: Derive Clone on SectionMangler --- compiler/section_mangler/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 4605d4104a..7908f39191 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -49,20 +49,20 @@ mod parser; /// The main builder type of this crate. Use it to create mangling contexts, in /// order to encode and decode binary type information. // TODO: Add example code for using this builder -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub enum SectionMangler { Function(FunctionMangler), Variable(VariableMangler), } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub struct FunctionMangler { name: String, parameters: Vec, return_type: Option, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub struct VariableMangler { name: String, ty: Type, @@ -118,7 +118,7 @@ impl SectionMangler { // NOTE: This is called `variable_linkage` in the `MemberInfo` struct. /// We have to encode this because if it changes, the function needs to be reloaded - this is an ABI breakage -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub enum FunctionArgument { ByValue(Type), ByRef(Type), @@ -135,7 +135,7 @@ impl fmt::Display for FunctionArgument { } // TODO: Do we have to encode this? Does that affect ABI? Probably -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub enum StringEncoding { // TODO: Should we encode this differently? this could cause problems compared to encoding unsigned types /// Encoded as `8u` @@ -155,7 +155,7 @@ impl fmt::Display for StringEncoding { // This maps directly to the [`DataTypeInformation`] enum in RuSTy - we simply remove some fields and add the ability to encode/decode serialize/deserialize // TODO: Do we have to handle Generic? -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Clone)] pub enum Type { /// Encoded as `v` Void, From 6370241af389f02b155d0e7046ee4de516298512 Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Fri, 29 Mar 2024 17:49:55 +0100 Subject: [PATCH 18/40] section_mangler: Add .name() method --- compiler/section_mangler/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index 7908f39191..d7b6b565ce 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -77,6 +77,13 @@ impl SectionMangler { SectionMangler::Variable(VariableMangler { name: name.into(), ty }) } + pub fn name(&self) -> &str { + match self { + SectionMangler::Function(FunctionMangler { name, .. }) + | SectionMangler::Variable(VariableMangler { name, .. }) => name, + } + } + pub fn with_parameter(self, param: FunctionArgument) -> SectionMangler { match self { SectionMangler::Function(f) => { From 48a1f002d92d668291784ea3d4fd844ba226c9cd Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Fri, 29 Mar 2024 17:50:04 +0100 Subject: [PATCH 19/40] section_mangler: Add parsing of mangled functions --- compiler/section_mangler/src/parser.rs | 43 ++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index b93dd2999e..6a60d738e8 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -1,4 +1,4 @@ -use crate::{SectionMangler, Type}; +use crate::{FunctionArgument, SectionMangler, Type}; use std::str; @@ -6,7 +6,7 @@ use nom::branch::alt; use nom::bytes::complete::{tag, take_until1}; use nom::character::complete::{char, digit1}; use nom::combinator::map_res; -use nom::multi::many_m_n; +use nom::multi::{many0, many_m_n}; use nom::sequence::delimited; use nom::{IResult, Parser}; @@ -85,6 +85,23 @@ fn parse_var_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionM Ok((input, SectionMangler::variable(name, ty))) } +fn parse_fn_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMangler> { + let (input, return_type) = parse_type(input)?; + let (input, parameters) = delimited(char('['), many0(parse_type), char(']'))(input)?; + + // TODO: Do not always encode parameters as ByValue + let mangler = parameters + .into_iter() + .fold(SectionMangler::function(name).with_return_type(Some(return_type)), |mangler, param| { + mangler.with_parameter(FunctionArgument::ByValue(param)) + }); + + // TODO: Would it be better for the function to encode the number of arguments it has? + // or just parse what is in between `[]` like we do currently? + + Ok((input, mangler)) +} + // We don't need to handle any kind of errors, because an invalid mangled string can only be // caused by a programming error or a mismatch in versions impl From<&str> for SectionMangler { @@ -94,7 +111,7 @@ impl From<&str> for SectionMangler { match prefix { Prefix::Var => parse_var_content(input, name).unwrap().1, - Prefix::Fn => todo!(), + Prefix::Fn => parse_fn_content(input, name).unwrap().1, } } } @@ -191,4 +208,24 @@ mod tests { fn parse_variable() { let _ = SectionMangler::from("$RUSTY$var-name:u8"); } + + #[test] + fn parse_function() { + let _ = SectionMangler::from("$RUSTY$fn-foo:u8[]"); + let _ = SectionMangler::from("$RUSTY$fn-foo:v[]"); + let _ = SectionMangler::from("$RUSTY$fn-foo:v[pvu8]"); + let _ = SectionMangler::from("$RUSTY$fn-foo:e156u394[pvu8r1e12u8]"); + } + + #[test] + #[should_panic] + fn parse_function_invalid_no_return_type() { + let _ = SectionMangler::from("$RUSTY$fn-no_return_type:[]"); + } + + #[test] + #[should_panic] + fn parse_function_invalid_no_arguments() { + let _ = SectionMangler::from("$RUSTY$fn-no_arguments:u16u8"); + } } From 10d782605865f464ffdace762e84d947f2c59069 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 18 Apr 2024 13:23:48 +0200 Subject: [PATCH 20/40] rusty: Update insta testsuite for section mangling. --- ...al_files__external_file_function_call.snap | 6 +- ...ernal_files__external_file_global_var.snap | 14 ++--- ...n_different_locations_with_debug_info.snap | 10 ++-- ...files__multiple_files_with_debug_info.snap | 10 ++-- ...iles__multiple_source_files_generated.snap | 10 ++-- compiler/section_mangler/src/parser.rs | 2 +- ...ate_return_value_variable_in_function.snap | 2 +- ...rray_size_correctly_set_in_dwarf_info.snap | 2 +- ...g__assignment_statement_have_location.snap | 2 +- ...ging__case_conditions_location_marked.snap | 2 +- ...bugging__exit_statement_have_location.snap | 2 +- ...l_is_not_added_as_external_subroutine.snap | 10 ++-- ...gging__for_conditions_location_marked.snap | 2 +- ...bugging__function_calls_have_location.snap | 2 +- ...on_calls_in_expressions_have_location.snap | 2 +- ...ugging__if_conditions_location_marked.snap | 2 +- ...g__implementation_added_as_subroutine.snap | 10 ++-- ...g__nested_function_calls_get_location.snap | 2 +- ...callable_expressions_have_no_location.snap | 2 +- ...on_function_pous_have_struct_as_param.snap | 8 +-- ...ng__repeat_conditions_location_marked.snap | 2 +- ...gging__return_statement_have_location.snap | 2 +- ...ring_size_correctly_set_in_dwarf_info.snap | 2 +- ...temp_variables_in_pous_added_as_local.snap | 10 ++-- ...out_inout_in_function_added_as_params.snap | 2 +- ...ing__while_conditions_location_marked.snap | 2 +- ...initializer_gets_declared_initializer.snap | 4 +- ..._initializer_gets_default_initializer.snap | 4 +- ...l_values_in_global_constant_variables.snap | 36 +++++------ ...s__initial_values_in_global_variables.snap | 6 +- ...lues_in_global_variables_out_of_order.snap | 10 ++-- ...tializers__uninitialized_global_array.snap | 2 +- ..._class_struct_initialized_in_function.snap | 10 ++-- ...ues_for_not_initialized_function_vars.snap | 2 +- ...global_variables_in_inline_assignment.snap | 14 ++--- ..._block_struct_initialized_in_function.snap | 10 ++-- ..._function_return_value_is_initialized.snap | 10 ++-- ..._is_initialized_with_type_initializer.snap | 8 +-- ...alue_with_initializers_is_initialized.snap | 14 ++--- ...e_without_initializers_is_initialized.snap | 10 ++-- ...tial_constant_values_in_pou_variables.snap | 10 ++-- ...ial_values_in_array_of_array_variable.snap | 2 +- ..._initial_values_in_function_block_pou.snap | 8 +-- ...lizers__initial_values_in_program_pou.snap | 4 +- ...lizers__initialized_array_in_function.snap | 2 +- ...s__initialized_array_type_in_function.snap | 4 +- ...for_struct_initialization_in_function.snap | 4 +- ..._for_struct_initialization_in_program.snap | 6 +- ...nt_functions_are_referenced_correctly.snap | 12 ++-- ...imilar_names_are_referenced_correctly.snap | 24 ++++---- ...alias_chain_with_lots_of_initializers.snap | 8 +-- ...izers__array_of_struct_initialization.snap | 12 ++-- ...t_variable_using_multiplied_statement.snap | 6 +- ...th_inline_initializer_are_initialized.snap | 32 +++++----- ...xpression_list_as_array_initilization.snap | 6 +- ...zers__incomplete_array_initialization.snap | 2 +- ...initialization_with_custom_init_value.snap | 2 +- ...s__initial_nested_struct_delayed_init.snap | 8 +-- ...y_variable_using_multiplied_statement.snap | 8 +-- ...lizers__initial_values_in_fb_variable.snap | 8 +-- ...ues_in_multi_dimension_array_variable.snap | 2 +- ...values_in_single_dimension_array_type.snap | 4 +- ...es_in_single_dimension_array_variable.snap | 16 ++--- ...izers__initial_values_in_struct_types.snap | 4 +- ...rs__initial_values_in_struct_variable.snap | 6 +- ...alues_in_struct_variable_missing_init.snap | 6 +- ...ers__initial_values_in_sub_range_type.snap | 2 +- ...alizers__initial_values_in_type_alias.snap | 2 +- ..._const_struct_will_get_default_values.snap | 6 +- ...array_of_structs_are_zero_initialized.snap | 8 +-- ...t_initial_values_different_data_types.snap | 4 +- ...on_uses_types_default_if_not_provided.snap | 4 +- ...alizer_uses_fallback_to_field_default.snap | 4 +- ...uct_with_one_field_can_be_initialized.snap | 4 +- ..._are_used_for_uninitialized_constants.snap | 8 +-- src/codegen/tests/parameters_tests.rs | 42 ++++++------- ...enerates_in_separate_global_variables.snap | 8 +-- ...sts__accessing_nested_array_in_struct.snap | 6 +- ...e_gen_tests__accessing_nested_structs.snap | 8 +-- ...e_gen_tests__action_called_in_program.snap | 6 +- ...sts__array_of_cast_int_type_generated.snap | 4 +- ..._int_non_zero_negative_type_generated.snap | 4 +- ..._array_of_int_non_zero_type_generated.snap | 4 +- ...en_tests__array_of_int_type_generated.snap | 4 +- ...ode_gen_tests__array_of_int_type_used.snap | 4 +- ...ype_with_non_zero_negative_start_used.snap | 4 +- ..._of_int_type_with_non_zero_start_used.snap | 4 +- ...d_variable_declaration_is_initialized.snap | 8 +-- ...mber_of_another_struct_is_initialized.snap | 8 +-- ..._code_gen_tests__arrays_are_generated.snap | 4 +- ..._with_global_const_size_are_generated.snap | 16 ++--- ..._gen_tests__basic_datatypes_generated.snap | 26 ++++---- ...onstant_expressions_in_case_selectors.snap | 8 +-- ...th_enum_expressions_in_case_selectors.snap | 10 ++-- ...__case_with_multiple_labels_statement.snap | 4 +- ...gen_tests__case_with_ranges_statement.snap | 4 +- ...s__casted_literals_bool_code_gen_test.snap | 4 +- ..._tests__casted_literals_code_gen_test.snap | 4 +- ...ts__casted_literals_hex_code_gen_test.snap | 4 +- ...asted_literals_hex_ints_code_gen_test.snap | 4 +- ...__casted_literals_lreal_code_gen_test.snap | 4 +- ...s__casted_literals_real_code_gen_test.snap | 4 +- ...ests__class_member_access_from_method.snap | 6 +- ...__code_gen_tests__class_method_in_pou.snap | 10 ++-- ...sts__code_gen_tests__complex_pointers.snap | 4 +- ...ion_in_function_blocks_are_propagated.snap | 4 +- ...anged_type_declaration_are_propagated.snap | 8 +-- ...gation_of_struct_fields_on_assignment.snap | 6 +- ..._contants_in_case_statements_resolved.snap | 4 +- ..._date_and_time_addition_in_var_output.snap | 2 +- ..._and_time_global_constants_initialize.snap | 36 +++++------ ...sts__code_gen_tests__date_comparisons.snap | 4 +- ...ues_for_not_initialized_function_vars.snap | 2 +- ..._gen_tests__different_case_references.snap | 4 +- ...tion_with_name_generates_int_function.snap | 2 +- ...lobal_variable_list_generates_nothing.snap | 4 +- ...ram_with_name_generates_void_function.snap | 4 +- ...pty_statements_dont_generate_anything.snap | 4 +- ...num_members_can_be_used_in_asignments.snap | 10 ++-- ...__code_gen_tests__enums_are_generated.snap | 8 +-- ...ests__enums_custom_type_are_generated.snap | 12 ++-- ...xpression_list_as_array_initilization.snap | 6 +- ...__external_function_called_in_program.snap | 6 +- ...global_variable_generates_as_external.snap | 8 +-- ...ternal_program_global_var_is_external.snap | 4 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 10 ++-- ...ode_gen_tests__for_statement_continue.snap | 4 +- ...ts__code_gen_tests__for_statement_int.snap | 4 +- ...s__code_gen_tests__for_statement_lint.snap | 4 +- ...s__code_gen_tests__for_statement_sint.snap | 4 +- ...en_tests__for_statement_with_continue.snap | 4 +- ...de_gen_tests__for_statement_with_exit.snap | 4 +- ..._statement_with_references_steps_test.snap | 4 +- ..._tests__for_statement_with_steps_test.snap | 4 +- ...sts__for_statement_without_steps_test.snap | 4 +- ...n_tests__function_block_instance_call.snap | 8 +-- ...unction_block_qualified_instance_call.snap | 12 ++-- ...on_call_with_same_name_as_return_type.snap | 6 +- ...gen_tests__function_called_in_program.snap | 6 +- ..._tests__function_called_when_shadowed.snap | 6 +- ...on_with_local_temp_var_initialization.snap | 6 +- ...ith_local_var_initialization_and_call.snap | 6 +- ...ion_with_parameters_called_in_program.snap | 6 +- ...with_two_parameters_called_in_program.snap | 6 +- ...lobal_variable_reference_is_generated.snap | 6 +- ...n_tests__if_elsif_else_generator_test.snap | 4 +- ...ts__code_gen_tests__if_generator_test.snap | 4 +- ...ts__if_with_expression_generator_test.snap | 4 +- ...gen_tests__inline_enums_are_generated.snap | 8 +-- ...n_tests__inline_structs_are_generated.snap | 4 +- ...rray_size_from_local_scoped_constants.snap | 10 ++-- ...code_gen_tests__method_codegen_return.snap | 6 +- ...__code_gen_tests__method_codegen_void.snap | 6 +- ...do_not_result_in_an_under_or_overflow.snap | 4 +- ...code_gen_tests__multidim_array_access.snap | 4 +- ...gen_tests__multidim_array_declaration.snap | 4 +- ...__code_gen_tests__nested_array_access.snap | 4 +- ...e_gen_tests__nested_array_cube_writes.snap | 4 +- ...sted_array_cube_writes_negative_start.snap | 4 +- ...e_gen_tests__nested_array_declaration.snap | 4 +- ...ts__nested_function_called_in_program.snap | 8 +-- ...n_tests__order_var_and_var_temp_block.snap | 4 +- ...__code_gen_tests__pass_inout_to_inout.snap | 12 ++-- ...s__pointer_and_array_access_to_in_out.snap | 2 +- ...s__code_gen_tests__pointers_generated.snap | 4 +- ..._gen_tests__program_called_in_program.snap | 8 +-- ...gen_tests__program_with_and_statement.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ..._program_with_casted_chars_assignment.snap | 4 +- ...s__code_gen_tests__program_with_chars.snap | 4 +- ...n_tests__program_with_date_assignment.snap | 4 +- ..._assignment_whit_short_datatype_names.snap | 4 +- ...arison_assignment_generates_correctly.snap | 4 +- ...am_with_local_temp_var_initialization.snap | 8 +-- ...ts__program_with_long_date_assignment.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ..._gen_tests__program_with_or_statement.snap | 4 +- ...en_tests__program_with_real_additions.snap | 4 +- ...n_tests__program_with_real_assignment.snap | 4 +- ...ts__program_with_real_cast_assignment.snap | 4 +- ...gram_with_signed_combined_expressions.snap | 4 +- ..._program_with_special_chars_in_string.snap | 4 +- ...tests__program_with_string_assignment.snap | 4 +- ...n_tests__program_with_time_assignment.snap | 4 +- ...__program_with_time_of_day_assignment.snap | 4 +- ...explicit_parameters_called_in_program.snap | 8 +-- ...with_two_parameters_called_in_program.snap | 8 +-- ...gram_with_var_inout_called_in_program.snap | 8 +-- ...rogram_with_var_out_called_in_program.snap | 8 +-- ..._with_var_out_called_mixed_in_program.snap | 8 +-- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...es_generates_void_function_and_struct.snap | 4 +- ...gen_tests__program_with_xor_statement.snap | 4 +- ...fied_action_from_fb_called_in_program.snap | 10 ++-- ...fied_foreign_action_called_in_program.snap | 10 ++-- ...lified_local_action_called_in_program.snap | 6 +- ...ests__real_function_called_in_program.snap | 6 +- ...e_gen_tests__reference_qualified_name.snap | 12 ++-- ...nce_assignments_in_function_arguments.snap | 22 +++---- ...sts__code_gen_tests__repeat_statement.snap | 4 +- ...en_tests__returning_early_in_function.snap | 2 +- ...ts__returning_early_in_function_block.snap | 4 +- ...e_gen_tests__simple_case_i8_statement.snap | 4 +- ...code_gen_tests__simple_case_statement.snap | 4 +- ...binary_expression_with_different_size.snap | 2 +- ...code_gen_tests__structs_are_generated.snap | 8 +-- ...ts__structs_members_can_be_referenced.snap | 6 +- ..._gen_tests__sub_range_check_functions.snap | 12 ++-- ...nge_type_calls_check_function_missing.snap | 6 +- ...ype_calls_check_function_on_assigment.snap | 6 +- ...ariables_have_nano_seconds_resolution.snap | 4 +- ...enerates_in_separate_global_variables.snap | 10 ++-- ..._gen_tests__typed_enums_are_generated.snap | 24 ++++---- ..._tests__typed_enums_are_used_properly.snap | 22 +++---- ...enums_with_initializers_are_generated.snap | 24 ++++---- ...ith_partly_initializers_are_generated.snap | 24 ++++---- ...ng_cast_statement_as_const_expression.snap | 4 +- ..._using_const_expression_in_range_type.snap | 10 ++-- ...s__using_global_consts_in_expressions.snap | 10 ++-- ..._variable_with_same_name_as_data_type.snap | 6 +- ...de_gen_tests__while_loop_with_if_exit.snap | 4 +- ...ests__code_gen_tests__while_statement.snap | 4 +- ...ests__while_with_expression_statement.snap | 4 +- ...s__aliased_number_type_comparing_test.snap | 2 +- ...sed_ranged_number_type_comparing_test.snap | 2 +- ...uctions_tests__compare_datetime_types.snap | 4 +- ...uction_functions_with_different_types.snap | 6 +- ...are_instructions_with_different_types.snap | 6 +- ...s_tests__pointer_compare_instructions.snap | 4 +- ...er_function_call_compare_instructions.snap | 6 +- ...ts__ranged_number_type_comparing_test.snap | 2 +- ...uctions_tests__string_comparison_test.snap | 4 +- ...ests__string_equal_with_constant_test.snap | 4 +- ...g_greater_or_equal_with_constant_test.snap | 6 +- ...ts__string_greater_with_constant_test.snap | 4 +- ...tests__string_less_with_constant_test.snap | 4 +- ...__string_not_equal_with_constant_test.snap | 4 +- ...g_smaller_or_equal_with_constant_test.snap | 6 +- ...tests__assigning_const_array_variable.snap | 6 +- ...ests__assigning_const_string_variable.snap | 6 +- ...ests__assigning_const_struct_variable.snap | 8 +-- ...__debug_tests__dwarf_version_override.snap | 2 +- ...tests__debug_tests__global_alias_type.snap | 2 +- ..._global_var_array_added_to_debug_info.snap | 6 +- ...lobal_var_byteseq_added_to_debug_info.snap | 10 ++-- ...__global_var_enum_added_to_debug_info.snap | 20 +++---- ..._global_var_float_added_to_debug_info.snap | 4 +- ...s__global_var_int_added_to_debug_info.snap | 16 ++--- ...var_nested_struct_added_to_debug_info.snap | 6 +- ...lobal_var_pointer_added_to_debug_info.snap | 2 +- ...global_var_string_added_to_debug_info.snap | 4 +- ...global_var_struct_added_to_debug_info.snap | 6 +- ...rectaccess_test__bitaccess_assignment.snap | 2 +- ...ectaccess_test__byteaccess_assignment.snap | 2 +- ...ctaccess_test__chained_bit_assignment.snap | 2 +- ...ctaccess_test__dwordaccess_assignment.snap | 2 +- ...ctaccess_test__lwordaccess_assignment.snap | 2 +- ..._test__qualified_reference_assignment.snap | 4 +- ...ectaccess_test__wordaccess_assignment.snap | 2 +- ...n_tests__access_string_via_byte_array.snap | 4 +- ...ssion_tests__allowed_assignable_types.snap | 4 +- ...__expression_tests__builtin_add_float.snap | 2 +- ...s__expression_tests__builtin_add_ints.snap | 2 +- ...__expression_tests__builtin_add_mixed.snap | 2 +- ...__expression_tests__builtin_div_float.snap | 2 +- ...s__expression_tests__builtin_div_ints.snap | 2 +- ...__expression_tests__builtin_div_mixed.snap | 2 +- ...sion_tests__builtin_function_call_adr.snap | 4 +- ...ts__builtin_function_call_lower_bound.snap | 8 +-- ...ion_tests__builtin_function_call_move.snap | 4 +- ...sion_tests__builtin_function_call_mux.snap | 4 +- ...function_call_mux_with_aggregate_type.snap | 4 +- ...sion_tests__builtin_function_call_ref.snap | 4 +- ...sion_tests__builtin_function_call_sel.snap | 4 +- ...iltin_function_call_sel_as_expression.snap | 4 +- ...n_tests__builtin_function_call_sizeof.snap | 4 +- ...ts__builtin_function_call_upper_bound.snap | 8 +-- ...uiltin_function_call_upper_bound_expr.snap | 10 ++-- ...__expression_tests__builtin_mul_float.snap | 2 +- ...s__expression_tests__builtin_mul_ints.snap | 2 +- ...__expression_tests__builtin_mul_mixed.snap | 2 +- ...__expression_tests__builtin_sub_float.snap | 2 +- ...s__expression_tests__builtin_sub_ints.snap | 2 +- ...__expression_tests__builtin_sub_mixed.snap | 2 +- ...s__calling_strings_in_function_return.snap | 6 +- ...ion_tests__cast_between_pointer_types.snap | 4 +- ...pression_tests__cast_lword_to_pointer.snap | 2 +- ...pression_tests__cast_pointer_to_lword.snap | 2 +- ...ion_tests__compare_date_time_literals.snap | 4 +- ...tests__hardware_access_assign_codegen.snap | 4 +- ...ession_tests__hardware_access_codegen.snap | 4 +- ...gen__tests__expression_tests__max_int.snap | 4 +- ...ression_tests__nested_call_statements.snap | 6 +- ...expression_tests__pointer_arithmetics.snap | 4 +- ...ts__pointer_arithmetics_function_call.snap | 6 +- ...on_tests__pointers_in_function_return.snap | 2 +- ...ion_tests__strings_in_function_return.snap | 2 +- ...ion_tests__structs_in_function_return.snap | 4 +- ...s__expression_tests__type_mix_in_call.snap | 4 +- ..._tests__unary_expressions_can_be_real.snap | 4 +- ...necessary_casts_between_pointer_types.snap | 4 +- ...ests__argument_fed_by_ref_then_by_val.snap | 6 +- ...t_argument_literals_for_function_call.snap | 6 +- ...argument_references_for_function_call.snap | 12 ++-- ...ized_string_varargs_called_in_program.snap | 6 +- ..._with_sized_varargs_called_in_program.snap | 6 +- ...nction_with_varargs_called_in_program.snap | 6 +- ...literal_string_argument_passed_by_ref.snap | 6 +- ...ction_tests__member_variables_in_body.snap | 2 +- ..._output_should_be_passed_as_a_pointer.snap | 2 +- ...tests__passing_a_string_to_a_function.snap | 6 +- ...g_a_string_to_a_function_as_reference.snap | 6 +- ...arguments_to_functions_by_ref_and_val.snap | 6 +- ...tests__return_variable_in_nested_call.snap | 4 +- ...n__tests__function_tests__simple_call.snap | 6 +- ...on_tests__var_output_in_function_call.snap | 6 +- ...t__any_real_function_called_with_ints.snap | 8 +-- ...eneric_call_gets_cast_to_biggest_type.snap | 4 +- ...unction_call_generates_real_type_call.snap | 8 +-- ...nerics_test__generic_output_parameter.snap | 6 +- ...pe_defined_in_external_file_in_module.snap | 8 +-- ...ed_in_external_file_no_deps_in_module.snap | 6 +- ...nitialized_in_external_file_in_module.snap | 4 +- ...n_tests__enum_referenced_in_fb_nested.snap | 30 +++++----- ...ts__function_defined_in_external_file.snap | 32 +++++----- ...sts__global_value_from_different_file.snap | 22 +++---- ...ct_with_custom_init_in_different_file.snap | 12 ++-- ...ccepts_empty_statement_as_input_param.snap | 8 +-- ...cepts_empty_statement_as_output_param.snap | 8 +-- ...ccepts_empty_statement_as_input_param.snap | 6 +- ...cepts_empty_statement_as_output_param.snap | 6 +- ...sts__function_all_parameters_assigned.snap | 6 +- ...function_default_value_parameter_type.snap | 6 +- ...ests__function_empty_inout_assignment.snap | 6 +- ...ests__function_empty_input_assignment.snap | 6 +- ...sts__function_empty_output_assignment.snap | 6 +- ...empty_output_default_value_assignment.snap | 6 +- ...ts__function_missing_inout_assignment.snap | 6 +- ...ts__function_missing_input_assignment.snap | 6 +- ...issing_input_default_value_assignment.snap | 6 +- ...s__function_missing_output_assignment.snap | 6 +- ...ssing_output_default_value_assignment.snap | 6 +- ...unction_block_pointer_are_assigned_to.snap | 8 +-- ...ccepts_empty_statement_as_input_param.snap | 8 +-- ...cepts_empty_statement_as_output_param.snap | 8 +-- ...gram_all_parameters_assigned_explicit.snap | 8 +-- ...gram_all_parameters_assigned_implicit.snap | 8 +-- ...tests__program_empty_inout_assignment.snap | 8 +-- ...sts__program_missing_input_assignment.snap | 8 +-- ...ts__program_missing_output_assignment.snap | 8 +-- ...var_in_out_params_can_be_out_of_order.snap | 10 ++-- ...taccess_generated_as_rsh_and_trunc_i1.snap | 4 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 4 +- ...access_generated_as_rsh_and_trunc_i32.snap | 4 +- ...gen_test__floating_point_type_casting.snap | 2 +- ...n_result_assignment_on_aliased_string.snap | 4 +- ..._function_result_assignment_on_string.snap | 4 +- ...t_codegen_test__nested_bitwise_access.snap | 4 +- ...n_test__variable_based_bitwise_access.snap | 4 +- ...access_generated_as_rsh_and_trunc_i16.snap | 4 +- ..._casted_string_assignment_uses_memcpy.snap | 4 +- ...g_generic_string_should_return_by_ref.snap | 6 +- ...ts__function_returns_a_literal_string.snap | 6 +- ...es_string_paramter_and_returns_string.snap | 6 +- ...rings_should_be_collected_as_literals.snap | 2 +- ...ialization_of_multi_dim_string_arrays.snap | 4 +- ...__string_tests__program_string_output.snap | 8 +-- ...program_with_casted_string_assignment.snap | 4 +- ...__program_with_string_type_assignment.snap | 8 +-- ...sts__string_tests__simple_string_test.snap | 4 +- ...ing_tests__string_function_parameters.snap | 6 +- ...stant_var_string_should_be_memcpyable.snap | 4 +- ...ar_string_should_be_memcpyable_nonref.snap | 4 +- ...ariable_length_strings_can_be_created.snap | 4 +- ...trings_using_constants_can_be_created.snap | 8 +-- ...ests__variable_string_assignment_test.snap | 4 +- ...string_tests__vartmp_string_init_test.snap | 4 +- ...ed_datatypes_respect_conversion_rules.snap | 4 +- ...r_than_int_promote_the_second_operand.snap | 4 +- ...es_smaller_than_dint_promoted_to_dint.snap | 4 +- ...all_sint_expressions_fallback_to_dint.snap | 4 +- ...at_and_double_mix_converted_to_double.snap | 4 +- ...m_test__float_assigned_to_int_is_cast.snap | 4 +- ...t__float_assinged_to_double_to_double.snap | 4 +- ...m_test__int_assigned_to_float_is_cast.snap | 4 +- ...an_byte_promoted_on_compare_statement.snap | 4 +- ...bigger_than_float_converted_to_double.snap | 4 +- ..._or_equal_to_float_converted_to_float.snap | 4 +- ...ariadic_functions_without_declaration.snap | 6 +- ...hile_32bit_and_higher_keep_their_type.snap | 4 +- ...es_smaller_than_dint_promoted_to_dint.snap | 4 +- ...e_calls_with_differently_sized_arrays.snap | 6 +- ...al_variable_passed_to_function_as_vla.snap | 8 +-- ...ruct_is_generated_for_call_statements.snap | 6 +- ...sts__vla_tests__multi_dimensional_vla.snap | 6 +- ...en__tests__vla_tests__vla_read_access.snap | 6 +- ...default_value_compile_time_evaluation.snap | 10 ++-- ...default_value_compile_time_evaluation.snap | 18 +++--- ...values_are_transitive_for_range_types.snap | 10 ++-- src/tests/adr/arrays_adr.rs | 18 +++--- src/tests/adr/enum_adr.rs | 60 +++++++++---------- src/tests/adr/pou_adr.rs | 50 ++++++++-------- src/tests/adr/strings_adr.rs | 16 ++--- src/tests/adr/structs_adr.rs | 28 ++++----- src/tests/adr/vla_adr.rs | 14 ++--- ...__integration__cfc__ir__actions_debug.snap | 8 +-- ...egration__cfc__ir__conditional_return.snap | 4 +- ...on__cfc__ir__conditional_return_debug.snap | 2 +- ...r__conditional_return_evaluating_true.snap | 6 +- ...tional_return_evaluating_true_negated.snap | 6 +- ...sts__integration__cfc__ir__jump_debug.snap | 4 +- ...on__cfc__ir__jump_to_label_with_false.snap | 2 +- ...ion__cfc__ir__jump_to_label_with_true.snap | 2 +- ...tegration__cfc__ir__sink_source_debug.snap | 4 +- ...ble_source_to_variable_and_block_sink.snap | 6 +- ...line_compile__ir_generation_full_pass.snap | 2 +- 423 files changed, 1373 insertions(+), 1373 deletions(-) diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap index 3436f9b653..4574b77102 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap @@ -5,7 +5,7 @@ expression: "results.join(\"\\n\")" ; ModuleID = 'main.st' source_filename = "main.st" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -14,9 +14,9 @@ entry: ret i16 %main_ret } -declare i16 @external() section "fn-external:i16" +declare i16 @external() section "fn-$RUSTY$external:i16" ; ModuleID = 'external.st' source_filename = "external.st" -declare i16 @external() section "fn-external:i16" +declare i16 @external() section "fn-$RUSTY$external:i16" 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 906f3dee39..cc8effcdc0 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,10 +5,10 @@ expression: "results.join(\"\\n\")" ; ModuleID = 'main.st' source_filename = "main.st" -@x = external global i16, section "var-x:i16" -@y = external global i16, section "var-y:i16" +@x = external global i16, section "var-$RUSTY$x:i16" +@y = external global i16, section "var-$RUSTY$y:i16" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -19,12 +19,12 @@ entry: ret i16 %main_ret } -declare i16 @external() section "fn-external:i16" +declare i16 @external() section "fn-$RUSTY$external:i16" ; ModuleID = 'external.st' source_filename = "external.st" -@x = external global i16, section "var-x:i16" -@y = external global i16, section "var-y:i16" +@x = external global i16, section "var-$RUSTY$x:i16" +@y = external global i16, section "var-$RUSTY$y:i16" -declare i16 @external() section "fn-external:i16" +declare i16 @external() section "fn-$RUSTY$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 f222c8c139..4deafcb831 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,9 +7,9 @@ source_filename = "app/file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0", !dbg !0 +@mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define i16 @main() section "fn-main:i16" !dbg !10 { +define i16 @main() section "fn-$RUSTY$main:i16" !dbg !10 { entry: %main = alloca i16, align 2, !dbg !14 call void @llvm.dbg.declare(metadata i16* %main, metadata !15, metadata !DIExpression()), !dbg !17 @@ -19,7 +19,7 @@ entry: ret i16 %main_ret, !dbg !14 } -declare !dbg !18 void @mainProg(%mainProg*) section "fn-mainProg:v" +declare !dbg !18 void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 @@ -54,9 +54,9 @@ source_filename = "lib/file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0", !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define void @mainProg(%mainProg* %0) section "fn-mainProg:v" !dbg !10 { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" !dbg !10 { entry: call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 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 7d0ea4dbac..a8623288bf 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,9 +7,9 @@ source_filename = "file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0", !dbg !0 +@mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define i16 @main() section "fn-main:i16" !dbg !10 { +define i16 @main() section "fn-$RUSTY$main:i16" !dbg !10 { entry: %main = alloca i16, align 2, !dbg !14 call void @llvm.dbg.declare(metadata i16* %main, metadata !15, metadata !DIExpression()), !dbg !17 @@ -19,7 +19,7 @@ entry: ret i16 %main_ret, !dbg !14 } -declare !dbg !18 void @mainProg(%mainProg*) section "fn-mainProg:v" +declare !dbg !18 void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 @@ -54,9 +54,9 @@ source_filename = "file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0", !dbg !0 +@mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define void @mainProg(%mainProg* %0) section "fn-mainProg:v" !dbg !10 { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" !dbg !10 { entry: call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 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 af0669184c..e2f0569d08 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,9 +7,9 @@ source_filename = "external_file1.st" %mainProg = type {} -@mainProg_instance = external global %mainProg, section "var-mainProg_instance:r0" +@mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -18,16 +18,16 @@ entry: ret i16 %main_ret } -declare void @mainProg(%mainProg*) section "fn-mainProg:v" +declare void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" ; ModuleID = 'external_file2.st' source_filename = "external_file2.st" %mainProg = type {} -@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r0" +@mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0" -define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { entry: ret void } diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index 6a60d738e8..74f3e5baa2 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -92,7 +92,7 @@ fn parse_fn_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMa // TODO: Do not always encode parameters as ByValue let mangler = parameters .into_iter() - .fold(SectionMangler::function(name).with_return_type(Some(return_type)), |mangler, param| { + .fold(SectionMangler::function(name).with_return_type(return_type), |mangler, param| { mangler.with_parameter(FunctionArgument::ByValue(param)) }); diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 81635ebc49..3ce6a9f94b 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @myFunc([81 x i8]* %0) section "fn-myFunc:s8u81" !dbg !4 { +define void @myFunc([81 x i8]* %0) section "fn-$RUSTY$myFunc:s8u81" !dbg !4 { entry: %myFunc = alloca [81 x i8]*, align 8, !dbg !8 store [81 x i8]* %0, [81 x i8]** %myFunc, align 8, !dbg !8 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index ebcd7d42a6..1c24e9fc49 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @foo() section "fn-foo:i32" !dbg !4 { +define i32 @foo() section "fn-$RUSTY$foo:i32" !dbg !4 { entry: %foo = alloca i32, align 4, !dbg !8 %a = alloca [64 x i32], align 4, !dbg !8 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap index ca675c0646..31e1606764 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap index 3714952f22..eaba11dbb2 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap index 53c07e43d1..77f390e60e 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 8716e8c483..4cc815874e 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,14 +8,14 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = external global %myPrg, section "var-myPrg_instance:r0", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r0", !dbg !5 +@myPrg_instance = external global %myPrg, section "var-$RUSTY$myPrg_instance:r0", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r0", !dbg !5 -declare i32 @myFunc() section "fn-myFunc:i32" +declare i32 @myFunc() section "fn-$RUSTY$myFunc:i32" -declare void @myPrg(%myPrg*) section "fn-myPrg:v" +declare void @myPrg(%myPrg*) section "fn-$RUSTY$myPrg:v" -declare void @myFb(%myFb*) section "fn-myFb:v" +declare void @myFb(%myFb*) section "fn-$RUSTY$myFb:v" !llvm.module.flags = !{!8, !9} !llvm.dbg.cu = !{!10} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index 25ab7b4faf..113f95b2ce 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap index 63a0d1ca3e..3ca5c86ad4 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap index 44e6a5e1d9..ecd3a71e1d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap index 659d180e98..a9cd134c7d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 aeb8159021..4031d2368c 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,10 +8,10 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:r0", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r0", !dbg !5 +@myPrg_instance = global %myPrg zeroinitializer, section "var-$RUSTY$myPrg_instance:r0", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r0", !dbg !5 -define i32 @myFunc() section "fn-myFunc:i32" !dbg !12 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !12 { entry: %myFunc = alloca i32, align 4, !dbg !15 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !16, metadata !DIExpression()), !dbg !18 @@ -20,13 +20,13 @@ entry: ret i32 %myFunc_ret, !dbg !15 } -define void @myPrg(%myPrg* %0) section "fn-myPrg:v" !dbg !19 { +define void @myPrg(%myPrg* %0) section "fn-$RUSTY$myPrg:v" !dbg !19 { entry: call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !20, metadata !DIExpression()), !dbg !21 ret void, !dbg !21 } -define void @myFb(%myFb* %0) section "fn-myFb:v" !dbg !22 { +define void @myFb(%myFb* %0) section "fn-$RUSTY$myFb:v" !dbg !22 { entry: call void @llvm.dbg.declare(metadata %myFb* %0, metadata !23, metadata !DIExpression()), !dbg !24 ret void, !dbg !24 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap index 96f7356258..acecf314cd 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc(i32 %0) section "fn-myFunc:i32[i32]" !dbg !4 { +define i32 @myFunc(i32 %0) section "fn-$RUSTY$myFunc:i32[i32]" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !9 %x = alloca i32, align 4, !dbg !9 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap index f43862598f..7c33e7e21b 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 72144e9bdb..d1f406fd7b 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,10 +8,10 @@ source_filename = "main" %myProg = type { i32 } %fb = type { i32 } -@myProg_instance = global %myProg zeroinitializer, section "var-myProg_instance:r1i32", !dbg !0 -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32", !dbg !7 +@myProg_instance = global %myProg zeroinitializer, section "var-$RUSTY$myProg_instance:r1i32", !dbg !0 +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1i32", !dbg !7 -define void @myProg(%myProg* %0) section "fn-myProg:v[i32]" !dbg !16 { +define void @myProg(%myProg* %0) section "fn-$RUSTY$myProg:v[i32]" !dbg !16 { entry: call void @llvm.dbg.declare(metadata %myProg* %0, metadata !20, metadata !DIExpression()), !dbg !21 %x = getelementptr inbounds %myProg, %myProg* %0, i32 0, i32 0, !dbg !21 @@ -21,7 +21,7 @@ entry: ret void, !dbg !21 } -define void @fb(%fb* %0) section "fn-fb:v[i32]" !dbg !22 { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v[i32]" !dbg !22 { entry: call void @llvm.dbg.declare(metadata %fb* %0, metadata !23, metadata !DIExpression()), !dbg !24 %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0, !dbg !24 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap index c3f649b11a..bd34efaee8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap index 5c78927129..d8bd529d70 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 8fc968ed22..f7bc5dbd46 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, section "var-a:s8u65", !dbg !0 +@a = global [65 x i8] zeroinitializer, section "var-$RUSTY$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 f5f3b5abdf..41c3cd88b7 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,10 +8,10 @@ source_filename = "main" %myPrg = type {} %myFb = type {} -@myPrg_instance = global %myPrg zeroinitializer, section "var-myPrg_instance:r3i32i32i32", !dbg !0 -@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-__myFb__init:r3i32i32i32", !dbg !9 +@myPrg_instance = global %myPrg zeroinitializer, section "var-$RUSTY$myPrg_instance:r3i32i32i32", !dbg !0 +@__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r3i32i32i32", !dbg !9 -define i32 @myFunc() section "fn-myFunc:i32" !dbg !20 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !20 { entry: %myFunc = alloca i32, align 4, !dbg !24 %a = alloca i32, align 4, !dbg !24 @@ -29,7 +29,7 @@ entry: ret i32 %myFunc_ret, !dbg !24 } -define void @myPrg(%myPrg* %0) section "fn-myPrg:v" !dbg !33 { +define void @myPrg(%myPrg* %0) section "fn-$RUSTY$myPrg:v" !dbg !33 { entry: call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !34, metadata !DIExpression()), !dbg !35 %a = alloca i32, align 4, !dbg !35 @@ -44,7 +44,7 @@ entry: ret void, !dbg !35 } -define void @myFb(%myFb* %0) section "fn-myFb:v" !dbg !42 { +define void @myFb(%myFb* %0) section "fn-$RUSTY$myFb:v" !dbg !42 { entry: call void @llvm.dbg.declare(metadata %myFb* %0, metadata !43, metadata !DIExpression()), !dbg !44 %a = alloca i32, align 4, !dbg !44 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap index 497bfb673f..ae19840b1f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc(i16* %0) section "fn-myFunc:i32[pi16]" !dbg !4 { +define i32 @myFunc(i16* %0) section "fn-$RUSTY$myFunc:i32[pi16]" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !10 %x = alloca i16*, align 8, !dbg !10 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap index eacacdaa22..be5cce04c5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-myFunc:i32" !dbg !4 { +define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 bd08390653..3b4650feec 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,9 +7,9 @@ source_filename = "main" %commands = type { i8, i8 } -@__commands__init = unnamed_addr constant %commands { i8 1, i8 0 }, section "var-__commands__init:r2u8u8" +@__commands__init = unnamed_addr constant %commands { i8 1, i8 0 }, section "var-$RUSTY$__commands__init:r2u8u8" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %cmd1 = alloca %commands, align 8 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 4f46ab41ec..2eea070ead 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,10 +7,10 @@ source_filename = "main" %commands = type { i8, i8 } -@__commands__init = unnamed_addr constant %commands zeroinitializer, section "var-__commands__init:r2u8u8" +@__commands__init = unnamed_addr constant %commands zeroinitializer, section "var-$RUSTY$__commands__init:r2u8u8" @__main.myStr1__init = unnamed_addr constant [81 x i8] zeroinitializer -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %cmd1 = alloca %commands, align 8 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 13dad12aa2..5394c610e3 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 @@ -5,21 +5,21 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@c_INT = unnamed_addr constant i16 7, section "var-$RUSTY$c_INT:i16" +@c_3c = unnamed_addr constant i16 21, section "var-$RUSTY$c_3c:i16" +@c_BOOL = unnamed_addr constant i8 1, section "var-$RUSTY$c_BOOL:u8" +@c_not = unnamed_addr constant i8 0, section "var-$RUSTY$c_not:u8" +@c_str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00", section "var-$RUSTY$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-$RUSTY$c_wstr:s16u11" +@c_real = unnamed_addr constant float 0x40091EB860000000, section "var-$RUSTY$c_real:f32" +@c_lreal = unnamed_addr constant double 3.141500e+00, section "var-$RUSTY$c_lreal:f64" +@x = unnamed_addr constant i16 7, section "var-$RUSTY$x:i16" +@y = unnamed_addr constant i16 14, section "var-$RUSTY$y:i16" +@z = unnamed_addr constant i16 32, section "var-$RUSTY$z:i16" +@b = unnamed_addr constant i8 1, section "var-$RUSTY$b:u8" +@nb = unnamed_addr constant i8 0, section "var-$RUSTY$nb:u8" +@bb = unnamed_addr constant i8 0, section "var-$RUSTY$bb:u8" +@str = unnamed_addr constant [11 x i8] c"Hello\00\00\00\00\00\00", section "var-$RUSTY$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-$RUSTY$wstr:s16u11" +@r = unnamed_addr constant float 0x3FF91EB860000000, section "var-$RUSTY$r:f32" +@tau = unnamed_addr constant double 6.283000e+00, section "var-$RUSTY$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 80c3a364d3..2dde3124cb 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 @@ -5,6 +5,6 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i16 7, section "var-x:i16" -@y = global i8 1, section "var-y:u8" -@z = global float 0x400921CAC0000000, section "var-z:f32" +@x = global i16 7, section "var-$RUSTY$x:i16" +@y = global i8 1, section "var-$RUSTY$y:u8" +@z = global float 0x400921CAC0000000, section "var-$RUSTY$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 9c3506940d..72ff91eb83 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,17 +8,17 @@ source_filename = "main" %MyFB = type { i16 } %prg = type { %MyFB } -@x = global %MyFB { i16 77 }, section "var-x:r1i16" -@__MyFB__init = unnamed_addr constant %MyFB { i16 77 }, section "var-__MyFB__init:r1i16" -@prg_instance = global %prg { %MyFB { i16 77 } }, section "var-prg_instance:r1r1i16" +@x = global %MyFB { i16 77 }, section "var-$RUSTY$x:r1i16" +@__MyFB__init = unnamed_addr constant %MyFB { i16 77 }, section "var-$RUSTY$__MyFB__init:r1i16" +@prg_instance = global %prg { %MyFB { i16 77 } }, section "var-$RUSTY$prg_instance:r1r1i16" -define void @MyFB(%MyFB* %0) section "fn-MyFB:v" { +define void @MyFB(%MyFB* %0) section "fn-$RUSTY$MyFB:v" { entry: %x = getelementptr inbounds %MyFB, %MyFB* %0, i32 0, i32 0 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 80a3245948..9808139ec9 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [2 x i8] zeroinitializer, section "var-a:au8" +@a = global [2 x i8] zeroinitializer, section "var-$RUSTY$a:au8" 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 ea3ce2be28..064fe30b88 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,16 +8,16 @@ source_filename = "main" %fb = type { i16 } %main = type { %fb } -@__fb__init = unnamed_addr constant %fb { i16 9 }, section "var-__fb__init:r1i16" -@main_instance = global %main { %fb { i16 9 } }, section "var-main_instance:r1r1i16" +@__fb__init = unnamed_addr constant %fb { i16 9 }, section "var-$RUSTY$__fb__init:r1i16" +@main_instance = global %main { %fb { i16 9 } }, section "var-$RUSTY$main_instance:r1r1i16" -define void @fb(%fb* %0) section "fn-fb:v" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { entry: %a = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define i32 @func(%fb* %0) section "fn-func:i32[r1i16]" { +define i32 @func(%fb* %0) section "fn-$RUSTY$func:i32[r1i16]" { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 @@ -32,7 +32,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(%fb* %fb0) diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap index 7a25051693..049192b1e9 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @func() section "fn-func:i16" { +define i16 @func() section "fn-$RUSTY$func:i16" { entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 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 a6ef37ca32..e9c5abaf62 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,13 +5,13 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@x = global i32 10, section "var-x:i32" -@__foo_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" -@__bar_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" -@__foo_position.y = unnamed_addr constant i32 2, section "var-y:e2i32" -@__bar_position.y = unnamed_addr constant i32 4, section "var-y:e2i32" +@x = global i32 10, section "var-$RUSTY$x:i32" +@__foo_position.x = unnamed_addr constant i32 1, section "var-$RUSTY$x:e2i32" +@__bar_position.x = unnamed_addr constant i32 3, section "var-$RUSTY$x:e2i32" +@__foo_position.y = unnamed_addr constant i32 2, section "var-$RUSTY$y:e2i32" +@__bar_position.y = unnamed_addr constant i32 4, section "var-$RUSTY$y:e2i32" -define i32 @foo() section "fn-foo:i32" { +define i32 @foo() section "fn-$RUSTY$foo:i32" { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 @@ -21,7 +21,7 @@ entry: ret i32 %foo_ret } -define i32 @bar() section "fn-bar:i32" { +define i32 @bar() section "fn-$RUSTY$bar:i32" { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 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 39afc2b803..1194529443 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,15 +8,15 @@ source_filename = "main" %fb = type {} %main = type { %fb } -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r0" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1r0" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r0" -define void @fb(%fb* %0) section "fn-fb:v" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { entry: ret void } -define i32 @func(%fb* %0) section "fn-func:i32[r0]" { +define i32 @func(%fb* %0) section "fn-$RUSTY$func:i32[r0]" { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 @@ -31,7 +31,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(%fb* %fb0) 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 2293bdca13..e51987ffe3 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,9 +7,9 @@ source_filename = "main" %MyStruct = type { i32, i16 } -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i16" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i16" -define i16 @foo_int() section "fn-foo_int:i16" { +define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { entry: %foo_int = alloca i16, align 2 store i16 0, i16* %foo_int, align 2 @@ -17,7 +17,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { +define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_struct(%MyStruct* %0) section "fn-foo_struct:r2i32i16" { +define void @foo_struct(%MyStruct* %0) section "fn-$RUSTY$foo_struct:r2i32i16" { entry: %foo_struct = alloca %MyStruct*, align 8 store %MyStruct* %0, %MyStruct** %foo_struct, align 8 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 e7368126fe..28bcfce8cb 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,10 +7,10 @@ source_filename = "main" %main = type { [4 x i32], [4 x i32] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32ai32" -@__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__myArray__init:ai32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32ai32" +@__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-$RUSTY$__myArray__init:ai32" -define void @target([4 x i32]* %0) section "fn-target:ai32" { +define void @target([4 x i32]* %0) section "fn-$RUSTY$target:ai32" { entry: %target = alloca [4 x i32]*, align 8 store [4 x i32]* %0, [4 x i32]** %target, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 3e177922d8..e0f38a2099 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,11 +7,11 @@ 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", 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:af32" -@__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 }, section "var-__MyStrct__init:r3i32i32i32" +@__MyStr__init = unnamed_addr constant [11 x i8] c"init\00\00\00\00\00\00\00", section "var-$RUSTY$__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-$RUSTY$__MyArr__init:af32" +@__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 }, section "var-$RUSTY$__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-foo_int:i16" { +define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { entry: %foo_int = alloca i16, align 2 store i16 7, i16* %foo_int, align 2 @@ -19,7 +19,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -29,7 +29,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { +define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -39,7 +39,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:r3i32i32i32" { +define void @foo_strct(%MyStrct* %0) section "fn-$RUSTY$foo_strct:r3i32i32i32" { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 88b5aef7f0..10285ac17a 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,9 +7,9 @@ source_filename = "main" %MyStrct = type { i32, i32, i32 } -@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-__MyStrct__init:r3i32i32i32" +@__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-$RUSTY$__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-foo_int:i16" { +define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { entry: %foo_int = alloca i16, align 2 store i16 0, i16* %foo_int, align 2 @@ -17,7 +17,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-foo_arr:af32" { +define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-foo_strct:r3i32i32i32" { +define void @foo_strct(%MyStrct* %0) section "fn-$RUSTY$foo_strct:r3i32i32i32" { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 dca6c4b57f..13df4890ba 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,12 +7,12 @@ source_filename = "main" %prg = type { i16, i16 } -@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:r2i16i16" +@MAX_LEN = unnamed_addr constant i16 99, section "var-$RUSTY$MAX_LEN:i16" +@MIN_LEN = unnamed_addr constant i16 10, section "var-$RUSTY$MIN_LEN:i16" +@LEN = unnamed_addr constant i16 20, section "var-$RUSTY$LEN:i16" +@prg_instance = global %prg { i16 24, i16 89 }, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-prg:v[i16][i16]" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v[i16][i16]" { entry: %my_len = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %my_size = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 76fdcca816..c1c90a67fa 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 @@ -5,4 +5,4 @@ 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"], section "var-a:aau8" +@a = global [2 x [2 x i8]] [[2 x i8] c"\01\02", [2 x i8] c"\03\04"], section "var-$RUSTY$a:aau8" 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 257d474369..1e8c0d7672 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,10 +8,10 @@ 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 }, section "var-__FB__init:r6i16i16u8u8f32f32" -@main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } }, section "var-main_instance:r1r6i16i16u8u8f32f32" +@__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$__FB__init:r6i16i16u8u8f32f32" +@main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } }, section "var-$RUSTY$main_instance:r1r6i16i16u8u8f32f32" -define void @FB(%FB* %0) section "fn-FB:v" { +define void @FB(%FB* %0) section "fn-$RUSTY$FB:v" { entry: %x = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 %xx = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 @@ -22,7 +22,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void 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 5af9b87696..321b004892 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,9 +7,9 @@ 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 }, section "var-Main_instance:r6i16i16u8u8f32f32" +@Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$Main_instance:r6i16i16u8u8f32f32" -define void @Main(%Main* %0) section "fn-Main:v" { +define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %xx = getelementptr inbounds %Main, %Main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap index ef4b85fed7..3e0e2de57e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap @@ -7,7 +7,7 @@ source_filename = "main" @__func.arr_var__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] -define i16 @func() section "fn-func:i16" { +define i16 @func() section "fn-$RUSTY$func:i16" { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 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 517184cfc8..86a8ac7660 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,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-__arr__init:ai32" +@__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-$RUSTY$__arr__init:ai32" -define i16 @func() section "fn-func:i16" { +define i16 @func() section "fn-$RUSTY$func:i16" { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 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 0f683507e0..8580832c54 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,9 +7,9 @@ source_filename = "main" %__func_a = type { i16 } -@____func_a__init = unnamed_addr constant %__func_a zeroinitializer, section "var-____func_a__init:r1i16" +@____func_a__init = unnamed_addr constant %__func_a zeroinitializer, section "var-$RUSTY$____func_a__init:r1i16" -define i16 @func() section "fn-func:i16" { +define i16 @func() section "fn-$RUSTY$func:i16" { entry: %func = alloca i16, align 2 %a = alloca %__func_a, align 8 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 87e15105e6..56554b9271 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,10 +8,10 @@ source_filename = "main" %prog = type { %__prog_a } %__prog_a = type { i16 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r1i16" -@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-____prog_a__init:r1i16" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1r1i16" +@____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-$RUSTY$____prog_a__init:r1i16" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %a = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 142a358164..0b39ed7cff 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,12 +5,12 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@__foo_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" -@__bar_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" -@__foo_position.y = unnamed_addr constant i32 2, section "var-y:e2i32" -@__bar_position.y = unnamed_addr constant i32 4, section "var-y:e2i32" +@__foo_position.x = unnamed_addr constant i32 1, section "var-$RUSTY$x:e2i32" +@__bar_position.x = unnamed_addr constant i32 3, section "var-$RUSTY$x:e2i32" +@__foo_position.y = unnamed_addr constant i32 2, section "var-$RUSTY$y:e2i32" +@__bar_position.y = unnamed_addr constant i32 4, section "var-$RUSTY$y:e2i32" -define i32 @foo() section "fn-foo:i32" { +define i32 @foo() section "fn-$RUSTY$foo:i32" { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %foo_ret } -define i32 @bar() section "fn-bar:i32" { +define i32 @bar() section "fn-$RUSTY$bar:i32" { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 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 78b4f0ca58..909a6194e5 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,16 +5,16 @@ expression: function ; ModuleID = 'main' source_filename = "main" -@__a_position.x = unnamed_addr constant i32 1, section "var-x:e2i32" -@__aa_position.x = unnamed_addr constant i32 2, section "var-x:e2i32" -@__bb_position.x = unnamed_addr constant i32 3, section "var-x:e2i32" -@__b_position.x = unnamed_addr constant i32 4, section "var-x:e2i32" -@__a_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" -@__aa_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" -@__bb_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" -@__b_position.y = unnamed_addr constant i32 5, section "var-y:e2i32" +@__a_position.x = unnamed_addr constant i32 1, section "var-$RUSTY$x:e2i32" +@__aa_position.x = unnamed_addr constant i32 2, section "var-$RUSTY$x:e2i32" +@__bb_position.x = unnamed_addr constant i32 3, section "var-$RUSTY$x:e2i32" +@__b_position.x = unnamed_addr constant i32 4, section "var-$RUSTY$x:e2i32" +@__a_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" +@__aa_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" +@__bb_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" +@__b_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" -define i32 @a() section "fn-a:i32" { +define i32 @a() section "fn-$RUSTY$a:i32" { entry: %a = alloca i32, align 4 %position = alloca i32, align 4 @@ -24,7 +24,7 @@ entry: ret i32 %a_ret } -define i32 @aa() section "fn-aa:i32" { +define i32 @aa() section "fn-$RUSTY$aa:i32" { entry: %aa = alloca i32, align 4 %position = alloca i32, align 4 @@ -34,7 +34,7 @@ entry: ret i32 %aa_ret } -define i32 @bb() section "fn-bb:i32" { +define i32 @bb() section "fn-$RUSTY$bb:i32" { entry: %bb = alloca i32, align 4 %position = alloca i32, align 4 @@ -44,7 +44,7 @@ entry: ret i32 %bb_ret } -define i32 @b() section "fn-b:i32" { +define i32 @b() section "fn-$RUSTY$b:i32" { entry: %b = alloca i32, align 4 %position = alloca i32, align 4 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 1a701ba06a..fc6e1924b4 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 @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@x0 = global i32 1, section "var-$RUSTY$x0:i32" +@x1 = global i32 1, section "var-$RUSTY$x1:i32" +@x2 = global i32 2, section "var-$RUSTY$x2:i32" +@x3 = global i32 3, section "var-$RUSTY$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 1e9766978f..bcdff271ea 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,15 +8,15 @@ 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] }, section "var-str:r3i32i32ai32" -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r3i32i32ai32" -@alias_str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-alias_str:r3i32i32ai32" -@global_arr = unnamed_addr constant [2 x i32] [i32 30, i32 40], section "var-global_arr:ai32" -@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:r2ar3i32i32ai32ar3i32i32ai32" +@str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-$RUSTY$str:r3i32i32ai32" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r3i32i32ai32" +@alias_str = unnamed_addr constant %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }, section "var-$RUSTY$alias_str:r3i32i32ai32" +@global_arr = unnamed_addr constant [2 x i32] [i32 30, i32 40], section "var-$RUSTY$global_arr:ai32" +@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-$RUSTY$main_instance:r2ar3i32i32ai32ar3i32i32ai32" @__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] }] -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %alias_arr = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 1f85dca6fc..c2a03ab1ec 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,6 +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 }, section "var-a:r3r2i32i32ai16i32" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r3r2i32i32ai16i32" -@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:r2i32i32" +@a = global %MyStruct { %MyPoint { i32 1, i32 2 }, [4 x i16] [i16 0, i16 1, i16 2, i16 3], i32 7 }, section "var-$RUSTY$a:r3r2i32i32ai16i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r3r2i32i32ai16i32" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-$RUSTY$__MyPoint__init:r2i32i32" 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 1dc7d9700a..ae268a9d1b 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,23 +5,23 @@ expression: res ; ModuleID = 'main' source_filename = "main" -@x = global i32 2, section "var-x:e3i32" -@__main_var1.x1 = unnamed_addr constant i32 1, section "var-x1:e3i32" -@__main_var2.x7 = unnamed_addr constant i32 2, section "var-x7:e3i32" -@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" -@__main_y.redy = unnamed_addr constant i32 1, section "var-redy:e3i32" -@__main_y.yellowy = unnamed_addr constant i32 2, section "var-yellowy:e3i32" -@__main_y.greeny = unnamed_addr constant i32 3, section "var-greeny:e3i32" -@__main_var1.x2 = unnamed_addr constant i32 2, section "var-x2:e3i32" -@__main_var1.x3 = unnamed_addr constant i32 3, section "var-x3:e3i32" -@__main_var2.x5 = unnamed_addr constant i32 0, section "var-x5:e3i32" -@__main_var2.x6 = unnamed_addr constant i32 1, section "var-x6:e3i32" -@__main_var3.x8 = unnamed_addr constant i32 0, section "var-x8:e2i32" -@__main_var3.x9 = unnamed_addr constant i32 1, section "var-x9:e2i32" -@__global_x.red = unnamed_addr constant i32 0, section "var-red:e3i32" -@__global_x.green = unnamed_addr constant i32 2, section "var-green:e3i32" +@x = global i32 2, section "var-$RUSTY$x:e3i32" +@__main_var1.x1 = unnamed_addr constant i32 1, section "var-$RUSTY$x1:e3i32" +@__main_var2.x7 = unnamed_addr constant i32 2, section "var-$RUSTY$x7:e3i32" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" +@__main_y.redy = unnamed_addr constant i32 1, section "var-$RUSTY$redy:e3i32" +@__main_y.yellowy = unnamed_addr constant i32 2, section "var-$RUSTY$yellowy:e3i32" +@__main_y.greeny = unnamed_addr constant i32 3, section "var-$RUSTY$greeny:e3i32" +@__main_var1.x2 = unnamed_addr constant i32 2, section "var-$RUSTY$x2:e3i32" +@__main_var1.x3 = unnamed_addr constant i32 3, section "var-$RUSTY$x3:e3i32" +@__main_var2.x5 = unnamed_addr constant i32 0, section "var-$RUSTY$x5:e3i32" +@__main_var2.x6 = unnamed_addr constant i32 1, section "var-$RUSTY$x6:e3i32" +@__main_var3.x8 = unnamed_addr constant i32 0, section "var-$RUSTY$x8:e2i32" +@__main_var3.x9 = unnamed_addr constant i32 1, section "var-$RUSTY$x9:e2i32" +@__global_x.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" +@__global_x.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %y = alloca i32, align 4 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 c7d6f828a2..824ad9c5e1 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 @@ -5,6 +5,6 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [5 x i16] [i16 1, i16 2, i16 3, i16 0, i16 0], section "var-arr:ai16" -@b_exp = global [6 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0, i32 0], section "var-b_exp:ai32" -@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:as8u81" +@arr = global [5 x i16] [i16 1, i16 2, i16 3, i16 0, i16 0], section "var-$RUSTY$arr:ai16" +@b_exp = global [6 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0, i32 0], section "var-$RUSTY$b_exp:ai32" +@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-$RUSTY$str:as8u81" 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 7532c3e952..021515d7fd 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0], section "var-arr:ai16" +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 0, i16 0, i16 0], section "var-$RUSTY$arr:ai16" 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 dec5bf5907..a6cbce9a07 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7], section "var-arr:ai16" +@arr = global [6 x i16] [i16 0, i16 1, i16 2, i16 7, i16 7, i16 7], section "var-$RUSTY$arr:ai16" 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 a100b26cbb..aac646fb3f 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,7 +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 } }, section "var-a:r2r2i32i32r2i32i32" -@__MyStruct2__init = unnamed_addr constant %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 0, i32 7 } }, section "var-__MyStruct2__init:r2r2i32i32r2i32i32" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" -@b = global %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 9, i32 0 } }, section "var-b:r2r2i32i32r2i32i32" +@a = global %MyStruct2 { %MyStruct { i32 5, i32 7 }, %MyStruct { i32 3, i32 2 } }, section "var-$RUSTY$a:r2r2i32i32r2i32i32" +@__MyStruct2__init = unnamed_addr constant %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 0, i32 7 } }, section "var-$RUSTY$__MyStruct2__init:r2r2i32i32r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i32" +@b = global %MyStruct2 { %MyStruct { i32 5, i32 3 }, %MyStruct { i32 9, i32 0 } }, section "var-$RUSTY$b:r2r2i32i32r2i32i32" 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 8f74c62cbd..86bc9db0b6 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 @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [4 x i8] c"\07\07\07\07", section "var-a:au8" -@b = global [4 x i8] c"\02\07\07\03", section "var-b:au8" -@c = global [10 x i8] c"\00\01\00\01\00\01\00\01\00\01", section "var-c:au8" -@d = global [10 x i8] c"\00\00\01\01\02\00\00\01\01\02", section "var-d:au8" +@a = global [4 x i8] c"\07\07\07\07", section "var-$RUSTY$a:au8" +@b = global [4 x i8] c"\02\07\07\03", section "var-$RUSTY$b:au8" +@c = global [10 x i8] c"\00\01\00\01\00\01\00\01\00\01", section "var-$RUSTY$c:au8" +@d = global [10 x i8] c"\00\00\01\01\02\00\00\01\01\02", section "var-$RUSTY$d:au8" 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 80d5415d71..7765eaf209 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,19 +8,19 @@ source_filename = "main" %TON = type { i16, i16 } %main = type { i16, %TON, %TON } -@__TON__init = unnamed_addr constant %TON zeroinitializer, section "var-__TON__init:r2i16i16" -@main_instance = global %main { i16 10, %TON { i16 10, i16 17 }, %TON { i16 17, i16 10 } }, section "var-main_instance:r3i16r2i16i16r2i16i16" +@__TON__init = unnamed_addr constant %TON zeroinitializer, section "var-$RUSTY$__TON__init:r2i16i16" +@main_instance = global %main { i16 10, %TON { i16 10, i16 17 }, %TON { i16 17, i16 10 } }, section "var-$RUSTY$main_instance:r3i16r2i16i16r2i16i16" @__main.struct1__init = unnamed_addr constant %TON { i16 10, i16 17 } @__main.struct2__init = unnamed_addr constant %TON { i16 17, i16 10 } -define void @TON(%TON* %0) section "fn-TON:v[i16][i16]" { +define void @TON(%TON* %0) section "fn-$RUSTY$TON:v[i16][i16]" { entry: %a = getelementptr inbounds %TON, %TON* %0, i32 0, i32 0 %b = getelementptr inbounds %TON, %TON* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %TEN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %struct1 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6bc86ef519..af8103d09f 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [4 x i8] c"\01\02\03\04", section "var-a:au8" +@a = global [4 x i8] c"\01\02\03\04", section "var-$RUSTY$a:au8" 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 9e2736b9c0..315a178dbb 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,5 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global [3 x i16] [i16 1, i16 2, i16 3], section "var-x:ai16" -@__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3], section "var-__MyArray__init:ai16" +@x = global [3 x i16] [i16 1, i16 2, i16 3], section "var-$RUSTY$x:ai16" +@__MyArray__init = unnamed_addr constant [3 x i16] [i16 1, i16 2, i16 3], section "var-$RUSTY$__MyArray__init:ai16" 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 3d3e438447..11a1256f4e 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 @@ -5,11 +5,11 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@a = global [3 x i8] c"\01\02\03", section "var-a:ai8" -@b = global [3 x i16] [i16 1, i16 2, i16 3], section "var-b:ai16" -@c = global [3 x i32] [i32 1, i32 2, i32 3], section "var-c:ai32" -@d = global [3 x i64] [i64 1, i64 2, i64 3], section "var-d:ai64" -@e = global [3 x i8] c"\01\02\03", section "var-e:au8" -@f = global [3 x i16] [i16 1, i16 2, i16 3], section "var-f:au16" -@g = global [3 x i64] [i64 1, i64 2, i64 3], section "var-g:au64" -@h = global [3 x i8] [i8 true, i8 false, i8 true], section "var-h:au8" +@a = global [3 x i8] c"\01\02\03", section "var-$RUSTY$a:ai8" +@b = global [3 x i16] [i16 1, i16 2, i16 3], section "var-$RUSTY$b:ai16" +@c = global [3 x i32] [i32 1, i32 2, i32 3], section "var-$RUSTY$c:ai32" +@d = global [3 x i64] [i64 1, i64 2, i64 3], section "var-$RUSTY$d:ai64" +@e = global [3 x i8] c"\01\02\03", section "var-$RUSTY$e:au8" +@f = global [3 x i16] [i16 1, i16 2, i16 3], section "var-$RUSTY$f:au16" +@g = global [3 x i64] [i64 1, i64 2, i64 3], section "var-$RUSTY$g:au64" +@h = global [3 x i8] [i8 true, i8 false, i8 true], section "var-$RUSTY$h:au8" 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 d05e4262a6..08cd394f44 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,5 +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 }, section "var-x:r6i16i16u8u8f32f32" -@__MyStruct__init = unnamed_addr constant %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-__MyStruct__init:r6i16i16u8u8f32f32" +@x = global %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$x:r6i16i16u8u8f32f32" +@__MyStruct__init = unnamed_addr constant %MyStruct { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$__MyStruct__init:r6i16i16u8u8f32f32" 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 76bf94ca96..81b708c0b7 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,6 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32 } -@a = global %MyStruct { i32 3, i32 5 }, section "var-a:r2i32i32" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" -@b = global %MyStruct { i32 5, i32 3 }, section "var-b:r2i32i32" +@a = global %MyStruct { i32 3, i32 5 }, section "var-$RUSTY$a:r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i32" +@b = global %MyStruct { i32 5, i32 3 }, section "var-$RUSTY$b:r2i32i32" 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 1a511ec3ea..1af6b57f9a 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,6 +7,6 @@ source_filename = "main" %MyStruct = type { i32, i32, i32 } -@a = global %MyStruct { i32 5, i32 0, i32 10 }, section "var-a:r3i32i32i32" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r3i32i32i32" -@b = global %MyStruct { i32 0, i32 3, i32 10 }, section "var-b:r3i32i32i32" +@a = global %MyStruct { i32 5, i32 0, i32 10 }, section "var-$RUSTY$a:r3i32i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r3i32i32i32" +@b = global %MyStruct { i32 0, i32 3, i32 10 }, section "var-$RUSTY$b:r3i32i32i32" 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 8bb5bfa260..19e4368276 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i16 7, section "var-x:i16" +@x = global i16 7, section "var-$RUSTY$x:i16" 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 8bb5bfa260..19e4368276 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 @@ -5,4 +5,4 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global i16 7, section "var-x:i16" +@x = global i16 7, section "var-$RUSTY$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 f99f254ef8..7f537a5961 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,6 +7,6 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = unnamed_addr constant %Point { i32 1, i32 2, i32 3 }, section "var-x:r3i32i32i32" -@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:r3i32i32i32" -@empty = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-empty:r3i32i32i32" +@x = unnamed_addr constant %Point { i32 1, i32 2, i32 3 }, section "var-$RUSTY$x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-$RUSTY$__Point__init:r3i32i32i32" +@empty = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-$RUSTY$empty:r3i32i32i32" 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 a65386d8f9..46b624c2e8 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,12 +9,12 @@ 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 }] }] }, section "var-main_instance:r1ar2i32ar2i32i32" -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i32ar2i32i32" -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2i32i32" +@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-$RUSTY$main_instance:r1ar2i32ar2i32i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-$RUSTY$__STRUCT1__init:r2i32ar2i32i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2i32i32" @__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" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var_init1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void 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 b7cab869e9..ef300e2606 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,5 +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 }, section "var-x:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" -@__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:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" +@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-$RUSTY$x:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" +@__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-$RUSTY$__MyStruct__init:r14u8i8u8u16i16u16u32i32u32u64i64u64f32f64" 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 caa93e5bae..7be6b8fac0 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,5 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = global %Point { i32 1, i32 2, i32 7 }, section "var-x:r3i32i32i32" -@__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 }, section "var-__Point__init:r3i32i32i32" +@x = global %Point { i32 1, i32 2, i32 7 }, section "var-$RUSTY$x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 0, i32 7 }, section "var-$RUSTY$__Point__init:r3i32i32i32" 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 be0a36782f..91134e83f0 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,5 +7,5 @@ source_filename = "main" %Point = type { i32, i32, i32 } -@x = global %Point { i32 1, i32 2, i32 3 }, section "var-x:r3i32i32i32" -@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-__Point__init:r3i32i32i32" +@x = global %Point { i32 1, i32 2, i32 3 }, section "var-$RUSTY$x:r3i32i32i32" +@__Point__init = unnamed_addr constant %Point { i32 0, i32 2, i32 3 }, section "var-$RUSTY$__Point__init:r3i32i32i32" 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 e1d91826ca..89fb1065d4 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,5 +7,5 @@ source_filename = "main" %MyPoint = type { i32 } -@a = global %MyPoint { i32 7 }, section "var-a:r1i32" -@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-__MyPoint__init:r1i32" +@a = global %MyPoint { i32 7 }, section "var-$RUSTY$a:r1i32" +@__MyPoint__init = unnamed_addr constant %MyPoint zeroinitializer, section "var-$RUSTY$__MyPoint__init:r1i32" 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 bbde239af2..70a71050f9 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,7 +5,7 @@ expression: result.unwrap() ; ModuleID = 'main' source_filename = "main" -@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" +@a = unnamed_addr constant i16 7, section "var-$RUSTY$a:i16" +@b = unnamed_addr constant i16 21, section "var-$RUSTY$b:i16" +@c = unnamed_addr constant i32 2, section "var-$RUSTY$c:i32" +@d = unnamed_addr constant i32 30, section "var-$RUSTY$d:i32" diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index 5d9b2f03e0..f13d221a36 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -711,7 +711,7 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %str = alloca [81 x i8], align 1 @@ -724,7 +724,7 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i8* %0) section "fn-foo:i32[s8u81]" { + define i32 @foo(i8* %0) section "fn-$RUSTY$foo:i32[s8u81]" { entry: %foo = alloca i32, align 4 %val = alloca [81 x i8], align 1 @@ -770,7 +770,7 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %str = alloca [65537 x i8], align 1 @@ -783,7 +783,7 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i8* %0) section "fn-foo:i32[s8u65537]" { + define i32 @foo(i8* %0) section "fn-$RUSTY$foo:i32[s8u65537]" { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i8], align 1 @@ -829,7 +829,7 @@ fn by_value_function_arg_arrays_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %arr = alloca [65537 x i32], align 4 @@ -842,7 +842,7 @@ fn by_value_function_arg_arrays_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i32* %0) section "fn-foo:i32[ai32]" { + define i32 @foo(i32* %0) section "fn-$RUSTY$foo:i32[ai32]" { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i32], align 4 @@ -897,9 +897,9 @@ fn by_value_function_arg_structs_are_memcopied() { %S_TY = type { i8, i8 } - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:r2u8u8" + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-$RUSTY$__S_TY__init:r2u8u8" - define i32 @foo(%S_TY* %0) section "fn-foo:i32[r2u8u8]" { + define i32 @foo(%S_TY* %0) section "fn-$RUSTY$foo:i32[r2u8u8]" { entry: %foo = alloca i32, align 4 %val = alloca %S_TY, align 8 @@ -911,7 +911,7 @@ fn by_value_function_arg_structs_are_memcopied() { ret i32 %foo_ret } - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %s = alloca %S_TY, align 8 @@ -969,10 +969,10 @@ 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, section "var-__AGGREGATE_COLLECTOR_TY__init:r3ai32s8u65537r2u8u8" - @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-__S_TY__init:r2u8u8" + @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer, section "var-$RUSTY$__AGGREGATE_COLLECTOR_TY__init:r3ai32s8u65537r2u8u8" + @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-$RUSTY$__S_TY__init:r2u8u8" - define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-foo:i32[r3ai32s8u65537r2u8u8]" { + define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-$RUSTY$foo:i32[r3ai32s8u65537r2u8u8]" { entry: %foo = alloca i32, align 4 %val = alloca %AGGREGATE_COLLECTOR_TY, align 8 @@ -984,7 +984,7 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { ret i32 %foo_ret } - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %s = alloca %AGGREGATE_COLLECTOR_TY, align 8 @@ -1031,9 +1031,9 @@ fn by_value_fb_arg_aggregates_are_memcopied() { %FOO = type { [65537 x i8], [1024 x i32] } - @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-__FOO__init:r2s8u65537ai32" + @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-$RUSTY$__FOO__init:r2s8u65537ai32" - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %str = alloca [65537 x i8], align 1 @@ -1059,7 +1059,7 @@ fn by_value_fb_arg_aggregates_are_memcopied() { ret i32 %main_ret } - define void @FOO(%FOO* %0) section "fn-FOO:v[s8u65537][ai32]" { + define void @FOO(%FOO* %0) section "fn-$RUSTY$FOO:v[s8u65537][ai32]" { entry: %val = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 %field = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 @@ -1121,11 +1121,11 @@ 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, section "var-__FB__init:r5r1u8ai32ar1u8s8u81s16u81" - @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer, section "var-__OUT_TYPE__init:r1u8" - @PRG_instance = global %PRG zeroinitializer, section "var-PRG_instance:r6r1u8ai32ar1u8s8u81s16u81r5r1u8ai32ar1u8s8u81s16u81" + @__FB__init = unnamed_addr constant %FB zeroinitializer, section "var-$RUSTY$__FB__init:r5r1u8ai32ar1u8s8u81s16u81" + @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer, section "var-$RUSTY$__OUT_TYPE__init:r1u8" + @PRG_instance = global %PRG zeroinitializer, section "var-$RUSTY$PRG_instance:r6r1u8ai32ar1u8s8u81s16u81r5r1u8ai32ar1u8s8u81s16u81" - define void @FB(%FB* %0) section "fn-FB:v[r1u8][ai32][ar1u8][s8u81][s16u81]" { + define void @FB(%FB* %0) section "fn-$RUSTY$FB:v[r1u8][ai32][ar1u8][s8u81][s16u81]" { entry: %output = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 %output2 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 @@ -1135,7 +1135,7 @@ fn var_output_aggregate_types_are_memcopied() { ret void } - define void @PRG(%PRG* %0) section "fn-PRG:v" { + define void @PRG(%PRG* %0) section "fn-$RUSTY$PRG:v" { entry: %out = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 0 %out2 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 1 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 ff73aeec02..7634d39be5 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,11 +7,11 @@ source_filename = "main" %main = type {} -@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:r0" +@gX = global i16 0, section "var-$RUSTY$gX:i16" +@gY = global i8 0, section "var-$RUSTY$gY:u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: ret void } 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 cc6ccd7ed7..cb25e9ba1a 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,10 +8,10 @@ source_filename = "main" %Main = type { %MyStruct } %MyStruct = type { [5 x i16] } -@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1r1ai16" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r1ai16" +@Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1r1ai16" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r1ai16" -define void @Main(%Main* %0) section "fn-Main:v" { +define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { entry: %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %field1 = getelementptr inbounds %MyStruct, %MyStruct* %m, i32 0, i32 0 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 1127cd9463..304525bce4 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,11 +9,11 @@ source_filename = "main" %OuterStruct = type { %InnerStruct, %InnerStruct } %InnerStruct = type { i16, i16 } -@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1r2r2i16i16r2i16i16" -@__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer, section "var-__OuterStruct__init:r2r2i16i16r2i16i16" -@__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer, section "var-__InnerStruct__init:r2i16i16" +@Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1r2r2i16i16r2i16i16" +@__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer, section "var-$RUSTY$__OuterStruct__init:r2r2i16i16r2i16i16" +@__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer, section "var-$RUSTY$__InnerStruct__init:r2i16i16" -define void @Main(%Main* %0) section "fn-Main:v" { +define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { entry: %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %out1 = getelementptr inbounds %OuterStruct, %OuterStruct* %m, i32 0, i32 0 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 2495ecde32..ae2766bb08 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,16 +7,16 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @prg.foo(%prg* %0) ret void } -define void @prg.foo(%prg* %0) section "fn-prg.foo:v" { +define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 d4b44a28d2..e2aa3a0c5e 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,9 +7,9 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 5b8a4f66db..c8c90ea637 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,9 +7,9 @@ source_filename = "main" %prg = type { [31 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 d4b44a28d2..e2aa3a0c5e 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,9 +7,9 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 d4b44a28d2..e2aa3a0c5e 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,9 +7,9 @@ source_filename = "main" %prg = type { [11 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 5499eda1fc..82c76115c3 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,9 +7,9 @@ source_filename = "main" %prg = type { [4 x i32] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 1 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 1603bf5598..0a2219c729 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,9 +7,9 @@ source_filename = "main" %prg = type { [6 x i32] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [6 x i32], [6 x i32]* %x, i32 0, i32 1 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 f520cd93c1..de08512f59 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,9 +7,9 @@ source_filename = "main" %prg = type { [3 x i32] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [3 x i32], [3 x i32]* %x, i32 0, i32 0 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 f05606b0cf..ab227e820f 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,12 +9,12 @@ 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] }, section "var-mainProg_instance:r1ar2i16ar2u8i32" -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i16ar2u8i32" -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2u8i32" +@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-$RUSTY$mainProg_instance:r1ar2i16ar2u8i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-$RUSTY$__STRUCT1__init:r2i16ar2u8i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2u8i32" @__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" { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { entry: %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 ret void 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 9bc2dfa990..d26b1b97d4 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,12 +9,12 @@ 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] } }, section "var-mainProg_instance:r1r2i16ar2u8i32" -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r2i16ar2u8i32" -@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-__STRUCT2__init:r2u8i32" +@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-$RUSTY$mainProg_instance:r1r2i16ar2u8i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-$RUSTY$__STRUCT1__init:r2i16ar2u8i32" +@__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2u8i32" @__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" { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { entry: %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 ret void 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 ce4feac296..6c6d0bea95 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 @@ -5,5 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@x = global [10 x i16] zeroinitializer, section "var-x:ai16" -@y = global [6 x float] zeroinitializer, section "var-y:af32" +@x = global [10 x i16] zeroinitializer, section "var-$RUSTY$x:ai16" +@y = global [6 x float] zeroinitializer, section "var-$RUSTY$y:af32" 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 73318da96d..dd64c485d5 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 @@ -5,11 +5,11 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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:ai16" -@y = global [11 x i32] zeroinitializer, section "var-y:ai32" -@z = global [19 x i8] zeroinitializer, section "var-z:au8" -@zz = global [100 x i8] zeroinitializer, section "var-zz:au8" -@zzz = global [10 x [8 x i8]] zeroinitializer, section "var-zzz:aau8" +@THREE = unnamed_addr constant i16 3, section "var-$RUSTY$THREE:i16" +@ZERO = unnamed_addr constant i16 0, section "var-$RUSTY$ZERO:i16" +@LEN = unnamed_addr constant i16 9, section "var-$RUSTY$LEN:i16" +@x = global [10 x i16] zeroinitializer, section "var-$RUSTY$x:ai16" +@y = global [11 x i32] zeroinitializer, section "var-$RUSTY$y:ai32" +@z = global [19 x i8] zeroinitializer, section "var-$RUSTY$z:au8" +@zz = global [100 x i8] zeroinitializer, section "var-$RUSTY$zz:au8" +@zzz = global [10 x [8 x i8]] zeroinitializer, section "var-$RUSTY$zzz:aau8" 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 904d0d6ffe..5936e502fd 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 @@ -5,16 +5,16 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@bool_1 = global i8 0, section "var-$RUSTY$bool_1:u8" +@byte_2 = global i8 0, section "var-$RUSTY$byte_2:u8" +@sint_3 = global i8 0, section "var-$RUSTY$sint_3:i8" +@usint_4 = global i8 0, section "var-$RUSTY$usint_4:u8" +@word_5 = global i16 0, section "var-$RUSTY$word_5:u16" +@int_6 = global i16 0, section "var-$RUSTY$int_6:i16" +@uint_7 = global i16 0, section "var-$RUSTY$uint_7:u16" +@dword_8 = global i32 0, section "var-$RUSTY$dword_8:u32" +@dint_9 = global i32 0, section "var-$RUSTY$dint_9:i32" +@udint_10 = global i32 0, section "var-$RUSTY$udint_10:u32" +@lword_11 = global i64 0, section "var-$RUSTY$lword_11:u64" +@lint_12 = global i64 0, section "var-$RUSTY$lint_12:i64" +@ulint_13 = global i64 0, section "var-$RUSTY$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 224773eb70..52ff058371 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,11 +5,11 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@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" +@FORWARD = unnamed_addr constant i32 7, section "var-$RUSTY$FORWARD:i32" +@UP = unnamed_addr constant i32 8, section "var-$RUSTY$UP:i32" +@DOWN = unnamed_addr constant i32 15, section "var-$RUSTY$DOWN:i32" -define i32 @drive() section "fn-drive:i32" { +define i32 @drive() section "fn-$RUSTY$drive:i32" { entry: %drive = alloca i32, align 4 %input = alloca i32, align 4 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 32d74942ba..c92e8dcee5 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,12 +5,12 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@BASE = unnamed_addr constant i32 7, section "var-BASE:i32" -@Direction.FORWARD = unnamed_addr constant i32 7, section "var-FORWARD:e3i32" -@Direction.UP = unnamed_addr constant i32 8, section "var-UP:e3i32" -@Direction.DOWN = unnamed_addr constant i32 28, section "var-DOWN:e3i32" +@BASE = unnamed_addr constant i32 7, section "var-$RUSTY$BASE:i32" +@Direction.FORWARD = unnamed_addr constant i32 7, section "var-$RUSTY$FORWARD:e3i32" +@Direction.UP = unnamed_addr constant i32 8, section "var-$RUSTY$UP:e3i32" +@Direction.DOWN = unnamed_addr constant i32 28, section "var-$RUSTY$DOWN:e3i32" -define i32 @drive() section "fn-drive:i32" { +define i32 @drive() section "fn-$RUSTY$drive:i32" { entry: %drive = alloca i32, align 4 %input = alloca i32, align 4 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 88bdd2eaf4..55a652984b 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 2f76e8001c..3d517cb7c7 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 592c32891f..225e7ac1cc 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 1, i8* %z, align 1 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 c039599ac5..8e7ce4e7ef 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b48928f56d..58b69425f3 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 123246918a..0d6aa79303 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 -1, i32* %x, align 4 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 3e1b446471..3c7fb32230 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,9 +7,9 @@ source_filename = "main" %prg = type { float, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 79d67cef2c..0da2859836 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 1e2f09db58..013bcce359 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,16 +8,16 @@ source_filename = "main" %MyClass = type { i16, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" -define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { +define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 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 b168c9e853..b6d4db0881 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,17 +9,17 @@ source_filename = "main" %prg = type { %MyClass, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16i16" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16i16" -define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { +define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 @@ -38,7 +38,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 fba893df45..0d9e542906 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, [10 x i16], [10 x i16*], [10 x i16]* } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i16ai16api16pai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i16ai16api16pai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %arrX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 8d59fac302..6cd81f4e4b 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,9 +7,9 @@ source_filename = "main" %fbWithConstant = type { i16, i16 } -@__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 }, section "var-__fbWithConstant__init:r2i16i16" +@__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 }, section "var-$RUSTY$__fbWithConstant__init:r2i16i16" -define void @fbWithConstant(%fbWithConstant* %0) section "fn-fbWithConstant:v" { +define void @fbWithConstant(%fbWithConstant* %0) section "fn-$RUSTY$fbWithConstant:v" { entry: %x = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 0 %const = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 1 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 6e86311ca0..f1184db8de 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,10 +7,10 @@ source_filename = "main" %prg = type { i16 } -@MIN = unnamed_addr constant i16 7, section "var-MIN:i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" +@MIN = unnamed_addr constant i16 7, section "var-$RUSTY$MIN:i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -26,7 +26,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 5, i16 0, i16 8) 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 1bc1235805..2bed0e81ab 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,10 +7,10 @@ source_filename = "main" %STRUCT1 = type { i32 } -@MyStruct = unnamed_addr constant %STRUCT1 { i32 99 }, section "var-MyStruct:r1i32" -@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-__STRUCT1__init:r1i32" +@MyStruct = unnamed_addr constant %STRUCT1 { i32 99 }, section "var-$RUSTY$MyStruct:r1i32" +@__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-$RUSTY$__STRUCT1__init:r1i32" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %local_value = alloca i32, align 4 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 fc6023595a..41d5a82ad4 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32 } -@main_instance = global %main { i32 0, i32 60 }, section "var-main_instance:r2i32i32" +@main_instance = global %main { i32 0, i32 60 }, section "var-$RUSTY$main_instance:r2i32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %DAYS_IN_MONTH = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %SIXTY = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap index 44f3117f1b..3b0fa08f84 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @func(i64* %0, i64* %1) section "fn-func:i32[pi64][pi64]" { +define i32 @func(i64* %0, i64* %1) section "fn-$RUSTY$func:i32[pi64][pi64]" { entry: %func = alloca i32, align 4 %d_and_t = alloca i64*, align 8 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 20428eede9..55a96725a2 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,25 +7,25 @@ source_filename = "main" %main = type {} -@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:r16i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64" +@cT = unnamed_addr constant i64 1000000000, section "var-$RUSTY$cT:i64" +@cT_SHORT = unnamed_addr constant i64 1000000000, section "var-$RUSTY$cT_SHORT:i64" +@cLT = unnamed_addr constant i64 1000000000000, section "var-$RUSTY$cLT:i64" +@cLT_SHORT = unnamed_addr constant i64 1000000000000, section "var-$RUSTY$cLT_SHORT:i64" +@cD = unnamed_addr constant i64 0, section "var-$RUSTY$cD:i64" +@cD_SHORT = unnamed_addr constant i64 161308800000000000, section "var-$RUSTY$cD_SHORT:i64" +@cLD = unnamed_addr constant i64 161308800000000000, section "var-$RUSTY$cLD:i64" +@cLD_SHORT = unnamed_addr constant i64 161308800000000000, section "var-$RUSTY$cLD_SHORT:i64" +@cTOD = unnamed_addr constant i64 0, section "var-$RUSTY$cTOD:i64" +@cTOD_SHORT = unnamed_addr constant i64 0, section "var-$RUSTY$cTOD_SHORT:i64" +@cLTOD = unnamed_addr constant i64 86399999999999, section "var-$RUSTY$cLTOD:i64" +@cLTOD_SHORT = unnamed_addr constant i64 86399999999999, section "var-$RUSTY$cLTOD_SHORT:i64" +@cDT = unnamed_addr constant i64 172799000000000, section "var-$RUSTY$cDT:i64" +@cDT_SHORT = unnamed_addr constant i64 172799000000000, section "var-$RUSTY$cDT_SHORT:i64" +@cLDT = unnamed_addr constant i64 172799123000000, section "var-$RUSTY$cLDT:i64" +@cLDT_SHORT = unnamed_addr constant i64 172799123000000, section "var-$RUSTY$cLDT_SHORT:i64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r16i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %t1 = alloca i64, align 8 %t2 = alloca i64, align 8 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 10622eafa2..b01ef6be32 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,9 +7,9 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap index 8adc6947ef..6accb260f6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @func() section "fn-func:i16" { +define i16 @func() section "fn-$RUSTY$func:i16" { entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 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 9c9143edae..55c7afa92f 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16, i32 } -@prg_instance = global %prg { i16 0, i16 1, i32 2 }, section "var-prg_instance:r3i16i16i32" +@prg_instance = global %prg { i16 0, i16 1, i32 2 }, section "var-$RUSTY$prg_instance:r3i16i16i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap index 644374ab5a..1d50aaf709 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @foo() section "fn-foo:i16" { +define i16 @foo() section "fn-$RUSTY$foo:i16" { entry: %foo = alloca i16, align 2 store i16 0, i16* %foo, align 2 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 74963d49f4..58ead4ad4c 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: ret void } 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 7e3d63f4c4..cc9d1a042b 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,9 +7,9 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: ret void } 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 b7df37b6ec..45c105a08d 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e5102d71ac..ef1c55f2b2 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,12 +7,12 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1e3i32" -@MyEnum.red = unnamed_addr constant i32 0, section "var-red:e3i32" -@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" -@MyEnum.green = unnamed_addr constant i32 2, section "var-green:e3i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1e3i32" +@MyEnum.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" +@MyEnum.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %color = getelementptr inbounds %main, %main* %0, i32 0, i32 0 store i32 0, i32* %color, align 4 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 17b48f893e..057b3adc4d 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, section "var-x:e3i32" -@MyEnum.red = unnamed_addr constant i32 0, section "var-red:e3i32" -@MyEnum.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" -@MyEnum.green = unnamed_addr constant i32 2, section "var-green:e3i32" +@x = global i32 0, section "var-$RUSTY$x:e3i32" +@MyEnum.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" +@MyEnum.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" +@MyEnum.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" 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 0182f252f5..bd82fedca3 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,13 +7,13 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1e4i32" -@TrafficLight.White = unnamed_addr constant i32 0, section "var-White:e4i32" -@TrafficLight.Red = unnamed_addr constant i32 1, section "var-Red:e4i32" -@TrafficLight.Yellow = unnamed_addr constant i32 2, section "var-Yellow:e4i32" -@TrafficLight.Green = unnamed_addr constant i32 3, section "var-Green:e4i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1e4i32" +@TrafficLight.White = unnamed_addr constant i32 0, section "var-$RUSTY$White:e4i32" +@TrafficLight.Red = unnamed_addr constant i32 1, section "var-$RUSTY$Red:e4i32" +@TrafficLight.Yellow = unnamed_addr constant i32 2, section "var-$RUSTY$Yellow:e4i32" +@TrafficLight.Green = unnamed_addr constant i32 3, section "var-$RUSTY$Green:e4i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %tf1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void 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 4f1449bc28..dc31c6e453 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 @@ -5,6 +5,6 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@arr = global [4 x i16] [i16 1, i16 2, i16 3, i16 0], section "var-arr:ai16" -@b_exp = global [5 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0], section "var-b_exp:ai32" -@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:as8u81" +@arr = global [4 x i16] [i16 1, i16 2, i16 3, i16 0], section "var-$RUSTY$arr:ai16" +@b_exp = global [5 x i32] [i32 4, i32 6, i32 6, i32 10, i32 0], section "var-$RUSTY$b_exp:ai32" +@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-$RUSTY$str:as8u81" 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 5fa176e94f..6fc1325f79 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,11 +7,11 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -declare i32 @foo() section "fn-foo:i32" +declare i32 @foo() section "fn-$RUSTY$foo:i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %call = call i32 @foo() ret void 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 31dfda4a83..b7e06b1f73 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,11 +7,11 @@ source_filename = "main" %main = type {} -@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:r0" +@gX = external global i16, section "var-$RUSTY$gX:i16" +@gY = external global i8, section "var-$RUSTY$gY:u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: ret void } 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 5d2b8c7b5f..d9521f41de 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, section "var-prg_instance:r2i32i32" +@prg_instance = external global %prg, section "var-$RUSTY$prg_instance:r2i32i32" -declare void @prg(%prg*) section "fn-prg:v" +declare void @prg(%prg*) section "fn-$RUSTY$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 b168c9e853..b6d4db0881 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,17 +9,17 @@ source_filename = "main" %prg = type { %MyClass, i16 } %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r2i16i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16i16" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16i16" -define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { +define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 @@ -38,7 +38,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 64cc3f50ca..9f41468169 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 34d434f4f5..2dca83f31a 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,9 +7,9 @@ source_filename = "main" %prg = type { i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i16 3, i16* %x, align 2 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 35c6bd11ad..0310b77ae1 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,9 +7,9 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 3, i64* %x, align 4 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 c02a08c835..9d83bc8b7d 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 3, i8* %x, align 1 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 cc119b14f8..08569854f0 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 148ba80830..1a9a034b13 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 7f76e8b1d3..a3881483a7 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i32i32i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i32i32i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %step = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 79c35bead6..f0bb8cb4e5 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 2caf02266a..6c28295463 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 0d79872195..94777d2d7b 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,17 +8,17 @@ source_filename = "main" %foo = type { i16, i16 } %prg = type { %foo } -@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:r2i16i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1r2i16i16" +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-$RUSTY$__foo__init:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1r2i16i16" -define void @foo(%foo* %0) section "fn-foo:v[i16][i16]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i16][i16]" { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %fb_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @foo(%foo* %fb_inst) 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 e47d0b86cd..72d159848b 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,22 +9,22 @@ source_filename = "main" %bar = type {} %prg = type { %foo } -@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-__foo__init:r1r0" -@__bar__init = unnamed_addr constant %bar zeroinitializer, section "var-__bar__init:r0" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1r1r0" +@__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-$RUSTY$__foo__init:r1r0" +@__bar__init = unnamed_addr constant %bar zeroinitializer, section "var-$RUSTY$__bar__init:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1r1r0" -define void @foo(%foo* %0) section "fn-foo:v" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { entry: %bar_inst = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 ret void } -define void @bar(%bar* %0) section "fn-bar:v" { +define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %foo_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %bar_inst = getelementptr inbounds %foo, %foo* %foo_inst, i32 0, i32 0 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 4263bbdbdb..5c36e24087 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,9 +7,9 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i64 @TIME() section "fn-TIME:i64" { +define i64 @TIME() section "fn-$RUSTY$TIME:i64" { entry: %TIME = alloca i64, align 8 store i64 0, i64* %TIME, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %TIME_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %call = call i64 @TIME() ret void 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 84aae2155e..0317488398 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo() section "fn-foo:i32" { +define i32 @foo() section "fn-$RUSTY$foo:i32" { entry: %foo = alloca i32, align 4 store i32 0, i32* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo() 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 d144832670..87f13d62a3 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo() section "fn-foo:i32" { +define i32 @foo() section "fn-$RUSTY$foo:i32" { entry: %foo = alloca i32, align 4 store i32 0, i32* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %froo = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo() 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 647f17447a..e37a94c26f 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,9 +7,9 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -30,7 +30,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %call = call i32 @foo(i32 5) ret void 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 0e828faee2..0339a12c6b 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,9 +7,9 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -26,7 +26,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %call = call i32 @foo(i32 5) ret void 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 1d8e7f7822..9746527493 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo(i32 2) 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 3fde489efb..983140bb99 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo(i32 %0, i8 %1) section "fn-foo:i32[i32][u8]" { +define i32 @foo(i32 %0, i8 %1) section "fn-$RUSTY$foo:i32[i32][u8]" { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 @@ -22,7 +22,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo(i32 2, i8 1) 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 48744eb903..7ae048cffc 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,10 +7,10 @@ source_filename = "main" %prg = type { i16 } -@gX = global i16 0, section "var-gX:i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i16" +@gX = global i16 0, section "var-$RUSTY$gX:i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i16 20, i16* @gX, align 2 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 24cfe619b9..23df0bcab4 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32, i32, i32, i8, i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r7i32i32i32i32u8u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r7i32i32i32i32u8u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 821be14774..a824d5337e 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 819de23ac9..e49be94e85 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6fbfe7951c..a69798fd14 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, section "var-x:e3i32" -@__global_x.red = unnamed_addr constant i32 0, section "var-red:e3i32" -@__global_x.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" -@__global_x.green = unnamed_addr constant i32 2, section "var-green:e3i32" +@x = global i32 0, section "var-$RUSTY$x:e3i32" +@__global_x.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" +@__global_x.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" +@__global_x.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" 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 5df9248f0b..5637181171 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,5 +7,5 @@ source_filename = "main" %__global_x = type { i32, i32 } -@x = global %__global_x zeroinitializer, section "var-x:r2i32i32" -@____global_x__init = unnamed_addr constant %__global_x zeroinitializer, section "var-____global_x__init:r2i32i32" +@x = global %__global_x zeroinitializer, section "var-$RUSTY$x:r2i32i32" +@____global_x__init = unnamed_addr constant %__global_x zeroinitializer, section "var-$RUSTY$____global_x__init:r2i32i32" 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 9366806347..53cc42de78 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,12 +7,12 @@ source_filename = "main" %aaa = type { i16, i16, [5 x i8], [3 x i8] } -@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:r4i16i16au8au8" +@a = unnamed_addr constant i16 0, section "var-$RUSTY$a:i16" +@b = unnamed_addr constant i16 2, section "var-$RUSTY$b:i16" +@c = unnamed_addr constant i16 5, section "var-$RUSTY$c:i16" +@aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer }, section "var-$RUSTY$aaa_instance:r4i16i16au8au8" -define void @aaa(%aaa* %0) section "fn-aaa:v" { +define void @aaa(%aaa* %0) section "fn-$RUSTY$aaa:v" { entry: %a = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 0 %b = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 1 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 a6a812cb69..87c7d9eaa1 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,14 +8,14 @@ source_filename = "main" %MyClass = type {} %MyClass.testMethod = type { i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r0" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r0" -define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { +define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { entry: ret void } -define i16 @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-MyClass.testMethod:i16[i16]" { +define i16 @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:i16[i16]" { entry: %myMethodArg = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 0 %testMethod = alloca i16, align 2 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 0f6c73e9ae..8e9dc9ccaa 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,14 +8,14 @@ source_filename = "main" %MyClass = type {} %MyClass.testMethod = type { i16, i16 } -@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-__MyClass__init:r0" +@__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r0" -define void @MyClass(%MyClass* %0) section "fn-MyClass:v" { +define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { entry: ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { entry: %myMethodArg = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 0 %myMethodLocalVar = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 1 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 8a48e525ec..1579e045bc 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,9 +7,9 @@ source_filename = "main" %main = type { float, float, double, double } -@main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF }, section "var-main_instance:r4f32f32f64f64" +@main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF }, section "var-$RUSTY$main_instance:r4f32f32f64f64" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %F32_MIN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %F32_MAX = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 f480411b35..736ff83786 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,9 +7,9 @@ source_filename = "main" %prg = type { [8 x i32] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [8 x i32], [8 x i32]* %x, i32 0, i32 4 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 b370dd5317..a234c2d499 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,9 +7,9 @@ source_filename = "main" %prg = type { [6 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 9fe81c037e..2c82ee55a2 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,9 +7,9 @@ source_filename = "main" %prg = type { [4 x [2 x i32]] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1aai32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1aai32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %x, i32 0, i32 2 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 bb371c4436..5fb0d0ebc4 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,9 +7,9 @@ source_filename = "main" %main = type { i16, i16, i16, [125 x i32] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16i16i16ai32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16i16i16ai32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 04b13ead9f..03487be827 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,9 +7,9 @@ source_filename = "main" %main = type { i16, i16, i16, [125 x i32] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16i16i16ai32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16i16i16ai32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 466f334246..da7ea64ee9 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,9 +7,9 @@ source_filename = "main" %prg = type { [3 x [2 x i16]] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1aai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1aai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 5bee306bcc..ca091a63ba 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @bar() section "fn-bar:i32" { +define i32 @bar() section "fn-$RUSTY$bar:i32" { entry: %bar = alloca i32, align 4 store i32 0, i32* %bar, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %bar_ret } -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { entry: %foo = alloca i32, align 4 %in = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @bar() 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 ca78e6e50c..9230623944 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,9 +7,9 @@ source_filename = "main" %main = type { i16 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2i16i16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i16i16" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %temp = alloca i16, align 2 %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 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 854de40cb7..a8e6b32c9f 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,18 +9,18 @@ source_filename = "main" %foo = type { i32* } %prg = type { i32 } -@foo2_instance = global %foo2 zeroinitializer, section "var-foo2_instance:r2pi32i32" -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1pi32" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@foo2_instance = global %foo2 zeroinitializer, section "var-$RUSTY$foo2_instance:r2pi32i32" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1pi32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @foo2(%foo2* %0) section "fn-foo2:v[pi32][i32]" { +define void @foo2(%foo2* %0) section "fn-$RUSTY$foo2:v[pi32][i32]" { entry: %inout = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 0 %in = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 1 ret void } -define void @foo(%foo* %0) section "fn-foo:v[pi32]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[pi32]" { entry: %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %deref = load i32*, i32** %inout, align 8 @@ -32,7 +32,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32* %baz, i32** getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap index f1c0ea918b..02c169bf67 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @main(i16** %0, i16* %1) section "fn-main:i16[ppi16][pai16]" { +define i16 @main(i16** %0, i16* %1) section "fn-$RUSTY$main:i16[ppi16][pai16]" { entry: %main = alloca i16, align 2 %a = alloca i16**, align 8 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 0e342dc23c..cd9516d4a5 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8*, i8* } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8pu8pu8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8pu8pu8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %pX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 29fcb3984a..29ad582599 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,15 +8,15 @@ source_filename = "main" %foo = type {} %prg = type {} -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r0" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-foo:v" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: call void @foo(%foo* @foo_instance) ret void 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 195b7709c7..7b0f68c8dc 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 7c3c418f5c..8597d9c327 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 f8ee63df5e..0056daf87e 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 1, i8* %y, align 1 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 015a8da609..80a0e3ea47 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,11 +7,11 @@ source_filename = "main" %mainPROG = type { i8, i16 } -@mainPROG_instance = global %mainPROG zeroinitializer, section "var-mainPROG_instance:r2u8u16" +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-$RUSTY$mainPROG_instance:r2u8u16" @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] -define void @mainPROG(%mainPROG* %0) section "fn-mainPROG:v" { +define void @mainPROG(%mainPROG* %0) section "fn-$RUSTY$mainPROG:v" { entry: %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 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 89cb1e4b03..bcd7ca81bc 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, section "var-mainPROG_instance:r2u8u16" +@mainPROG_instance = global %mainPROG zeroinitializer, section "var-$RUSTY$mainPROG_instance:r2u8u16" @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] @@ -15,7 +15,7 @@ source_filename = "main" @utf16_literal_2 = private unnamed_addr constant [2 x i16] [i16 39, i16 0] @utf16_literal_3 = private unnamed_addr constant [2 x i16] [i16 65, i16 0] -define void @mainPROG(%mainPROG* %0) section "fn-mainPROG:v" { +define void @mainPROG(%mainPROG* %0) section "fn-$RUSTY$mainPROG:v" { entry: %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 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 2f7111f762..3fd53113a8 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,9 +7,9 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 c67512b2b9..e481318994 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,9 +7,9 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b02fd61580..6247fa9ea4 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,9 +7,9 @@ source_filename = "main" %prg = type { float, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 9433a61ce8..aadb49f9e3 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,10 +8,10 @@ source_filename = "main" %foo = type { i16 } %prg = type {} -@foo_instance = global %foo { i16 7 }, section "var-foo_instance:r3i16i16i16" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@foo_instance = global %foo { i16 7 }, section "var-$RUSTY$foo_instance:r3i16i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-foo:v" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = alloca i16, align 2 @@ -26,7 +26,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: call void @foo(%foo* @foo_instance) ret void 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 5dd7601660..6ddd1200b1 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,9 +7,9 @@ source_filename = "main" %prg = type { i64, i64, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4i64i64i64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6739086a20..54552d47b5 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b1895e5d6f..a0ee38c445 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 05f2cce8a9..6529671a52 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a67762dbd8..ff2e14ca7e 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,9 +7,9 @@ source_filename = "main" %prg = type { float, float, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32f32f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32f32f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b03a2e730a..4b50d7ee45 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,9 +7,9 @@ source_filename = "main" %prg = type { float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store float 1.562500e-01, float* %y, align 4 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 2c37498a13..6e4363b5f1 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,9 +7,9 @@ source_filename = "main" %prg = type { float, i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 c6a10795cb..59a354dd17 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 c82b2ac7dd..662befc1ea 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,13 +7,13 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i8], [81 x i16], [81 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4s8u81s8u81s16u81s16u81" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4s8u81s8u81s16u81s16u81" @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] @utf16_literal_1 = private unnamed_addr constant [41 x i16] [i16 97, i16 10, i16 10, i16 32, i16 98, i16 10, i16 10, i16 32, i16 99, i16 12, i16 12, i16 32, i16 100, i16 13, i16 13, i16 32, i16 101, i16 9, i16 9, i16 32, i16 36, i16 32, i16 34, i16 100, i16 111, i16 117, i16 98, i16 108, i16 101, i16 34, i16 32, i16 87, i16 -10179, i16 -9066, i16 -10179, i16 -9066, i16 0, i16 0, i16 0, i16 0, i16 0] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %should_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %should_not_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d0953a9451..cde09cf13e 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,11 +7,11 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u81s16u81" @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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 884daaab3b..7af52c8f38 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,9 +7,9 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 0, i64* %y, align 4 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 c8b8ea6807..148f498e94 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,9 +7,9 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 0, i64* %y, align 4 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 88b3a6a6bc..eeacbb46c4 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,17 +8,17 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type {} -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 076ca001cf..af00d4d3f0 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,17 +8,17 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type {} -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r0" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 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 c37a86bca4..d533f19db9 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,10 +8,10 @@ source_filename = "main" %foo = type { i32* } %prg = type { i32 } -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1pi32" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1pi32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @foo(%foo* %0) section "fn-foo:v[pi32]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[pi32]" { entry: %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %deref = load i32*, i32** %inout, align 8 @@ -22,7 +22,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 7, i32* %baz, align 4 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 4ba9b1bc8e..cc8392f436 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,17 +8,17 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type { i8 } -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 4ba9b1bc8e..cc8392f436 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,17 +8,17 @@ source_filename = "main" %foo = type { i32, i8 } %prg = type { i8 } -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r2i32u8" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @foo(%foo* %0) section "fn-foo:v[i32][u8]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 be6a92f757..c3a91f18e9 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 604f7c4020..31f63a6092 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 33e2084dd0..5e64b1a534 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 462d1c7550..d8193c60c5 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 7, i32* %y, align 4 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 c7fe8ea017..9480d5c1e5 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b7df37b6ec..45c105a08d 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d00ce675cd..9536961b07 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d6266264d2..4ad950148d 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 2691ebfd78..945e2bde0a 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,23 +8,23 @@ source_filename = "main" %bar = type { %fb } %fb = type { i32 } -@bar_instance = global %bar zeroinitializer, section "var-bar_instance:r1r1i32" -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32" +@bar_instance = global %bar zeroinitializer, section "var-$RUSTY$bar_instance:r1r1i32" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1i32" -define void @bar(%bar* %0) section "fn-bar:v" { +define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { entry: %fb_inst = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 call void @fb.foo(%fb* %fb_inst) ret void } -define void @fb(%fb* %0) section "fn-fb:v" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define void @fb.foo(%fb* %0) section "fn-fb.foo:v" { +define void @fb.foo(%fb* %0) section "fn-$RUSTY$fb.foo:v" { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 9f9f81bbe3..55c0eb2814 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,22 +8,22 @@ source_filename = "main" %bar = type {} %prg = type { i32 } -@bar_instance = global %bar zeroinitializer, section "var-bar_instance:r0" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@bar_instance = global %bar zeroinitializer, section "var-$RUSTY$bar_instance:r0" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @bar(%bar* %0) section "fn-bar:v" { +define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { entry: call void @prg.foo(%prg* @prg_instance) ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void } -define void @prg.foo(%prg* %0) section "fn-prg.foo:v" { +define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 ecbb0f4dfc..40b9b20ea5 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,16 +7,16 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @prg.foo(%prg* @prg_instance) ret void } -define void @prg.foo(%prg* %0) section "fn-prg.foo:v" { +define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 801597c15a..17bbea8e09 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define float @foo() section "fn-foo:f32" { +define float @foo() section "fn-$RUSTY$foo:f32" { entry: %foo = alloca float, align 4 store float 0.000000e+00, float* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret float %foo_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call float @foo() 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 17dd24c687..fb28f15ddf 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,17 +9,17 @@ source_filename = "main" %foo = type { i32, i32, %fb } %prg = type { i32 } -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1i32" -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r3i32i32r1i32" -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1i32" +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r3i32i32r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @fb(%fb* %0) section "fn-fb:v[i32]" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v[i32]" { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define void @foo(%foo* %0) section "fn-foo:v[i32][i32][r1i32]" { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][i32][r1i32]" { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 @@ -27,7 +27,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 ca6c818fbf..6677ce0538 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,24 +9,24 @@ source_filename = "main" %prog = type { %STRUCT_params*, %STRUCT_params* } %main = type {} -@global1 = global %STRUCT_params zeroinitializer, section "var-global1:r3u8u8u8" -@__STRUCT_params__init = unnamed_addr constant %STRUCT_params zeroinitializer, section "var-__STRUCT_params__init:r3u8u8u8" -@global2 = global %STRUCT_params zeroinitializer, section "var-global2:r3u8u8u8" -@global3 = global %STRUCT_params zeroinitializer, section "var-global3:r3u8u8u8" -@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:r2pr3u8u8u8pr3u8u8u8" -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@global1 = global %STRUCT_params zeroinitializer, section "var-$RUSTY$global1:r3u8u8u8" +@__STRUCT_params__init = unnamed_addr constant %STRUCT_params zeroinitializer, section "var-$RUSTY$__STRUCT_params__init:r3u8u8u8" +@global2 = global %STRUCT_params zeroinitializer, section "var-$RUSTY$global2:r3u8u8u8" +@global3 = global %STRUCT_params zeroinitializer, section "var-$RUSTY$global3:r3u8u8u8" +@global4 = global i32 0, section "var-$RUSTY$global4:i32" +@global5 = global [81 x i8] zeroinitializer, section "var-$RUSTY$global5:s8u81" +@global6 = global float 0.000000e+00, section "var-$RUSTY$global6:f32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2pr3u8u8u8pr3u8u8u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @prog(%prog* %0) section "fn-prog:v[pr3u8u8u8][pr3u8u8u8]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[pr3u8u8u8][pr3u8u8u8]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %input2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: store %STRUCT_params* @global1, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 8 store %STRUCT_params* @global2, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 8 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 3bb98b718a..eec9b3d007 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %while_body diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap index c2a46131f6..c00bf980cc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @smaller_than_ten(i8 %0) section "fn-smaller_than_ten:i16[i8]" { +define i16 @smaller_than_ten(i8 %0) section "fn-$RUSTY$smaller_than_ten:i16[i8]" { entry: %smaller_than_ten = alloca i16, align 2 %n = alloca i8, align 1 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 a078a7059a..cb295b5885 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,9 +7,9 @@ source_filename = "main" %abcdef = type { i8 } -@__abcdef__init = unnamed_addr constant %abcdef zeroinitializer, section "var-__abcdef__init:r1i8" +@__abcdef__init = unnamed_addr constant %abcdef zeroinitializer, section "var-$RUSTY$__abcdef__init:r1i8" -define void @abcdef(%abcdef* %0) section "fn-abcdef:v[i8]" { +define void @abcdef(%abcdef* %0) section "fn-$RUSTY$abcdef:v[i8]" { entry: %n = getelementptr inbounds %abcdef, %abcdef* %0, i32 0, i32 0 %load_n = load i8, i8* %n, align 1 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 4ab6f71f30..c41c610a88 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 3756addffc..d789eb7721 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap index 46398c63e8..2677cbcb87 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %i = alloca i32, align 4 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 93c596227f..4371bad181 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,7 +8,7 @@ source_filename = "main" %MyStruct = type { i32, i16 } %__global_y = type { i8, i8 } -@x = global %MyStruct zeroinitializer, section "var-x:r2i32i16" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i16" -@y = global %__global_y zeroinitializer, section "var-y:r2u8u8" -@____global_y__init = unnamed_addr constant %__global_y zeroinitializer, section "var-____global_y__init:r2u8u8" +@x = global %MyStruct zeroinitializer, section "var-$RUSTY$x:r2i32i16" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i16" +@y = global %__global_y zeroinitializer, section "var-$RUSTY$y:r2u8u8" +@____global_y__init = unnamed_addr constant %__global_y zeroinitializer, section "var-$RUSTY$____global_y__init:r2u8u8" 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 e1eb24573b..3e83ed11ae 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,10 +8,10 @@ source_filename = "main" %MainProg = type { %MyStruct } %MyStruct = type { i32, i32 } -@MainProg_instance = global %MainProg zeroinitializer, section "var-MainProg_instance:r1r2i32i32" -@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-__MyStruct__init:r2i32i32" +@MainProg_instance = global %MainProg zeroinitializer, section "var-$RUSTY$MainProg_instance:r1r2i32i32" +@__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i32" -define void @MainProg(%MainProg* %0) section "fn-MainProg:v" { +define void @MainProg(%MainProg* %0) section "fn-$RUSTY$MainProg:v" { entry: %Cord = getelementptr inbounds %MainProg, %MainProg* %0, i32 0, i32 0 %a = getelementptr inbounds %MyStruct, %MyStruct* %Cord, i32 0, i32 0 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 9b01c2c51a..eb3ee8488d 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,9 +7,9 @@ source_filename = "main" %main = type { i8, i8, i8, i16, i16, i16, i32, i32, i64, i64 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r10u8i8u8u16i16u16i32u32i64u64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r10u8i8u8u16i16u16i32u32i64u64" -define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) section "fn-CheckRangeSigned:i32[i32][i32][i32]" { +define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$CheckRangeSigned:i32[i32][i32][i32]" { entry: %CheckRangeSigned = alloca i32, align 4 %v = alloca i32, align 4 @@ -24,7 +24,7 @@ entry: ret i32 %CheckRangeSigned_ret } -define i32 @CheckRangeUnsigned(i32 %0, i32 %1, i32 %2) section "fn-CheckRangeUnsigned:u32[u32][u32][u32]" { +define i32 @CheckRangeUnsigned(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$CheckRangeUnsigned:u32[u32][u32][u32]" { entry: %CheckRangeUnsigned = alloca i32, align 4 %v = alloca i32, align 4 @@ -39,7 +39,7 @@ entry: ret i32 %CheckRangeUnsigned_ret } -define i64 @CheckLRangeSigned(i64 %0, i64 %1, i64 %2) section "fn-CheckLRangeSigned:i64[i64][i64][i64]" { +define i64 @CheckLRangeSigned(i64 %0, i64 %1, i64 %2) section "fn-$RUSTY$CheckLRangeSigned:i64[i64][i64][i64]" { entry: %CheckLRangeSigned = alloca i64, align 8 %v = alloca i64, align 8 @@ -54,7 +54,7 @@ entry: ret i64 %CheckLRangeSigned_ret } -define i64 @CheckLRangeUnsigned(i64 %0, i64 %1, i64 %2) section "fn-CheckLRangeUnsigned:u64[u64][u64][u64]" { +define i64 @CheckLRangeUnsigned(i64 %0, i64 %1, i64 %2) section "fn-$RUSTY$CheckLRangeUnsigned:u64[u64][u64][u64]" { entry: %CheckLRangeUnsigned = alloca i64, align 8 %v = alloca i64, align 8 @@ -69,7 +69,7 @@ entry: ret i64 %CheckLRangeUnsigned_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 406c77df70..bc09741b3b 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,9 +7,9 @@ source_filename = "main" %Main = type { i16 } -@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1i16" +@Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1i16" -define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) section "fn-Check_XX_RangeSigned:i16[i16][i16][i16]" { +define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$Check_XX_RangeSigned:i16[i16][i16][i16]" { entry: %Check_XX_RangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -25,7 +25,7 @@ entry: ret i16 %Check_XX_RangeSigned_ret } -define void @Main(%Main* %0) section "fn-Main:v" { +define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 store i16 7, i16* %x, align 2 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 6c549be149..dde219b202 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,9 +7,9 @@ source_filename = "main" %Main = type { i16 } -@Main_instance = global %Main zeroinitializer, section "var-Main_instance:r1i16" +@Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -25,7 +25,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @Main(%Main* %0) section "fn-Main:v" { +define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 7, i16 0, i16 100) 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 c83545dd6a..19aa36b0df 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,9 +7,9 @@ source_filename = "main" %prg = type { i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 1000000, i64* %y, align 4 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 164bfd55f7..1184d09cb3 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,12 +7,12 @@ source_filename = "main" %main = type {} -@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:r0" +@gX = global i16 0, section "var-$RUSTY$gX:i16" +@gY = global i8 0, section "var-$RUSTY$gY:u8" +@gA = global i16 0, section "var-$RUSTY$gA:i16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: ret void } 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 11e03c29cf..9c4d2a9527 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, section "var-x:e3u8" -@y = global i16 0, section "var-y:e3u16" -@z = global i32 0, section "var-z:e3i32" -@MyEnum.red = unnamed_addr constant i8 0, section "var-red:e3u8" -@MyEnum.yellow = unnamed_addr constant i8 1, section "var-yellow:e3u8" -@MyEnum.green = unnamed_addr constant i8 2, section "var-green:e3u8" -@MyEnum2.red = unnamed_addr constant i16 0, section "var-red:e3u16" -@MyEnum2.yellow = unnamed_addr constant i16 1, section "var-yellow:e3u16" -@MyEnum2.green = unnamed_addr constant i16 2, section "var-green:e3u16" -@MyEnum3.red = unnamed_addr constant i32 0, section "var-red:e3i32" -@MyEnum3.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" -@MyEnum3.green = unnamed_addr constant i32 2, section "var-green:e3i32" +@x = global i8 0, section "var-$RUSTY$x:e3u8" +@y = global i16 0, section "var-$RUSTY$y:e3u16" +@z = global i32 0, section "var-$RUSTY$z:e3i32" +@MyEnum.red = unnamed_addr constant i8 0, section "var-$RUSTY$red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 1, section "var-$RUSTY$yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 2, section "var-$RUSTY$green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 0, section "var-$RUSTY$red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 1, section "var-$RUSTY$yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 2, section "var-$RUSTY$green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" 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 e1a6f27a37..97965f0407 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,18 +7,18 @@ source_filename = "main" %prg = type { i8, i16, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u16i32" -@MyEnum.red = unnamed_addr constant i8 5, section "var-red:e3u8" -@MyEnum.yellow = unnamed_addr constant i8 6, section "var-yellow:e3u8" -@MyEnum.green = unnamed_addr constant i8 7, section "var-green:e3u8" -@MyEnum2.red = unnamed_addr constant i16 15, section "var-red:e3u16" -@MyEnum2.yellow = unnamed_addr constant i16 16, section "var-yellow:e3u16" -@MyEnum2.green = unnamed_addr constant i16 17, section "var-green:e3u16" -@MyEnum3.red = unnamed_addr constant i32 25, section "var-red:e3i32" -@MyEnum3.yellow = unnamed_addr constant i32 26, section "var-yellow:e3i32" -@MyEnum3.green = unnamed_addr constant i32 27, section "var-green:e3i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u16i32" +@MyEnum.red = unnamed_addr constant i8 5, section "var-$RUSTY$red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 6, section "var-$RUSTY$yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 7, section "var-$RUSTY$green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 15, section "var-$RUSTY$red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 16, section "var-$RUSTY$yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 17, section "var-$RUSTY$green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 25, section "var-$RUSTY$red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 26, section "var-$RUSTY$yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 27, section "var-$RUSTY$green:e3i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 0e7216538e..abef6cc783 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, section "var-x:e3u8" -@y = global i16 0, section "var-y:e3u16" -@z = global i32 0, section "var-z:e3i32" -@MyEnum.red = unnamed_addr constant i8 1, section "var-red:e3u8" -@MyEnum.yellow = unnamed_addr constant i8 2, section "var-yellow:e3u8" -@MyEnum.green = unnamed_addr constant i8 3, section "var-green:e3u8" -@MyEnum2.red = unnamed_addr constant i16 10, section "var-red:e3u16" -@MyEnum2.yellow = unnamed_addr constant i16 11, section "var-yellow:e3u16" -@MyEnum2.green = unnamed_addr constant i16 12, section "var-green:e3u16" -@MyEnum3.red = unnamed_addr constant i32 22, section "var-red:e3i32" -@MyEnum3.yellow = unnamed_addr constant i32 33, section "var-yellow:e3i32" -@MyEnum3.green = unnamed_addr constant i32 44, section "var-green:e3i32" +@x = global i8 0, section "var-$RUSTY$x:e3u8" +@y = global i16 0, section "var-$RUSTY$y:e3u16" +@z = global i32 0, section "var-$RUSTY$z:e3i32" +@MyEnum.red = unnamed_addr constant i8 1, section "var-$RUSTY$red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 2, section "var-$RUSTY$yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 3, section "var-$RUSTY$green:e3u8" +@MyEnum2.red = unnamed_addr constant i16 10, section "var-$RUSTY$red:e3u16" +@MyEnum2.yellow = unnamed_addr constant i16 11, section "var-$RUSTY$yellow:e3u16" +@MyEnum2.green = unnamed_addr constant i16 12, section "var-$RUSTY$green:e3u16" +@MyEnum3.red = unnamed_addr constant i32 22, section "var-$RUSTY$red:e3i32" +@MyEnum3.yellow = unnamed_addr constant i32 33, section "var-$RUSTY$yellow:e3i32" +@MyEnum3.green = unnamed_addr constant i32 44, section "var-$RUSTY$green:e3i32" 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 58eb488941..c5505b5caa 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, section "var-twenty:i16" -@x = global i8 0, section "var-x:e3u8" -@MyEnum.red = unnamed_addr constant i8 7, section "var-red:e3u8" -@MyEnum.yellow = unnamed_addr constant i8 8, section "var-yellow:e3u8" -@MyEnum.green = unnamed_addr constant i8 9, section "var-green:e3u8" -@MyEnum2.a = unnamed_addr constant i8 0, section "var-a:e7u8" -@MyEnum2.b = unnamed_addr constant i8 1, section "var-b:e7u8" -@MyEnum2.c = unnamed_addr constant i8 7, section "var-c:e7u8" -@MyEnum2.d = unnamed_addr constant i8 8, section "var-d:e7u8" -@MyEnum2.e = unnamed_addr constant i8 9, section "var-e:e7u8" -@MyEnum2.f = unnamed_addr constant i8 20, section "var-f:e7u8" -@MyEnum2.g = unnamed_addr constant i8 21, section "var-g:e7u8" +@twenty = unnamed_addr constant i16 20, section "var-$RUSTY$twenty:i16" +@x = global i8 0, section "var-$RUSTY$x:e3u8" +@MyEnum.red = unnamed_addr constant i8 7, section "var-$RUSTY$red:e3u8" +@MyEnum.yellow = unnamed_addr constant i8 8, section "var-$RUSTY$yellow:e3u8" +@MyEnum.green = unnamed_addr constant i8 9, section "var-$RUSTY$green:e3u8" +@MyEnum2.a = unnamed_addr constant i8 0, section "var-$RUSTY$a:e7u8" +@MyEnum2.b = unnamed_addr constant i8 1, section "var-$RUSTY$b:e7u8" +@MyEnum2.c = unnamed_addr constant i8 7, section "var-$RUSTY$c:e7u8" +@MyEnum2.d = unnamed_addr constant i8 8, section "var-$RUSTY$d:e7u8" +@MyEnum2.e = unnamed_addr constant i8 9, section "var-$RUSTY$e:e7u8" +@MyEnum2.f = unnamed_addr constant i8 20, section "var-$RUSTY$f:e7u8" +@MyEnum2.g = unnamed_addr constant i8 21, section "var-$RUSTY$g:e7u8" 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 1d440f1def..5f55331eb1 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,9 +7,9 @@ source_filename = "main" %prg = type { [14 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1ai16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 4855798e14..bf6f679b63 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,11 +7,11 @@ source_filename = "main" %prg = type { i16 } -@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:r1i16" +@CONST = global i16 7, section "var-$RUSTY$CONST:i16" +@MIN = global i16 7, section "var-$RUSTY$MIN:i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -27,7 +27,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_MIN = load i16, i16* @MIN, align 2 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 fe586b20b5..f03fe9d1c1 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,12 +7,12 @@ source_filename = "main" %prg = type { i32 } -@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:r1i32" +@cA = unnamed_addr constant i16 1, section "var-$RUSTY$cA:i16" +@cB = unnamed_addr constant i16 2, section "var-$RUSTY$cB:i16" +@cC = unnamed_addr constant i16 3, section "var-$RUSTY$cC:i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 6, i32* %z, align 4 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 014acc0aad..51c2a26aa4 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,9 +7,9 @@ source_filename = "main" %prog = type { i64 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1i64" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1i64" -define i64 @func() section "fn-func:i64" { +define i64 @func() section "fn-$RUSTY$func:i64" { entry: %func = alloca i64, align 8 %TIME = alloca i64, align 8 @@ -19,7 +19,7 @@ entry: ret i64 %func_ret } -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %TIME = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 ba6405638e..bb75b11e96 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,9 +7,9 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check 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 6499a7cdce..2da5f62bc8 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check 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 8fc4c23721..ff1fc737a2 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,9 +7,9 @@ source_filename = "main" %prg = type { i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap index 294ce2caff..e00468537d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap index 294ce2caff..e00468537d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 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 5ea8368310..cb1dcf50c3 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,9 +7,9 @@ source_filename = "main" %main = type { i64, i64, i64, i64 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r4i64i64i64i64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i64i64i64i64" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var_time = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var_time_of_day = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 a30144e84e..2374533195 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,9 +7,9 @@ source_filename = "main" %main = type { float*, i16, i32, float, double, i8, i16, i32, i64, i8, i16, i32, i64 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r13pf32i16i32f32f64i8i16i32i64u8u16u32u64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r13pf32i16i32f32f64i8i16i32i64u8u16u32u64" -define float @foo() section "fn-foo:f32" { +define float @foo() section "fn-$RUSTY$foo:f32" { entry: %foo = alloca float, align 4 store float 0.000000e+00, float* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret float %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %ptr_float = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 0a2655bde5..7061563847 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,9 +7,9 @@ source_filename = "main" %main = type { i16*, i16, i32, i8, i16, i32, i64, i8, i16, i32, i64 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r11pi16i16i32i8i16i32i64u8u16u32u64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r11pi16i16i32i8i16i32i64u8u16u32u64" -define i64 @foo() section "fn-foo:i64" { +define i64 @foo() section "fn-$RUSTY$foo:i64" { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %ptr_int = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 8bc13195d1..8ea2a13eb6 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,9 +7,9 @@ source_filename = "main" %main = type { i16, i16, i16*, i8 } -@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 }, section "var-main_instance:r4i16i16pi16u8" +@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 }, section "var-$RUSTY$main_instance:r4i16i16pi16u8" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 557b0230de..e1405db64d 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,9 +7,9 @@ source_filename = "main" %main = type { i16*, i16, i8 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3pi16i16u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3pi16i16u8" -define i64 @foo() section "fn-foo:i64" { +define i64 @foo() section "fn-$RUSTY$foo:i64" { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap index 294ce2caff..e00468537d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap index f692225ced..48267d94d4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap @@ -8,7 +8,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap index 68c952ff72..96d9c979e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap @@ -8,7 +8,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap index a569845d5f..9f9a9afc1f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-STRING_GREATER:u8[s8u1025][s8u1025]" { +define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-$RUSTY$STRING_GREATER:u8[s8u1025][s8u1025]" { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_GREATER_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -39,7 +39,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap index cbebe3cb1f..0df19053b2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-STRING_GREATER:u8[s8u1025][s8u1025]" { +define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-$RUSTY$STRING_GREATER:u8[s8u1025][s8u1025]" { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_GREATER_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap index 37ce4183d3..1c657cb42f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-STRING_LESS:u8[s8u1025][s8u1025]" { +define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-$RUSTY$STRING_LESS:u8[s8u1025][s8u1025]" { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_LESS_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap index 038ff3e2f8..f92c798710 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap index db2db49d73..4ae435d748 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-STRING_LESS:u8[s8u1025][s8u1025]" { +define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-$RUSTY$STRING_LESS:u8[s8u1025][s8u1025]" { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_LESS_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -39,7 +39,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 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 c79d310443..ea2fbfae18 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,10 +7,10 @@ source_filename = "main" %main = type { [4 x i16] } -@const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4], section "var-const_arr:ai16" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1ai16" +@const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4], section "var-$RUSTY$const_arr:ai16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1ai16" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [4 x i16]* %arr to i8* 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 392c465798..2b61ed25b8 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,10 +7,10 @@ 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", section "var-const_str:s8u81" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@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-$RUSTY$const_str:s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [81 x i8]* %str to i8* 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 e75e39f6c7..2691f18820 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,11 +8,11 @@ source_filename = "main" %Point = type { i16, i16 } %main = type { %Point } -@const_strct = unnamed_addr constant %Point { i16 1, i16 2 }, section "var-const_strct:r2i16i16" -@__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1r2i16i16" +@const_strct = unnamed_addr constant %Point { i16 1, i16 2 }, section "var-$RUSTY$const_strct:r2i16i16" +@__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r2i16i16" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %strct = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast %Point* %strct to i8* 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 fd970898c0..f73180c282 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, section "var-gInt:i32", !dbg !0 +@gInt = global i32 0, section "var-$RUSTY$gInt:i32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} 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 d5ada2b6fe..1811dc5f2f 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, section "var-gInt:i32", !dbg !0 +@gInt = global i32 0, section "var-$RUSTY$gInt:i32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} 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 c1eb695a51..6de29550fd 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, section "var-a:ai32", !dbg !0 -@b = global [110 x i32] zeroinitializer, section "var-b:ai32", !dbg !7 -@c = global [11 x [10 x i32]] zeroinitializer, section "var-c:aai32", !dbg !12 +@a = global [11 x i32] zeroinitializer, section "var-$RUSTY$a:ai32", !dbg !0 +@b = global [110 x i32] zeroinitializer, section "var-$RUSTY$b:ai32", !dbg !7 +@c = global [11 x [10 x i32]] zeroinitializer, section "var-$RUSTY$c:aai32", !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 b76a363b7f..5f3be0978e 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, 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 +@a = global i8 0, section "var-$RUSTY$a:u8", !dbg !0 +@b = global i8 0, section "var-$RUSTY$b:u8", !dbg !4 +@c = global i16 0, section "var-$RUSTY$c:u16", !dbg !7 +@d = global i32 0, section "var-$RUSTY$d:u32", !dbg !10 +@e = global i64 0, section "var-$RUSTY$e:u64", !dbg !13 !llvm.module.flags = !{!16, !17} !llvm.dbg.cu = !{!18} 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 dff210faf8..aa115753be 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, section "var-en3:e3i64", !dbg !0 -@en1.a = unnamed_addr constant i32 0, section "var-a:e3i32", !dbg !5 -@en1.b = unnamed_addr constant i32 1, section "var-b:e3i32", !dbg !9 -@en1.c = unnamed_addr constant i32 2, section "var-c:e3i32", !dbg !11 -@en2.d = unnamed_addr constant i8 0, section "var-d:e3u8", !dbg !13 -@en2.e = unnamed_addr constant i8 1, section "var-e:e3u8", !dbg !17 -@en2.f = unnamed_addr constant i8 2, section "var-f:e3u8", !dbg !19 -@__global_en3.a = unnamed_addr constant i64 0, section "var-a:e3i64", !dbg !21 -@__global_en3.b = unnamed_addr constant i64 1, section "var-b:e3i64", !dbg !23 -@__global_en3.c = unnamed_addr constant i64 2, section "var-c:e3i64", !dbg !25 +@en3 = global i64 0, section "var-$RUSTY$en3:e3i64", !dbg !0 +@en1.a = unnamed_addr constant i32 0, section "var-$RUSTY$a:e3i32", !dbg !5 +@en1.b = unnamed_addr constant i32 1, section "var-$RUSTY$b:e3i32", !dbg !9 +@en1.c = unnamed_addr constant i32 2, section "var-$RUSTY$c:e3i32", !dbg !11 +@en2.d = unnamed_addr constant i8 0, section "var-$RUSTY$d:e3u8", !dbg !13 +@en2.e = unnamed_addr constant i8 1, section "var-$RUSTY$e:e3u8", !dbg !17 +@en2.f = unnamed_addr constant i8 2, section "var-$RUSTY$f:e3u8", !dbg !19 +@__global_en3.a = unnamed_addr constant i64 0, section "var-$RUSTY$a:e3i64", !dbg !21 +@__global_en3.b = unnamed_addr constant i64 1, section "var-$RUSTY$b:e3i64", !dbg !23 +@__global_en3.c = unnamed_addr constant i64 2, section "var-$RUSTY$c:e3i64", !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 66516a5731..0b88473ac8 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, section "var-a:f32", !dbg !0 -@b = global double 0.000000e+00, section "var-b:f64", !dbg !4 +@a = global float 0.000000e+00, section "var-$RUSTY$a:f32", !dbg !0 +@b = global double 0.000000e+00, section "var-$RUSTY$b:f64", !dbg !4 !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} 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 49401e2564..28d2d68c71 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, 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 +@a = global i8 0, section "var-$RUSTY$a:i8", !dbg !0 +@b = global i8 0, section "var-$RUSTY$b:u8", !dbg !4 +@c = global i16 0, section "var-$RUSTY$c:i16", !dbg !7 +@d = global i16 0, section "var-$RUSTY$d:u16", !dbg !10 +@e = global i32 0, section "var-$RUSTY$e:i32", !dbg !13 +@f = global i32 0, section "var-$RUSTY$f:u32", !dbg !16 +@g = global i64 0, section "var-$RUSTY$g:i64", !dbg !19 +@h = global i64 0, section "var-$RUSTY$h:u64", !dbg !22 !llvm.module.flags = !{!25, !26} !llvm.dbg.cu = !{!27} 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 d027803f33..803a57f349 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, section "var-gStruct:r2i32r2i32f64", !dbg !0 -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r2i32r2i32f64", !dbg !13 -@__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, section "var-__myStruct2__init:r2i32f64", !dbg !15 +@gStruct = global %myStruct zeroinitializer, section "var-$RUSTY$gStruct:r2i32r2i32f64", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r2i32r2i32f64", !dbg !13 +@__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, section "var-$RUSTY$__myStruct2__init:r2i32f64", !dbg !15 !llvm.module.flags = !{!17, !18} !llvm.dbg.cu = !{!19} 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 14397d0fda..866adc9025 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, section "var-a:pi32", !dbg !0 +@a = global i32* null, section "var-$RUSTY$a:pi32", !dbg !0 !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} 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 5187ca6c16..864e7f4fba 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, section "var-a:s8u81", !dbg !0 -@b = global [81 x i16] zeroinitializer, section "var-b:s16u81", !dbg !7 +@a = global [81 x i8] zeroinitializer, section "var-$RUSTY$a:s8u81", !dbg !0 +@b = global [81 x i16] zeroinitializer, section "var-$RUSTY$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 871f67630c..0597974f4c 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, section "var-gStruct:r3i32f64ai32", !dbg !0 -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r3i32f64ai32", !dbg !13 -@b = global [11 x %myStruct] zeroinitializer, section "var-b:ar3i32f64ai32", !dbg !15 +@gStruct = global %myStruct zeroinitializer, section "var-$RUSTY$gStruct:r3i32f64ai32", !dbg !0 +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r3i32f64ai32", !dbg !13 +@b = global [11 x %myStruct] zeroinitializer, section "var-$RUSTY$b:ar3i32f64ai32", !dbg !15 !llvm.module.flags = !{!18, !19} !llvm.dbg.cu = !{!20} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap index 7d43f2e95a..17b1cc0780 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %a = alloca i8, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap index a2afbc1809..9dd16c7c5e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %b = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap index 3bdd26d450..be0753e99e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap index ef35b7c34e..3e4cf08673 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap index 414c121c50..4b2a62507b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 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 76d125b683..178b8710e9 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,9 +7,9 @@ source_filename = "main" %myStruct = type { i8 } -@__myStruct__init = unnamed_addr constant %myStruct { i8 1 }, section "var-__myStruct__init:r1u8" +@__myStruct__init = unnamed_addr constant %myStruct { i8 1 }, section "var-$RUSTY$__myStruct__init:r1u8" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %str = alloca %myStruct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap index d2ce83e27c..b0ac3abaca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 %c = alloca i32, align 4 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 30190c2d92..7b186085ef 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,9 +7,9 @@ source_filename = "main" %baz = type { [11 x i8], i8*, [10 x i8]* } -@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r3s8u11pu8pau8" +@baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r3s8u11pu8pau8" -define void @baz(%baz* %0) section "fn-baz:v" { +define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { entry: %str = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 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 418072e370..772275ede2 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,9 +7,9 @@ source_filename = "main" %main = type { i16, [2 x i16], i16*, [2 x i16]* } -@main_instance = global %main zeroinitializer, section "var-main_instance:r4i16ai16pi16pai16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16ai16pi16pai16" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %v = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap index 34fcd40fde..28886fa044 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap index 53f6c8618b..f8efd2d2ac 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap index 36adeb195f..3007b56127 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap index 8fff2dea87..34a91ddfc7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap index c3559a71d3..c08bacfc03 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap index 0cc25f9daf..d6d8a79ac0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 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 d909619bfc..8b30fb03c9 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,9 +7,9 @@ source_filename = "main" %main = type { i32*, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 5a1062dd9c..8a90e7a960 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,10 +8,10 @@ source_filename = "main" %main = type { [2 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 e719b32b32..48d5aecacc 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 3251d79a90..83fc6f99f0 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r5i32i32i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r5i32i32i32i32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 339ed086af..25482f90db 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,13 +7,13 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @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" @utf08_literal_3 = private unnamed_addr constant [4 x i8] c"sit\00" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 941a404562..e4be51277b 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,9 +7,9 @@ source_filename = "main" %main = type { i32*, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 faddb1b318..bd9ab0f2a9 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 20eea20d29..035232f169 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 5ebe343440..be59e2f268 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i64 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i64" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i64" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 3e9bc8b502..f652e3b20d 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,10 +8,10 @@ source_filename = "main" %main = type { [2 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 e0c48db175..6451ebd31b 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,11 +8,11 @@ source_filename = "main" %main = type { [16 x i32], i32 } %__foo_vla = type { i32*, [2 x i32] } -@MY_CONST = unnamed_addr constant i32 10, section "var-MY_CONST:i32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r2ai32i32" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai32ai32" +@MY_CONST = unnamed_addr constant i32 10, section "var-$RUSTY$MY_CONST:i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -31,7 +31,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap index db2dcd61de..ee02b908f5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap index f2f1b0fb5a..f8ff9fdbf9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap index 5dd59ae008..20a48a564f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap index 018095b01f..36e78e620c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap index 6b2e8e4fa3..a3fd7da5db 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap index 1db3a1d24c..db9b19e583 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 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 dc1e351f58..4171b61453 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,10 +7,10 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func([81 x i8]* %0) section "fn-func:s8u81" { +define void @func([81 x i8]* %0) section "fn-$RUSTY$func:s8u81" { entry: %func = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %func, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 f50b36c79d..e9f7708b71 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,9 +7,9 @@ source_filename = "main" %baz = type { i8*, i16 } -@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r2pu8u16" +@baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r2pu8u16" -define void @baz(%baz* %0) section "fn-baz:v" { +define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { entry: %ptr_x = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %y = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap index e6506fd430..32dc6e8eb6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %ptr_x = alloca i16*, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap index 2aa73303cd..57b04fefea 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 %ptr_x = alloca i16*, align 8 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 579ebc7de7..2d4d578bcb 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r8u8u8u8u8u8u8u8u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r8u8u8u8u8u8u8u8u8" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %cmp1 = alloca i8, align 1 %cmp2 = alloca i8, align 1 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 804684043d..2b0dd2a577 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 65df51d924..de482e43a1 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u8u8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap index 137f73001b..eb1dc9ec1c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-main:i16" { +define i16 @main() section "fn-$RUSTY$main:i16" { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -31,4 +31,4 @@ entry: ret i16 %main_ret } -declare i16 @MAX__INT(i32, i16*) section "fn-MAX__INT:i16" +declare i16 @MAX__INT(i32, i16*) section "fn-$RUSTY$MAX__INT:i16" 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 3142e5aa7b..6857bb5d92 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { entry: %foo = alloca i32, align 4 %a = alloca i32, align 4 @@ -19,7 +19,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %call = call i32 @foo(i32 2) %call1 = call i32 @foo(i32 %call) 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 814c9e121b..fd92525307 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,9 +7,9 @@ source_filename = "main" %main = type { i16, i16, i16* } -@main_instance = global %main { i16 10, i16 20, i16* null }, section "var-main_instance:r3i16i16pi16" +@main_instance = global %main { i16 10, i16 20, i16* null }, section "var-$RUSTY$main_instance:r3i16i16pi16" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6e7a8d78b1..0820ec9a24 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,9 +7,9 @@ source_filename = "main" %main = type { i16*, i16 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2pi16i16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi16i16" -define i64 @foo() section "fn-foo:i64" { +define i64 @foo() section "fn-$RUSTY$foo:i64" { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap index 47f7065d73..f4aef10525 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16* @func() section "fn-func:pi16" { +define i16* @func() section "fn-$RUSTY$func:pi16" { entry: %func = alloca i16*, align 8 store i16* null, i16** %func, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap index ff548ae5b6..941ea6b3e6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func([81 x i8]* %0, [81 x i8]* %1) section "fn-func:s8u81[ps8u81]" { +define void @func([81 x i8]* %0, [81 x i8]* %1) section "fn-$RUSTY$func:s8u81[ps8u81]" { entry: %func = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %func, align 8 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 8eb22c56cb..cfe7c75908 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,9 +7,9 @@ source_filename = "main" %myStruct = type { i16 } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r1i16" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r1i16" -define void @func(%myStruct* %0, %myStruct* %1) section "fn-func:r1i16[pr1i16]" { +define void @func(%myStruct* %0, %myStruct* %1) section "fn-$RUSTY$func:r1i16[pr1i16]" { entry: %func = alloca %myStruct*, align 8 store %myStruct* %0, %myStruct** %func, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap index 30e41c84a7..5905a187d2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @foo(i16 %0) section "fn-foo:i16[i16]" { +define i16 @foo(i16 %0) section "fn-$RUSTY$foo:i16[i16]" { entry: %foo = alloca i16, align 2 %in = alloca i16, align 2 @@ -15,7 +15,7 @@ entry: ret i16 %foo_ret } -define i16 @baz() section "fn-baz:i16" { +define i16 @baz() section "fn-$RUSTY$baz:i16" { entry: %baz = alloca i16, align 2 store i16 0, i16* %baz, align 2 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 04abb1c5ae..9aded1e339 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,9 +7,9 @@ source_filename = "main" %prg = type { float, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 f408a0f347..885da78a65 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,9 +7,9 @@ source_filename = "main" %baz = type { i8*, i8, i8, i8 } -@baz_instance = global %baz zeroinitializer, section "var-baz_instance:r4pu8u8i8u8" +@baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r4pu8u8i8u8" -define void @baz(%baz* %0) section "fn-baz:v" { +define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { entry: %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %b = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index 039a280c66..cb493902b8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %arr = alloca [5 x i32], align 4 @@ -18,7 +18,7 @@ entry: ret i32 %main_ret } -define i32 @fn_by_ref(i32* %0) section "fn-fn_by_ref:i32[pau32]" { +define i32 @fn_by_ref(i32* %0) section "fn-$RUSTY$fn_by_ref:i32[pau32]" { entry: %fn_by_ref = alloca i32, align 4 %arg_by_ref = alloca i32*, align 8 @@ -30,7 +30,7 @@ entry: ret i32 %fn_by_ref_ret } -define i32 @fn_by_val(i32* %0) section "fn-fn_by_val:i32[au32]" { +define i32 @fn_by_val(i32* %0) section "fn-$RUSTY$fn_by_val:i32[au32]" { entry: %fn_by_val = alloca i32, align 4 %arg_by_val = alloca [5 x i32], align 4 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 55a26d3a53..a43fa0ad8d 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -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]" { +define i32 @func(i8* %0, i16* %1, i32* %2, i64* %3, float* %4, double* %5) section "fn-$RUSTY$func:i32[pi8][pi16][pi32][pi64][pf32][pf64]" { entry: %func = alloca i32, align 4 %byInt1 = alloca i8*, align 8 @@ -30,7 +30,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %1 = alloca i8, align 1 store i8 1, i8* %1, align 1 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 101a120980..eba1401e34 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,9 +7,9 @@ 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 }, section "var-main_instance:r12i8i8i16i16i32i32i64i64f32f32f64f64" +@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-$RUSTY$main_instance:r12i8i8i16i16i32i32i64i64f32f32f64f64" -define i8 @fn_sint(i8* %0, i8* %1) section "fn-fn_sint:i8[pi8][pi8]" { +define i8 @fn_sint(i8* %0, i8* %1) section "fn-$RUSTY$fn_sint:i8[pi8][pi8]" { entry: %fn_sint = alloca i8, align 1 %in_ref = alloca i8*, align 8 @@ -21,7 +21,7 @@ entry: ret i8 %fn_sint_ret } -define i64 @fn_lint(i64* %0, i64* %1) section "fn-fn_lint:i64[pi64][pi64]" { +define i64 @fn_lint(i64* %0, i64* %1) section "fn-$RUSTY$fn_lint:i64[pi64][pi64]" { entry: %fn_lint = alloca i64, align 8 %in_ref = alloca i64*, align 8 @@ -33,7 +33,7 @@ entry: ret i64 %fn_lint_ret } -define i64 @fn_real(float* %0, float* %1) section "fn-fn_real:i64[pf32][pf32]" { +define i64 @fn_real(float* %0, float* %1) section "fn-$RUSTY$fn_real:i64[pf32][pf32]" { entry: %fn_real = alloca i64, align 8 %in_ref = alloca float*, align 8 @@ -45,7 +45,7 @@ entry: ret i64 %fn_real_ret } -define i64 @fn_lreal(double* %0, double* %1) section "fn-fn_lreal:i64[pf64][pf64]" { +define i64 @fn_lreal(double* %0, double* %1) section "fn-$RUSTY$fn_lreal:i64[pf64][pf64]" { entry: %fn_lreal = alloca i64, align 8 %in_ref = alloca double*, align 8 @@ -57,7 +57,7 @@ entry: ret i64 %fn_lreal_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 b4a5ccef09..dce4f413a1 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,14 +7,14 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" @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" -declare i32 @foo(i32, i8**) section "fn-foo:i32" +declare i32 @foo(i32, i8**) section "fn-$RUSTY$foo:i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %1 = alloca [3 x i8*], align 8 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 7faa691833..d91b7b02ed 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,11 +7,11 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -declare i32 @foo(i32, i32*) section "fn-foo:i32" +declare i32 @foo(i32, i32*) section "fn-$RUSTY$foo:i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 d07d8c348c..1be4fb4117 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,11 +7,11 @@ source_filename = "main" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -declare i32 @foo(...) section "fn-foo:i32" +declare i32 @foo(...) section "fn-$RUSTY$foo:i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 076dfa6aff..2e5636d68b 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,12 +7,12 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @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]" +declare void @func([81 x i8]*, i8*) section "fn-$RUSTY$func:s8u81[ps8u81]" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %res = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap index 87f407e59f..94c6a39e2c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @func(i16 %0, i8* %1, i64* %2) section "fn-func:i32[i16][pi8][pi64]" { +define i32 @func(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$func:i32[i16][pi8][pi64]" { entry: %func = alloca i32, align 4 %i = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap index 1c13b04b7f..770242651b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @bump(i8* %0) section "fn-bump:i32[pi8]" { +define i32 @bump(i8* %0) section "fn-$RUSTY$bump:i32[pi8]" { entry: %bump = alloca i32, align 4 %v = alloca i8*, align 8 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 f5cba9ee45..082aa87611 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,10 +7,10 @@ source_filename = "main" %main = type { [6 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u6" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u6" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) section "fn-func:i32[s8u6]" { +define i32 @func(i8* %0) section "fn-$RUSTY$func:i32[s8u6]" { entry: %func = alloca i32, align 4 %x = alloca [6 x i8], align 1 @@ -22,7 +22,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [6 x i8]* %a to i8* 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 19351d4bdd..1a2b372911 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,10 +7,10 @@ source_filename = "main" %main = type { [6 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u6" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u6" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) section "fn-func:i32[ps8u6]" { +define i32 @func(i8* %0) section "fn-$RUSTY$func:i32[ps8u6]" { entry: %func = alloca i32, align 4 %x = alloca i8*, align 8 @@ -20,7 +20,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [6 x i8]* %a to i8* 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 4d5da158e8..e6cf5dc952 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) section "fn-func:i32[pi16][pi32][i16][i32]" { +define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) section "fn-$RUSTY$func:i32[pi16][pi32][i16][i32]" { entry: %func = alloca i32, align 4 %byRef1 = alloca i16*, align 8 @@ -38,7 +38,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %1 = alloca i16, align 2 store i16 1, i16* %1, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap index 468a05a0d2..1011885324 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap @@ -5,7 +5,7 @@ expression: codegen(src) ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %main_ret } -define i32 @SMC_Read(i64 %0) section "fn-SMC_Read:i32[u64]" { +define i32 @SMC_Read(i64 %0) section "fn-$RUSTY$SMC_Read:i32[u64]" { entry: %SMC_Read = alloca i32, align 4 %ValAddr = alloca i64, align 8 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 dfbd09c0c3..b0d691e261 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,9 +7,9 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define i32 @func(i32 %0) section "fn-func:i32[i32]" { +define i32 @func(i32 %0) section "fn-$RUSTY$func:i32[i32]" { entry: %func = alloca i32, align 4 %x = alloca i32, align 4 @@ -19,7 +19,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %load_a = load i32, i32* %a, align 4 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 0469748b1a..93ce1a318b 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,9 +7,9 @@ source_filename = "main" %main = type { i16 } -@main_instance = global %main { i16 4 }, section "var-main_instance:r1i16" +@main_instance = global %main { i16 4 }, section "var-$RUSTY$main_instance:r1i16" -define i32 @func(i16* %0) section "fn-func:i32[pi16]" { +define i32 @func(i16* %0) section "fn-$RUSTY$func:i32[pi16]" { entry: %func = alloca i32, align 4 %o = alloca i16*, align 8 @@ -22,7 +22,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(i16* %x) 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 156a335211..8c1b8cb6f5 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,9 +7,9 @@ source_filename = "main" %prg = type { float, float, float, double, float, float, float, double } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r10f32f32f32f64f32f32f32f64i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r10f32f32f32f64f32f32f32f64i32i32" -define float @foo__REAL(float %0) section "fn-foo__REAL:f32[f32]" { +define float @foo__REAL(float %0) section "fn-$RUSTY$foo__REAL:f32[f32]" { entry: %foo__REAL = alloca float, align 4 %in1 = alloca float, align 4 @@ -19,7 +19,7 @@ entry: ret float %foo__REAL_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %res_sint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %res_int = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -56,4 +56,4 @@ entry: ret void } -declare double @foo__LREAL(double) section "fn-foo__LREAL:f64[f64]" +declare double @foo__LREAL(double) section "fn-$RUSTY$foo__LREAL:f64[f64]" diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap index fa1248d485..e60815a9c2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap @@ -5,7 +5,7 @@ expression: codegen(src) ; ModuleID = 'main' source_filename = "main" -define double @main() section "fn-main:f64" { +define double @main() section "fn-$RUSTY$main:f64" { entry: %main = alloca double, align 8 store double 0.000000e+00, double* %main, align 8 @@ -25,4 +25,4 @@ entry: ret double %main_ret } -declare double @MAX__LREAL(i32, double*) section "fn-MAX__LREAL:f64" +declare double @MAX__LREAL(i32, double*) section "fn-$RUSTY$MAX__LREAL:f64" 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 9d2a97cdb4..e689ca4ee8 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define i32 @MAX__DINT(i32 %0, i32 %1) section "fn-MAX__DINT:i32[i32][i32]" { +define i32 @MAX__DINT(i32 %0, i32 %1) section "fn-$RUSTY$MAX__DINT:i32[i32][i32]" { entry: %MAX__DINT = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -21,7 +21,7 @@ entry: ret i32 %MAX__DINT_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -32,4 +32,4 @@ entry: ret void } -declare i16 @MAX__INT(i16, i16) section "fn-MAX__INT:i16[i16][i16]" +declare i16 @MAX__INT(i16, i16) section "fn-$RUSTY$MAX__INT:i16[i16][i16]" 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 80ec25a385..800a20c076 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16i16i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16i16i64" -define i16 @foo__INT(i64 %0, i16* %1) section "fn-foo__INT:i16[i64][pi16]" { +define i16 @foo__INT(i64 %0, i16* %1) section "fn-$RUSTY$foo__INT:i16[i64][pi16]" { entry: %foo__INT = alloca i16, align 2 %in1 = alloca i64, align 8 @@ -21,7 +21,7 @@ entry: ret i16 %foo__INT_ret } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %theInt = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %iResult = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 bd9e6010e9..51630a2755 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, section "var-__myStruct__init:r2i32pi16" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r2i32pi16" ; ModuleID = 'prog.st' source_filename = "prog.st" @@ -15,10 +15,10 @@ source_filename = "prog.st" %prog = type { %myStruct.1 } %myStruct.1 = type { i32, i16* } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r2i32pi16" -@__myStruct__init = external global %myStruct.1, section "var-__myStruct__init:r2i32pi16" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1r2i32pi16" +@__myStruct__init = external global %myStruct.1, section "var-$RUSTY$__myStruct__init:r2i32pi16" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 7181b2163f..c988a33004 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,16 +7,16 @@ source_filename = "myStruct.st" %myStruct = type { i32, i16* } -@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null }, section "var-__myStruct__init:r2i32pi16" +@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null }, section "var-$RUSTY$__myStruct__init:r2i32pi16" ; ModuleID = 'prog.st' source_filename = "prog.st" %prog = type { i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1i32" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 a2bf90b85b..dd5914128e 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,9 +10,9 @@ source_filename = "prog.st" %prog = type { i16 } -@prog_instance = global %prog { i16 5 }, section "var-prog_instance:r1i16" +@prog_instance = global %prog { i16 5 }, section "var-$RUSTY$prog_instance:r1i16" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 3bbd7d6b6e..72d74b90c3 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,18 +5,18 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'myEnum.st' source_filename = "myEnum.st" -@myEnum.a = unnamed_addr constant i32 1, section "var-a:e3i32" -@myEnum.b = unnamed_addr constant i32 2, section "var-b:e3i32" -@myEnum.c = unnamed_addr constant i32 3, section "var-c:e3i32" +@myEnum.a = unnamed_addr constant i32 1, section "var-$RUSTY$a:e3i32" +@myEnum.b = unnamed_addr constant i32 2, section "var-$RUSTY$b:e3i32" +@myEnum.c = unnamed_addr constant i32 3, section "var-$RUSTY$c:e3i32" ; ModuleID = 'fb.st' source_filename = "fb.st" %fb = type { i32 } -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r1e3i32" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1e3i32" -define void @fb(%fb* %0) section "fn-fb:v" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void @@ -28,10 +28,10 @@ source_filename = "myStruct.st" %myStruct = type { %fb.2 } %fb.2 = type { i32 } -@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-__myStruct__init:r1r1e3i32" -@__fb__init = external global %fb.2, section "var-__fb__init:r1e3i32" +@__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r1r1e3i32" +@__fb__init = external global %fb.2, section "var-$RUSTY$__fb__init:r1e3i32" -declare void @fb(%fb.2*) section "fn-fb:v" +declare void @fb(%fb.2*) section "fn-$RUSTY$fb:v" ; ModuleID = 'fb2.st' source_filename = "fb2.st" @@ -40,26 +40,26 @@ source_filename = "fb2.st" %myStruct.4 = type { %fb.5 } %fb.5 = type { i32 } -@__fb2__init = unnamed_addr constant %fb2 zeroinitializer, section "var-__fb2__init:r1r1r1e3i32" -@__myStruct__init = external global %myStruct.4, section "var-__myStruct__init:r1r1e3i32" -@__fb__init = external global %fb.5, section "var-__fb__init:r1e3i32" +@__fb2__init = unnamed_addr constant %fb2 zeroinitializer, section "var-$RUSTY$__fb2__init:r1r1r1e3i32" +@__myStruct__init = external global %myStruct.4, section "var-$RUSTY$__myStruct__init:r1r1e3i32" +@__fb__init = external global %fb.5, section "var-$RUSTY$__fb__init:r1e3i32" -define void @fb2(%fb2* %0) section "fn-fb2:v" { +define void @fb2(%fb2* %0) section "fn-$RUSTY$fb2:v" { entry: %x = getelementptr inbounds %fb2, %fb2* %0, i32 0, i32 0 ret void } -declare void @fb(%fb.5*) section "fn-fb:v" +declare void @fb(%fb.5*) section "fn-$RUSTY$fb:v" ; ModuleID = 'fb3.st' source_filename = "fb3.st" %fb3 = type {} -@__fb3__init = unnamed_addr constant %fb3 zeroinitializer, section "var-__fb3__init:r0" +@__fb3__init = unnamed_addr constant %fb3 zeroinitializer, section "var-$RUSTY$__fb3__init:r0" -define void @fb3(%fb3* %0) section "fn-fb3:v" { +define void @fb3(%fb3* %0) section "fn-$RUSTY$fb3:v" { entry: ret void } 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 375a6aa974..f0db85384b 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 @@ -5,7 +5,7 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'func.st' source_filename = "func.st" -define i32 @func() section "fn-func:i32" { +define i32 @func() section "fn-$RUSTY$func:i32" { entry: %func = alloca i32, align 4 store i32 0, i32* %func, align 4 @@ -18,9 +18,9 @@ source_filename = "fb.st" %fb = type {} -@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-__fb__init:r0" +@__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r0" -define void @fb(%fb* %0) section "fn-fb:v" { +define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { entry: ret void } @@ -30,9 +30,9 @@ source_filename = "prg.st" %prg = type { i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void @@ -43,9 +43,9 @@ source_filename = "prg2.st" %prg2 = type { i32 } -@prg2_instance = global %prg2 zeroinitializer, section "var-prg2_instance:r1i32" +@prg2_instance = global %prg2 zeroinitializer, section "var-$RUSTY$prg2_instance:r1i32" -define void @prg2(%prg2* %0) section "fn-prg2:v" { +define void @prg2(%prg2* %0) section "fn-$RUSTY$prg2:v" { entry: %b = getelementptr inbounds %prg2, %prg2* %0, i32 0, i32 0 ret void @@ -59,12 +59,12 @@ source_filename = "prog.st" %prg.5 = type { i32 } %prg2.6 = type { i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r1r0" -@__fb__init = external global %fb.4, section "var-__fb__init:r0" -@prg_instance = external global %prg.5, section "var-prg_instance:r1i32" -@prg2_instance = external global %prg2.6, section "var-prg2_instance:r1i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1r0" +@__fb__init = external global %fb.4, section "var-$RUSTY$__fb__init:r0" +@prg_instance = external global %prg.5, section "var-$RUSTY$prg_instance:r1i32" +@prg2_instance = external global %prg2.6, section "var-$RUSTY$prg2_instance:r1i32" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %myFb = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %load_a = load i32, i32* getelementptr inbounds (%prg.5, %prg.5* @prg_instance, i32 0, i32 0), align 4 @@ -74,10 +74,10 @@ entry: ret void } -declare void @fb(%fb.4*) section "fn-fb:v" +declare void @fb(%fb.4*) section "fn-$RUSTY$fb:v" -declare void @prg(%prg.5*) section "fn-prg:v" +declare void @prg(%prg.5*) section "fn-$RUSTY$prg:v" -declare void @prg2(%prg2.6*) section "fn-prg2:v" +declare void @prg2(%prg2.6*) section "fn-$RUSTY$prg2:v" -declare i32 @func() section "fn-func:i32" +declare i32 @func() section "fn-$RUSTY$func:i32" 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 b1505566c4..1bc2997856 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,28 +5,28 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'g1.st' source_filename = "g1.st" -@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" +@x = global i32 6, section "var-$RUSTY$x:i32" +@d = external global i32, section "var-$RUSTY$d:i32" +@y = global i32 7, section "var-$RUSTY$y:i32" +@e = external global i32, section "var-$RUSTY$e:i32" ; ModuleID = 'g2.st' source_filename = "g2.st" -@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" +@c = unnamed_addr constant i32 5, section "var-$RUSTY$c:i32" +@d = unnamed_addr constant i32 6, section "var-$RUSTY$d:i32" +@e = unnamed_addr constant i32 7, section "var-$RUSTY$e:i32" ; ModuleID = 'prog.st' source_filename = "prog.st" %prog = type {} -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r0" -@c = external global i32, section "var-c:i32" -@x = external global i32, section "var-x:i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r0" +@c = external global i32, section "var-$RUSTY$c:i32" +@x = external global i32, section "var-$RUSTY$x:i32" -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: store i32 7, i32* @x, align 4 ret void 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 7290eddb92..722b4754f8 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 }, section "var-__myStruct__init:r2i32i16" +@__myStruct__init = unnamed_addr constant %myStruct { i32 6, i16 2 }, section "var-$RUSTY$__myStruct__init:r2i32i16" ; ModuleID = 'myStruct2.st' source_filename = "myStruct2.st" %myStruct2 = type { i32, i16 } -@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 }, section "var-__myStruct2__init:r2i32i16" +@__myStruct2__init = unnamed_addr constant %myStruct2 { i32 6, i16 2 }, section "var-$RUSTY$__myStruct2__init:r2i32i16" ; ModuleID = 'prog.st' source_filename = "prog.st" @@ -23,12 +23,12 @@ 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 } }, section "var-prog_instance:r2r2i32i16r2i32i16" -@__myStruct__init = external global %myStruct.2, section "var-__myStruct__init:r2i32i16" -@__myStruct2__init = external global %myStruct2.3, section "var-__myStruct2__init:r2i32i16" +@prog_instance = global %prog { %myStruct.2 { i32 5, i16 2 }, %myStruct2.3 { i32 6, i16 2 } }, section "var-$RUSTY$prog_instance:r2r2i32i16r2i32i16" +@__myStruct__init = external global %myStruct.2, section "var-$RUSTY$__myStruct__init:r2i32i16" +@__myStruct2__init = external global %myStruct2.3, section "var-$RUSTY$__myStruct2__init:r2i32i16" @__prog.x__init = unnamed_addr constant %myStruct.2 { i32 5, i16 2 } -define void @prog(%prog* %0) section "fn-prog:v" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %y = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 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 3f8ee5cafc..c9a5612cc4 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,17 +8,17 @@ source_filename = "main" %fb_t = type { i32, i32 } %main = type { %fb_t } -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r2i32i32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1r2i32i32" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r2i32i32" -define void @fb_t(%fb_t* %0) section "fn-fb_t:v[i32][i32]" { +define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[i32][i32]" { entry: %in1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %in2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 0 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 bf9e60e0bd..21a90da4c6 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,17 +8,17 @@ source_filename = "main" %fb_t = type { i32, i32 } %main = type { %fb_t, i32 } -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r2i32i32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r2r2i32i32i32" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2r2i32i32i32" -define void @fb_t(%fb_t* %0) section "fn-fb_t:v[i32][i32]" { +define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[i32][i32]" { entry: %out1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %out2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6b43aada59..c09ca8415a 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,9 +7,9 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @foo(i32 %0, i32 %1) section "fn-foo:v[i32][i32]" { +define void @foo(i32 %0, i32 %1) section "fn-$RUSTY$foo:v[i32][i32]" { entry: %in1 = alloca i32, align 4 store i32 %0, i32* %in1, align 4 @@ -18,7 +18,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %1 = alloca i32, align 4 %2 = load i32, i32* %1, align 4 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 98e324b2f2..77bd210568 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,9 +7,9 @@ source_filename = "main" %main = type { i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define void @foo(i32* %0, i32* %1) section "fn-foo:v[pi32][pi32]" { +define void @foo(i32* %0, i32* %1) section "fn-$RUSTY$foo:v[pi32][pi32]" { entry: %out1 = alloca i32*, align 8 store i32* %0, i32** %out1, align 8 @@ -18,7 +18,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca i32, align 4 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 bb8ff92a05..7f1397cbf1 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6d5db97967..1ab6960d56 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) section "fn-foo:i32[i32][pi32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) section "fn-$RUSTY$foo:i32[i32][pi32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -25,7 +25,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 d1a5e70923..ce8d64e4d1 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 63c5532e99..1f61d44c22 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 50aab291b4..4d4a407879 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6c826b2e29..ef1bc54697 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 d1a5e70923..ce8d64e4d1 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 63c5532e99..1f61d44c22 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 c209f084d0..81994a1570 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 50aab291b4..4d4a407879 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6c826b2e29..ef1bc54697 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,9 +7,9 @@ source_filename = "main" %main = type { i32, i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 f213af0c9f..997d928597 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,10 +8,10 @@ source_filename = "main" %main = type { %file_t, %file_t* } %file_t = type { i8, i8 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2r2u8u8pr2u8u8" -@__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-__file_t__init:r2u8u8" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2r2u8u8pr2u8u8" +@__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-$RUSTY$__file_t__init:r2u8u8" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %file = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %FileOpen = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -23,7 +23,7 @@ entry: ret void } -define void @file_t(%file_t* %0) section "fn-file_t:v[u8][u8]" { +define void @file_t(%file_t* %0) section "fn-$RUSTY$file_t:v[u8][u8]" { entry: %var1 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 0 %var2 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 1 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 25645a131f..461ca281a0 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,17 +8,17 @@ source_filename = "main" %prog = type { i32, i32 } %main = type {} -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2i32i32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r0" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32]" { entry: %in1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %in2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: store i32 1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 call void @prog(%prog* @prog_instance) 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 7b1a478347..72fae89445 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32 } %main = type { i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2i32i32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2i32i32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32]" { entry: %out1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %out2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -20,7 +20,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 call void @prog(%prog* @prog_instance) 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 f6e4b5c8ef..d4904984ee 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 69ced22379..aadcc395cc 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 99127cc833..633ef5775a 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6ba1817e97..7b3e689396 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 5e5a0c59bd..296ca297db 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,10 +8,10 @@ source_filename = "main" %prog = type { i32, i32, i32* } %main = type { i32, i32, i32 } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r3i32i32pi32" -@main_instance = global %main zeroinitializer, section "var-main_instance:r3i32i32i32" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 6c8ea69008..56d71b38e2 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,10 +8,10 @@ source_filename = "main" %mainProg = type { %fb_t, i8, i8 } %fb_t = type { i8, i8, i8*, i8, i8* } -@mainProg_instance = global %mainProg zeroinitializer, section "var-mainProg_instance:r3r5u8u8pu8u8pu8u8u8" -@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-__fb_t__init:r5u8u8pu8u8pu8" +@mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r3r5u8u8pu8u8pu8u8u8" +@__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r5u8u8pu8u8pu8" -define void @mainProg(%mainProg* %0) section "fn-mainProg:v" { +define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { entry: %fb = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 %out1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 1 @@ -35,7 +35,7 @@ entry: ret void } -define void @fb_t(%fb_t* %0) section "fn-fb_t:v[u8][pu8][u8][pu8]" { +define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[u8][pu8][u8][pu8]" { entry: %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 @@ -45,7 +45,7 @@ entry: ret void } -define void @fb_t.foo(%fb_t* %0) section "fn-fb_t.foo:v" { +define void @fb_t.foo(%fb_t* %0) section "fn-$RUSTY$fb_t.foo:v" { entry: %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 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 a5c7408fcf..e9e2500aab 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e08cd1363f..867df6704b 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8u32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 87438a209a..b3afe4628d 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u32u64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u32u64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap index a95abc87da..1f93b11da8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @fn() section "fn-fn:i32" { +define i32 @fn() section "fn-$RUSTY$fn:i32" { entry: %fn = alloca i32, align 4 %a = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap index 36383987b3..8932121af1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap @@ -5,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-CONCAT:s8u1025[s8u1025][s8u1025]" +declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-$RUSTY$CONCAT:s8u1025[s8u1025][s8u1025]" -define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-LIST_ADD:u8[s8u1001][s8u2]" { +define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-$RUSTY$LIST_ADD:u8[s8u1001][s8u2]" { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap index 36383987b3..8932121af1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap @@ -5,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-CONCAT:s8u1025[s8u1025][s8u1025]" +declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-$RUSTY$CONCAT:s8u1025[s8u1025][s8u1025]" -define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-LIST_ADD:u8[s8u1001][s8u2]" { +define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-$RUSTY$LIST_ADD:u8[s8u1001][s8u2]" { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 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 aa5bbd223a..2169794163 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8u64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 2bd94429d0..ff8e6e1eff 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8, i16, i16 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r4u8u8i16i16" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4u8u8i16i16" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 8a7461c178..52722c634f 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u16u32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u16u32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 36c0cb1a3f..9acdab89c7 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,11 +7,11 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u81s16u81" @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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 81ea3ef0ec..29fa2da807 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,10 +7,10 @@ source_filename = "main" %main = type { [61 x i8], [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u61s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2s8u61s8u81" @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]" { +define void @MID__STRING([81 x i8]* %0, i8* %1, i32 %2, i32 %3) section "fn-$RUSTY$MID__STRING:s8u81[ps8u81][i32][i32]" { entry: %MID__STRING = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %MID__STRING, align 8 @@ -29,7 +29,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v[s8u61][s8u81]" { +define void @main(%main* %0) section "fn-$RUSTY$main:v[s8u61][s8u81]" { entry: %fmt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 3158219458..bdc1540913 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,10 +7,10 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" -define void @ret([81 x i8]* %0) section "fn-ret:s8u81" { +define void @ret([81 x i8]* %0) section "fn-$RUSTY$ret:s8u81" { entry: %ret = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %ret, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 535b73c274..385f0cc470 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,10 +7,10 @@ source_filename = "main" %main = type { [81 x i8] } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1s8u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @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]" { +define void @read_string([81 x i8]* %0, i8* %1) section "fn-$RUSTY$read_string:s8u81[s8u81]" { entry: %read_string = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %read_string, align 8 @@ -28,7 +28,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %text1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index c4e8c10585..9e9c351040 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -10,7 +10,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"#\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"*\00" -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 e48fa4fca0..e9a7ca8dc5 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,5 +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"] }, section "var-x:r7i16i16as8u11as8u3as8u11as8u4as8u4" -@__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:r7i16i16as8u11as8u3as8u11as8u4as8u4" +@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-$RUSTY$x:r7i16i16as8u11as8u3as8u11as8u4as8u4" +@__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-$RUSTY$__CONSTANTS_LANGUAGE__init:r7i16i16as8u11as8u3as8u11as8u4as8u4" 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 0745dd2a53..3968ed4306 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,12 +8,12 @@ source_filename = "main" %prog = type { [81 x i8], [81 x i16] } %main = type { [7 x i8], [8 x i16] } -@prog_instance = global %prog zeroinitializer, section "var-prog_instance:r2s8u81s16u81" -@main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u7s16u8" +@prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2s8u81s16u81" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2s8u7s16u8" @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] -define void @prog(%prog* %0) section "fn-prog:v[s8u81][s16u81]" { +define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[s8u81][s16u81]" { entry: %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -24,7 +24,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 bafe2c9a54..3f2af07b08 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,13 +7,13 @@ source_filename = "main" %prg = type { [81 x i8], [81 x i16] } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u81s16u81" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u81s16u81" @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] @utf16_literal_1 = 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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 be13625db7..73237fe8e0 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,14 +7,14 @@ 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] }, section "var-prg_instance:r3s8u81s8u100s16u100" -@__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" +@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-$RUSTY$prg_instance:r3s8u81s8u100s16u100" +@__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-$RUSTY$__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-$RUSTY$__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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ecc1a0ba4b..942e6e4807 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 @@ -5,5 +5,5 @@ expression: result ; ModuleID = 'main' source_filename = "main" -@str = global [21 x i8] zeroinitializer, section "var-str:s8u21" -@wstr = global [21 x i16] zeroinitializer, section "var-wstr:s16u21" +@str = global [21 x i8] zeroinitializer, section "var-$RUSTY$str:s8u21" +@wstr = global [21 x i16] zeroinitializer, section "var-$RUSTY$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 e34aaf4ee2..763d82a4f8 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,11 +7,11 @@ 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 }, section "var-prg_instance:r2s8u11s8u81" +@prg_instance = global %prg { [11 x i8] c"hello\00\00\00\00\00\00", [81 x i8] zeroinitializer }, section "var-$RUSTY$prg_instance:r2s8u11s8u81" @__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" -define i16 @foo(i8* %0) section "fn-foo:i16[s8u81]" { +define i16 @foo(i8* %0) section "fn-$RUSTY$foo:i16[s8u81]" { entry: %foo = alloca i16, align 2 %s = alloca [81 x i8], align 1 @@ -27,7 +27,7 @@ buffer_block: ; No predecessors! ret i16 %foo_ret1 } -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index f259984e72..b12538dbe8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -8,7 +8,7 @@ source_filename = "main" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[ps8u1025][ps8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[ps8u1025][ps8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca i8*, align 8 @@ -20,7 +20,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index 304fc17870..e9582efb1b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -8,7 +8,7 @@ source_filename = "main" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 001dbe34cc..f8a29a88a0 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,13 +7,13 @@ 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] }, section "var-prg_instance:r4s8u16s8u4s16u16s16u4" +@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-$RUSTY$prg_instance:r4s8u16s8u4s16u16s16u4" @__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" @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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e08a85e5a0..c66d927edb 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,15 +7,15 @@ source_filename = "main" %prg = type { [16 x i8], [4 x i8], [31 x i16], [7 x i16] } -@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:r4vvvv" +@LONG_STRING = unnamed_addr constant i16 15, section "var-$RUSTY$LONG_STRING:i16" +@SHORT_STRING = unnamed_addr constant i16 3, section "var-$RUSTY$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-$RUSTY$prg_instance:r4vvvv" @__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" @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] -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 9be88378c4..160ce6ed30 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,10 +7,10 @@ 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" }, section "var-prg_instance:r2s8u16s8u31" +@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-$RUSTY$prg_instance:r2s8u16s8u31" @__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" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a24052d74f..b18d8db47c 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,10 +7,10 @@ source_filename = "main" %prg = type {} -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u16s8u31" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u16s8u31" @__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" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %y = alloca [16 x i8], align 1 %z = alloca [31 x i8], align 1 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 e1aee8df9b..c5e96b18bd 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 09078036db..aeb30559df 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,9 +7,9 @@ source_filename = "main" %prg = type { i32, i64, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i32i64i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i32i64i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a286e68b10..9217183a40 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a879767657..be13838b66 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i8, i8 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i8i8i8" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i8i8" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 2a3bf60b05..3645170b4a 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,9 +7,9 @@ source_filename = "main" %prg = type { float, double, double } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32f64f64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32f64f64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 4d67d6bda4..1cc04585f9 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16u16f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16u16f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 5096cda6dc..6f9cd627e6 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,9 +7,9 @@ source_filename = "main" %prg = type { float, double } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32f64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ff04806a83..a0d78252fe 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,9 +7,9 @@ source_filename = "main" %prg = type { i16, i16, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i16u16f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16u16f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 50cc461748..41368ecbee 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2u8i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 3cc9f39a88..5e02bd0f58 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,9 +7,9 @@ source_filename = "main" %prg = type { float, i64 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2f32i64" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32i64" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e63cd784fc..abcb8aca8a 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,9 +7,9 @@ source_filename = "main" %prg = type { float, i16, float } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3f32i16f32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32i16f32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a4e6979224..a6c9934fbf 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,12 +7,12 @@ source_filename = "main" %main = type {} -@main_instance = global %main zeroinitializer, section "var-main_instance:r4s8u81f32f64i16" +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4s8u81f32f64i16" @__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]" +declare i32 @printf(i8*, ...) section "fn-$RUSTY$printf:i32[ps8u81]" -define void @main(%main* %0) section "fn-main:v" { +define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %s = alloca [81 x i8], align 1 %float = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap index 6c986be051..367285edf7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap @@ -8,9 +8,9 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [26 x i8] c"(d) result : %d %d %d %u\0A\00" @utf08_literal_1 = private unnamed_addr constant [27 x i8] c"(hd) result : %hd %hd %hd\0A\00" -declare i32 @printf(i8*, ...) section "fn-printf:i32[ps8u81]" +declare i32 @printf(i8*, ...) section "fn-$RUSTY$printf:i32[ps8u81]" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %out1 = alloca i16, align 2 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 0aad22f5c3..f7c53cabc4 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,9 +7,9 @@ source_filename = "main" %prg = type { i8, i32, i32 } -@prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3u8i32i32" +@prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8i32i32" -define void @prg(%prg* %0) section "fn-prg:v" { +define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 674b5c1710..7517e8f819 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -57,7 +57,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %arr = alloca [60 x i16], align 2 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 55013f1237..188e363617 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,10 +7,10 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@arr = global [2 x i16] zeroinitializer, section "var-arr:ai16" -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" +@arr = global [2 x i16] zeroinitializer, section "var-$RUSTY$arr:ai16" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -32,7 +32,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 store i32 0, i32* %main, align 4 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 637a64fd7a..d7cf5af6d3 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define void @foo(%__foo_vla* %0) section "fn-foo:v[r2pai16ai32]" { +define void @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:v[r2pai16ai32]" { entry: %vla = alloca %__foo_vla, align 8 %1 = bitcast %__foo_vla* %vla to i8* @@ -18,7 +18,7 @@ entry: ret void } -define void @bar() section "fn-bar:v" { +define void @bar() section "fn-$RUSTY$bar:v" { entry: %arr = alloca [2 x i16], align 2 %0 = bitcast [2 x i16]* %arr to i8* 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 2d020fa3cd..2d4e774ca8 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [4 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -57,7 +57,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %arr = alloca [20 x i16], align 2 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 d0798dcfc1..8ec1aaee73 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,9 +7,9 @@ source_filename = "main" %__foo_vla = type { i16*, [2 x i32] } -@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-____foo_vla__init:r2pai16ai32" +@____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -32,7 +32,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 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 53c5fe5437..eb2eab72b7 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, section "var-me:e3i32" -@THREE = unnamed_addr constant i16 3, section "var-THREE:i16" -@MyEnum.a = unnamed_addr constant i32 3, section "var-a:e3i32" -@MyEnum.b = unnamed_addr constant i32 4, section "var-b:e3i32" -@MyEnum.c = unnamed_addr constant i32 5, section "var-c:e3i32" +@me = unnamed_addr constant i32 3, section "var-$RUSTY$me:e3i32" +@THREE = unnamed_addr constant i16 3, section "var-$RUSTY$THREE:i16" +@MyEnum.a = unnamed_addr constant i32 3, section "var-$RUSTY$a:e3i32" +@MyEnum.b = unnamed_addr constant i32 4, section "var-$RUSTY$b:e3i32" +@MyEnum.c = unnamed_addr constant i32 5, section "var-$RUSTY$c:e3i32" 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 7babccc22d..15c2095dad 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, 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:e3i32" -@myEnum.a = unnamed_addr constant i32 0, section "var-a:e3i32" -@myEnum.b = unnamed_addr constant i32 1, section "var-b:e3i32" -@myEnum.c = unnamed_addr constant i32 2, section "var-c:e3i32" +@false_bool = unnamed_addr constant i8 0, section "var-$RUSTY$false_bool:u8" +@zero_int = unnamed_addr constant i16 0, section "var-$RUSTY$zero_int:i16" +@zero_real = unnamed_addr constant double 0.000000e+00, section "var-$RUSTY$zero_real:f64" +@empty_string = unnamed_addr constant [81 x i8] zeroinitializer, section "var-$RUSTY$empty_string:s8u81" +@null_ptr = unnamed_addr constant i16* null, section "var-$RUSTY$null_ptr:pi16" +@zero_enum = unnamed_addr constant i32 0, section "var-$RUSTY$zero_enum:e3i32" +@myEnum.a = unnamed_addr constant i32 0, section "var-$RUSTY$a:e3i32" +@myEnum.b = unnamed_addr constant i32 1, section "var-$RUSTY$b:e3i32" +@myEnum.c = unnamed_addr constant i32 2, section "var-$RUSTY$c:e3i32" 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 d1091674cf..810a15dd21 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,8 +5,8 @@ expression: src ; ModuleID = 'main' source_filename = "main" -@a = global i16 7, section "var-a:i16" -@b = global i16 7, section "var-b:i16" -@aa = unnamed_addr constant i16 7, section "var-aa:i16" -@bb = unnamed_addr constant i16 7, section "var-bb:i16" -@cc = unnamed_addr constant i16 14, section "var-cc:i16" +@a = global i16 7, section "var-$RUSTY$a:i16" +@b = global i16 7, section "var-$RUSTY$b:i16" +@aa = unnamed_addr constant i16 7, section "var-$RUSTY$aa:i16" +@bb = unnamed_addr constant i16 7, section "var-$RUSTY$bb:i16" +@cc = unnamed_addr constant i16 14, section "var-$RUSTY$cc:i16" diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index 1ecf6498f0..e5a95bcc6b 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, section "var-d:ai32" + @d = global [10 x i32] zeroinitializer, section "var-$RUSTY$d:ai32" "###); } @@ -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], section "var-d:ai32" - @__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:ai32" + @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-$RUSTY$d:ai32" + @__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-$RUSTY$__Data__init:ai32" "###); } @@ -70,10 +70,10 @@ 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] }, section "var-prg_instance:r2ai32ai32" - @__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:ai32" + @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-$RUSTY$prg_instance:r2ai32ai32" + @__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-$RUSTY$__Data__init:ai32" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -122,11 +122,11 @@ 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] }, section "var-prg_instance:r2ai32ai32" - @__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:ai32" + @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-$RUSTY$prg_instance:r2ai32ai32" + @__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-$RUSTY$__Data__init:ai32" @__prg.b__init = unnamed_addr constant [3 x i32] [i32 3, i32 4, i32 5] - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/enum_adr.rs b/src/tests/adr/enum_adr.rs index e98713a338..aa7af6da0f 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, section "var-myColor:e3i32" - @Color.red = unnamed_addr constant i32 0, section "var-red:e3i32" - @Color.yellow = unnamed_addr constant i32 1, section "var-yellow:e3i32" - @Color.green = unnamed_addr constant i32 2, section "var-green:e3i32" + @myColor = global i32 0, section "var-$RUSTY$myColor:e3i32" + @Color.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" + @Color.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" + @Color.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" "###); } @@ -52,16 +52,16 @@ fn enums_constants_are_automatically_numbered_or_user_defined() { ; ModuleID = 'main' source_filename = "main" - @myColor = global i32 0, section "var-myColor:e4i32" - @myState = global i8 0, section "var-myState:e4u8" - @Color.red = unnamed_addr constant i32 1, section "var-red:e4i32" - @Color.yellow = unnamed_addr constant i32 2, section "var-yellow:e4i32" - @Color.green = unnamed_addr constant i32 4, section "var-green:e4i32" - @Color.blue = unnamed_addr constant i32 8, section "var-blue:e4i32" - @State.open = unnamed_addr constant i8 1, section "var-open:e4u8" - @State.closed = unnamed_addr constant i8 4, section "var-closed:e4u8" - @State.idle = unnamed_addr constant i8 5, section "var-idle:e4u8" - @State.running = unnamed_addr constant i8 6, section "var-running:e4u8" + @myColor = global i32 0, section "var-$RUSTY$myColor:e4i32" + @myState = global i8 0, section "var-$RUSTY$myState:e4u8" + @Color.red = unnamed_addr constant i32 1, section "var-$RUSTY$red:e4i32" + @Color.yellow = unnamed_addr constant i32 2, section "var-$RUSTY$yellow:e4i32" + @Color.green = unnamed_addr constant i32 4, section "var-$RUSTY$green:e4i32" + @Color.blue = unnamed_addr constant i32 8, section "var-$RUSTY$blue:e4i32" + @State.open = unnamed_addr constant i8 1, section "var-$RUSTY$open:e4u8" + @State.closed = unnamed_addr constant i8 4, section "var-$RUSTY$closed:e4u8" + @State.idle = unnamed_addr constant i8 5, section "var-$RUSTY$idle:e4u8" + @State.running = unnamed_addr constant i8 6, section "var-$RUSTY$running:e4u8" "###); } @@ -80,14 +80,14 @@ fn inline_declaration_of_enum_types() { ; ModuleID = 'main' source_filename = "main" - @frontColor = global i32 0, section "var-frontColor:e3i32" - @backColor = global i32 0, section "var-backColor:e3i32" - @__global_frontColor.red = unnamed_addr constant i32 0, section "var-red:e3i32" - @__global_frontColor.green = unnamed_addr constant i32 1, section "var-green:e3i32" - @__global_frontColor.yellow = unnamed_addr constant i32 2, section "var-yellow:e3i32" - @__global_backColor.red = unnamed_addr constant i32 0, section "var-red:e3i32" - @__global_backColor.green = unnamed_addr constant i32 1, section "var-green:e3i32" - @__global_backColor.yellow = unnamed_addr constant i32 2, section "var-yellow:e3i32" + @frontColor = global i32 0, section "var-$RUSTY$frontColor:e3i32" + @backColor = global i32 0, section "var-$RUSTY$backColor:e3i32" + @__global_frontColor.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" + @__global_frontColor.green = unnamed_addr constant i32 1, section "var-$RUSTY$green:e3i32" + @__global_frontColor.yellow = unnamed_addr constant i32 2, section "var-$RUSTY$yellow:e3i32" + @__global_backColor.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" + @__global_backColor.green = unnamed_addr constant i32 1, section "var-$RUSTY$green:e3i32" + @__global_backColor.yellow = unnamed_addr constant i32 2, section "var-$RUSTY$yellow:e3i32" "###); } @@ -121,15 +121,15 @@ fn using_enums() { %prg = type { i32, i32, i32 } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r3i32i32i32" - @ProcessState.open = unnamed_addr constant i32 1, section "var-open:e4i32" - @ProcessState.closed = unnamed_addr constant i32 4, section "var-closed:e4i32" - @ProcessState.idle = unnamed_addr constant i32 5, section "var-idle:e4i32" - @ProcessState.running = unnamed_addr constant i32 6, section "var-running:e4i32" - @Door.open = unnamed_addr constant i32 8, section "var-open:e2i32" - @Door.closed = unnamed_addr constant i32 16, section "var-closed:e2i32" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i32i32i32" + @ProcessState.open = unnamed_addr constant i32 1, section "var-$RUSTY$open:e4i32" + @ProcessState.closed = unnamed_addr constant i32 4, section "var-$RUSTY$closed:e4i32" + @ProcessState.idle = unnamed_addr constant i32 5, section "var-$RUSTY$idle:e4i32" + @ProcessState.running = unnamed_addr constant i32 6, section "var-$RUSTY$running:e4i32" + @Door.open = unnamed_addr constant i32 8, section "var-$RUSTY$open:e2i32" + @Door.closed = unnamed_addr constant i32 16, section "var-$RUSTY$closed:e2i32" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index 9f9bcbaab4..2fbde24ad6 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -233,9 +233,9 @@ fn codegen_of_a_program_pou() { %main_prg = type { i16, i16*, i16, i16 } - @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:r5i16pi16i16i16i16" + @main_prg_instance = global %main_prg zeroinitializer, section "var-$RUSTY$main_prg_instance:r5i16pi16i16i16i16" - define void @main_prg(%main_prg* %0) section "fn-main_prg:v[i16][pi16][i16]" { + define void @main_prg(%main_prg* %0) section "fn-$RUSTY$main_prg:v[i16][pi16][i16]" { entry: %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 @@ -271,9 +271,9 @@ fn calling_a_program() { %main_prg = type { i16, i16*, i16, i16 } - @main_prg_instance = global %main_prg zeroinitializer, section "var-main_prg_instance:r5i16pi16i16i16i16" + @main_prg_instance = global %main_prg zeroinitializer, section "var-$RUSTY$main_prg_instance:r5i16pi16i16i16i16" - define i16 @foo() section "fn-foo:i16" { + define i16 @foo() section "fn-$RUSTY$foo:i16" { entry: %foo = alloca i16, align 2 %x = alloca i16, align 2 @@ -290,7 +290,7 @@ fn calling_a_program() { ret i16 %foo_ret } - define void @main_prg(%main_prg* %0) section "fn-main_prg:v[i16][pi16][i16]" { + define void @main_prg(%main_prg* %0) section "fn-$RUSTY$main_prg:v[i16][pi16][i16]" { entry: %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 @@ -335,9 +335,9 @@ 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 }, section "var-__main_fb__init:r5i16pi16i16i16i16" + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-$RUSTY$__main_fb__init:r5i16pi16i16i16i16" - define void @main_fb(%main_fb* %0) section "fn-main_fb:v[i16][pi16][i16]" { + define void @main_fb(%main_fb* %0) section "fn-$RUSTY$main_fb:v[i16][pi16][i16]" { entry: %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 @@ -375,10 +375,10 @@ 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 } }, section "var-foo_instance:r3i16i16r5i16pi16i16i16i16" - @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-__main_fb__init:r5i16pi16i16i16i16" + @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } }, section "var-$RUSTY$foo_instance:r3i16i16r5i16pi16i16i16i16" + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-$RUSTY$__main_fb__init:r5i16pi16i16i16i16" - define void @foo(%foo* %0) section "fn-foo:v" { + define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 @@ -394,7 +394,7 @@ fn calling_a_function_block() { ret void } - define void @main_fb(%main_fb* %0) section "fn-main_fb:v[i16][pi16][i16]" { + define void @main_fb(%main_fb* %0) section "fn-$RUSTY$main_fb:v[i16][pi16][i16]" { entry: %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 @@ -431,7 +431,7 @@ fn function_get_a_method_with_by_ref_parameters() { ; ModuleID = 'main' source_filename = "main" - define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-main_fun:i32[i16][pi8][pi64]" { + define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$main_fun:i32[i16][pi8][pi64]" { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 @@ -475,9 +475,9 @@ fn calling_a_function() { %prg = type { i16, i8 } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2i16i8" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i8" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -487,7 +487,7 @@ fn calling_a_function() { ret void } - define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-main_fun:i32[i16][pi8][pi64]" { + define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$main_fun:i32[i16][pi8][pi64]" { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 @@ -537,10 +537,10 @@ fn return_a_complex_type_from_function() { %prg = type { [81 x i8] } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r1s8u81" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1s8u81" @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" { + define void @foo([81 x i8]* %0) section "fn-$RUSTY$foo:s8u81" { entry: %foo = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %foo, align 8 @@ -553,7 +553,7 @@ fn return_a_complex_type_from_function() { ret void } - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 @@ -620,10 +620,10 @@ 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, section "var-__myStruct__init:r4i32i32i32s8u81" - @main_instance = global %main zeroinitializer, section "var-main_instance:r4s8u81s16u81ai32r4i32i32i32s8u81" + @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r4i32i32i32s8u81" + @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4s8u81s16u81ai32r4i32i32i32s8u81" - define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-foo:v[s8u81][s16u81][ai32][r4i32i32i32s8u81]" { + define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-$RUSTY$foo:v[s8u81][s16u81][ai32][r4i32i32i32s8u81]" { entry: %s = alloca [81 x i8], align 1 %bitcast = bitcast [81 x i8]* %s to i8* @@ -648,7 +648,7 @@ fn passing_aggregate_types_to_functions_by_value() { ret void } - define void @main(%main* %0) section "fn-main:v" { + define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %string1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %string2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -705,9 +705,9 @@ fn passing_by_ref_to_functions() { %main = type { [81 x i8], [81 x i8] } - @main_instance = global %main zeroinitializer, section "var-main_instance:r2s8u81s8u81" + @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2s8u81s8u81" - define i8 @StrEqual(i8* %0, i8* %1) section "fn-StrEqual:u8[ps8u81][ps8u81]" { + define i8 @StrEqual(i8* %0, i8* %1) section "fn-$RUSTY$StrEqual:u8[ps8u81][ps8u81]" { entry: %StrEqual = alloca i8, align 1 %o1 = alloca i8*, align 8 @@ -719,7 +719,7 @@ fn passing_by_ref_to_functions() { ret i8 %StrEqual_ret } - define void @main(%main* %0) section "fn-main:v" { + define void @main(%main* %0) section "fn-$RUSTY$main:v" { entry: %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %str2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index e723c446bd..33dc2b22d2 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, section "var-myUtf8:s8u21" - @myUtf16 = global [21 x i16] zeroinitializer, section "var-myUtf16:s16u21" + @myUtf8 = global [21 x i8] zeroinitializer, section "var-$RUSTY$myUtf8:s8u21" + @myUtf16 = global [21 x i16] zeroinitializer, section "var-$RUSTY$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", 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" + @myUtf8 = global [6 x i8] c"Hello\00", section "var-$RUSTY$myUtf8:s8u6" + @myUtf16 = global [6 x i16] [i16 87, i16 111, i16 114, i16 108, i16 100, i16 0], section "var-$RUSTY$myUtf16:s16u6" "###); } @@ -68,9 +68,9 @@ fn assigning_strings() { %prg = type { [11 x i8], [11 x i8] } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u11s8u11" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u11s8u11" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -109,11 +109,11 @@ fn assigning_string_literals() { %prg = type { [11 x i8], [11 x i8] } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2s8u11s8u11" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u11s8u11" @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" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index e27599f623..23f2b550bf 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, section "var-__Person__init:r4s8u81s8u81i16u8" + @__Person__init = unnamed_addr constant %Person zeroinitializer, section "var-$RUSTY$__Person__init:r4s8u81s8u81i16u8" "###); } @@ -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 }, section "var-p:r4s8u6s8u6i16u8" - @__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:r4s8u6s8u6i16u8" + @p = global %Person { [6 x i8] c"Jane\00\00", [6 x i8] c"Row\00\00\00", i16 1988, i8 0 }, section "var-$RUSTY$p:r4s8u6s8u6i16u8" + @__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-$RUSTY$__Person__init:r4s8u6s8u6i16u8" "###); } @@ -97,13 +97,13 @@ 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 } } }, section "var-prg_instance:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" - @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:r2r2i16i16r2i16i16" - @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" + @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-$RUSTY$prg_instance:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-$RUSTY$__Rect__init:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" @__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 } } - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -143,10 +143,10 @@ fn assigning_structs() { %prg = type { %Point, %Point } %Point = type { i16, i16 } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2i16i16r2i16i16" - @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %p1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %p2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -200,11 +200,11 @@ fn accessing_struct_members() { %Rect = type { %Point, %Point } %Point = type { i16, i16 } - @prg_instance = global %prg zeroinitializer, section "var-prg_instance:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" - @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-__Rect__init:r2r2i16i16r2i16i16" - @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-__Point__init:r2i16i16" + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2r2i16i16r2i16i16r2r2i16i16r2i16i16" + @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-$RUSTY$__Rect__init:r2r2i16i16r2i16i16" + @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" - define void @prg(%prg* %0) section "fn-prg:v" { + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index b01c2126b7..e4ba8d7512 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -316,9 +316,9 @@ fn pass() { %__foo_arr = type { i32*, [2 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @main() section "fn-main:i32" { + define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %local = alloca [6 x i32], align 4 @@ -340,7 +340,7 @@ fn pass() { ret i32 %main_ret } - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -382,9 +382,9 @@ fn access() { %__foo_arr = type { i32*, [2 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -440,9 +440,9 @@ fn multi_dimensional() { %__foo_arr = type { i32*, [4 x i32] } - @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-____foo_arr__init:r2pai32ai32" + @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 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 bcf9e58c69..b12c6d93a5 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -4,9 +4,9 @@ expression: output_file_content_without_headers --- %main = type { i32, i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r2i32i32", !dbg !0 +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i32", !dbg !0 -define void @main(%main* %0) section "fn-main:v" !dbg !12 { +define void @main(%main* %0) section "fn-$RUSTY$main:v" !dbg !12 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !17 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !18 @@ -17,7 +17,7 @@ entry: ret void, !dbg !20 } -define void @main.newAction(%main* %0) section "fn-main.newAction:v" !dbg !21 { +define void @main.newAction(%main* %0) section "fn-$RUSTY$main.newAction:v" !dbg !21 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !22 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !23 @@ -28,7 +28,7 @@ entry: ret void, !dbg !22 } -define void @main.newAction2(%main* %0) section "fn-main.newAction2:v" !dbg !24 { +define void @main.newAction2(%main* %0) section "fn-$RUSTY$main.newAction2:v" !dbg !24 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !25 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !26 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 0df95ae131..f9950133be 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap @@ -4,9 +4,9 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" +@__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define void @conditional_return(%conditional_return* %0) section "fn-conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap index 0f4f5bb4d6..25a2211efc 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @foo(i32 %0) section "fn-foo:i32[i32]" !dbg !4 { +define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" !dbg !4 { entry: %foo = alloca i32, align 4, !dbg !9 %val = alloca i32, align 4, !dbg !9 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 ec422bce16..1ecce88ccf 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,9 +4,9 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ; Function Attrs: argmemonly nofree nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) section "fn-conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 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 ac96dd44cf..46dee4354a 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,9 +4,9 @@ expression: output_file_content_without_headers --- %conditional_return = type { i32 } -@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-__conditional_return__init:r1i32" +@__conditional_return__init = constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ; Function Attrs: argmemonly nofree nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) section "fn-conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 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 47b62ed2e3..ea666e9a67 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -4,9 +4,9 @@ expression: output_file_content_without_headers --- %foo = type { i32 } -@foo_instance = global %foo zeroinitializer, section "var-foo_instance:r1i32", !dbg !0 +@foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1i32", !dbg !0 -define void @foo(%foo* %0) section "fn-foo:v" !dbg !11 { +define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" !dbg !11 { entry: call void @llvm.dbg.declare(metadata %foo* %0, metadata !15, metadata !DIExpression()), !dbg !16 %val = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0, !dbg !17 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap index 03bfcb1c79..fd0716b3fc 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap index 4a7dd30341..9e3f4c97b9 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 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 8d5e93d8d4..79be9a600a 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,9 +4,9 @@ expression: output_file_content_without_headers --- %main = type { i32 } -@main_instance = global %main zeroinitializer, section "var-main_instance:r1i32", !dbg !0 +@main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32", !dbg !0 -define void @main(%main* %0) section "fn-main:v" !dbg !11 { +define void @main(%main* %0) section "fn-$RUSTY$main:v" !dbg !11 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !15, metadata !DIExpression()), !dbg !16 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !17 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap index 707a4124b8..1dcbe82b60 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-main:i32" { +define i32 @main() section "fn-$RUSTY$main:i32" { entry: %main = alloca i32, align 4 %value = alloca i32, align 4 @@ -15,7 +15,7 @@ entry: ret i32 %main_ret } -define i32 @myAdd(i32 %0, i32 %1) section "fn-myAdd:i32[i32][i32]" { +define i32 @myAdd(i32 %0, i32 %1) section "fn-$RUSTY$myAdd:i32[i32][i32]" { entry: %myAdd = alloca i32, align 4 %a = alloca i32, align 4 @@ -31,7 +31,7 @@ entry: ret i32 %myAdd_ret } -define i32 @myConnection(i32 %0) section "fn-myConnection:i32[i32]" { +define i32 @myConnection(i32 %0) section "fn-$RUSTY$myConnection:i32[i32]" { entry: %myConnection = alloca i32, align 4 %x = alloca i32, align 4 diff --git a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap index 10c5e319f3..7d5863d39d 100644 --- a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap +++ b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap @@ -2,4 +2,4 @@ source: tests/integration/command_line_compile.rs expression: content --- -define i32 @myFunc(i32 %0, i32 %1, i32 %2) section "fn-myFunc:i32[i32][i32][i32]" {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, i32* %a, align 4 %b = alloca i32, align 4 store i32 %1, i32* %b, align 4 %c = alloca i32, align 4 store i32 %2, i32* %c, align 4 store i32 0, i32* %myFunc, align 4 %myFunc_ret = load i32, i32* %myFunc, align 4 ret i32 %myFunc_ret} +define i32 @myFunc(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$myFunc:i32[i32][i32][i32]" {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, i32* %a, align 4 %b = alloca i32, align 4 store i32 %1, i32* %b, align 4 %c = alloca i32, align 4 store i32 %2, i32* %c, align 4 store i32 0, i32* %myFunc, align 4 %myFunc_ret = load i32, i32* %myFunc, align 4 ret i32 %myFunc_ret} From 8d0e9e5be90eadd8d5e22d3fc9f08ed2fe6e15b3 Mon Sep 17 00:00:00 2001 From: Volkan Date: Mon, 17 Jun 2024 11:13:15 +0200 Subject: [PATCH 21/40] feat: Validate argument count (#1233) Resolves https://github.com/PLC-lang/rusty/issues/1027 and https://github.com/PLC-lang/rusty/issues/1201 --- compiler/plc_diagnostics/src/diagnostics.rs | 33 +- .../src/diagnostics/diagnostics_registry.rs | 389 +++++------------- .../src/diagnostics/error_codes/E032.md | 19 +- src/builtins.rs | 16 +- src/index.rs | 4 + src/resolver/generics.rs | 2 +- src/validation/statement.rs | 69 +++- ...ltins_called_with_invalid_param_count.snap | 18 +- ...ltins_called_with_invalid_param_count.snap | 14 +- ..._function_reports_invalid_param_count.snap | 10 +- ..._called_with_invalid_number_of_params.snap | 34 +- .../tests/statement_validation_tests.rs | 154 +++++++ 12 files changed, 399 insertions(+), 363 deletions(-) diff --git a/compiler/plc_diagnostics/src/diagnostics.rs b/compiler/plc_diagnostics/src/diagnostics.rs index d45546a92d..669ffa7b2e 100644 --- a/compiler/plc_diagnostics/src/diagnostics.rs +++ b/compiler/plc_diagnostics/src/diagnostics.rs @@ -2,6 +2,7 @@ use std::fmt::Display; use serde::{Deserialize, Serialize}; +use crate::diagnostics::diagnostics_registry::DIAGNOSTICS; use plc_ast::ast::AstNode; use plc_source::{ source_location::{SourceLocation, SourceLocationFactory}, @@ -88,8 +89,10 @@ impl Diagnostic { self } - pub fn with_error_code(mut self, error_code: &'static str) -> Self { - self.error_code = error_code; + pub fn with_error_code(mut self, code: &'static str) -> Self { + debug_assert!(DIAGNOSTICS.get(code).is_some(), "Error {code} does not exist"); + + self.error_code = code; self } @@ -199,12 +202,26 @@ impl Diagnostic { .with_error_code("E006") } - pub fn invalid_parameter_count(expected: usize, received: usize, location: SourceLocation) -> Diagnostic { - Diagnostic::new( - format!( - "Invalid parameter count. Received {received} parameters while {expected} parameters were expected.", - )).with_error_code("E032") - .with_location(location) + pub fn invalid_argument_count(expected: usize, actual: usize, location: T) -> Diagnostic + where + T: Into, + { + // Let's be extra fancy here 🕺 + fn message(value: usize) -> String { + match value { + 1 => format!("{value} argument"), + _ => format!("{value} arguments"), + } + } + + Diagnostic::new(format!( + "this POU takes {expected} but {actual} {was_or_were} supplied", + expected = message(expected), + actual = message(actual), + was_or_were = if actual == 1 { "was" } else { "were" } + )) + .with_error_code("E032") + .with_location(location.into()) } pub fn unknown_type(type_name: &str, location: SourceLocation) -> Diagnostic { diff --git a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs index b9999558bc..f076bdf045 100644 --- a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs +++ b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs @@ -99,296 +99,107 @@ impl From<&DiagnosticsRegistry> for DiagnosticsConfiguration { } } +#[rustfmt::skip] lazy_static! { - static ref DIAGNOSTICS: FxHashMap<&'static str, DiagnosticEntry> = add_diagnostic!( - E001, - Error, - include_str!("./error_codes/E001.md"), //General Error - E002, - Error, - include_str!("./error_codes/E002.md"), //General IO Error - E003, - Error, - include_str!("./error_codes/E003.md"), //Parameter Error - E004, - Error, - include_str!("./error_codes/E004.md"), //Duplicate Symbol - E005, - Error, - include_str!("./error_codes/E005.md"), //Generic LLVM Error - E006, - Error, - include_str!("./error_codes/E006.md"), //Missing Token - E007, - Error, - include_str!("./error_codes/E007.md"), //Unexpected Token - E008, - Error, - include_str!("./error_codes/E008.md"), //Invalid Range - E009, - Error, - include_str!("./error_codes/E009.md"), //Mismatched Parantheses - E010, - Error, - include_str!("./error_codes/E010.md"), //Invalid Time Literal - E011, - Error, - include_str!("./error_codes/E011.md"), //Invalid Number - E012, - Error, - include_str!("./error_codes/E012.md"), //Missing Case Condition - E013, - Warning, - include_str!("./error_codes/E013.md"), //Keywords shoud contain underscores - E014, - Warning, - include_str!("./error_codes/E014.md"), //Wrong parantheses type - E015, - Warning, - include_str!("./error_codes/E015.md"), //Pointer is not standard - E016, - Warning, - include_str!("./error_codes/E016.md"), //Return types cannot have a default value - E017, - Error, - include_str!("./error_codes/E017.md"), //Classes cannot contain implementations - E018, - Error, - include_str!("./error_codes/E018.md"), //Duplicate Label - E019, - Error, - include_str!("./error_codes/E019.md"), //Classes cannot contain IN_OUT variables - E020, - Error, - include_str!("./error_codes/E020.md"), //Classes cannot contain a return type - E021, - Error, - include_str!("./error_codes/E021.md"), //POUs cannot be extended - E022, - Warning, - include_str!("./error_codes/E022.md"), //Missing action container - E023, - Warning, - include_str!("./error_codes/E023.md"), //Statement with no effect - E024, - Warning, - include_str!("./error_codes/E024.md"), //Invalid pragma location - E025, - Error, - include_str!("./error_codes/E025.md"), // Missing return type - E026, - Error, - include_str!("./error_codes/E026.md"), - E027, - Error, - include_str!("./error_codes/E027.md"), - E028, - Error, - include_str!("./error_codes/E028.md"), - E029, - Error, - include_str!("./error_codes/E029.md"), - E030, - Error, - include_str!("./error_codes/E030.md"), - E031, - Error, - include_str!("./error_codes/E031.md"), - E032, - Error, - include_str!("./error_codes/E032.md"), - E033, - Error, - include_str!("./error_codes/E033.md"), - E034, - Error, - include_str!("./error_codes/E034.md"), - E035, - Error, - include_str!("./error_codes/E035.md"), - E036, - Error, - include_str!("./error_codes/E036.md"), - E037, - Error, - include_str!("./error_codes/E037.md"), - E038, - Error, - include_str!("./error_codes/E038.md"), //Missing type - E039, - Warning, - include_str!("./error_codes/E039.md"), - E040, - Error, - include_str!("./error_codes/E040.md"), - E041, - Error, - include_str!("./error_codes/E041.md"), - E042, - Warning, - include_str!("./error_codes/E042.md"), //Assignment to reference - E043, - Error, - include_str!("./error_codes/E043.md"), - E044, - Error, - include_str!("./error_codes/E044.md"), - E045, - Error, - include_str!("./error_codes/E045.md"), - E046, - Error, - include_str!("./error_codes/E046.md"), - E047, - Warning, - include_str!("./error_codes/E047.md"), //VLAs are always by reference - E048, - Error, - include_str!("./error_codes/E048.md"), - E049, - Error, - include_str!("./error_codes/E049.md"), - E050, - Error, - include_str!("./error_codes/E050.md"), - E051, - Error, - include_str!("./error_codes/E051.md"), - E052, - Error, - include_str!("./error_codes/E052.md"), - E053, - Error, - include_str!("./error_codes/E053.md"), - E054, - Error, - include_str!("./error_codes/E054.md"), - E055, - Error, - include_str!("./error_codes/E055.md"), - E056, - Error, - include_str!("./error_codes/E056.md"), - E057, - Error, - include_str!("./error_codes/E057.md"), - E058, - Error, - include_str!("./error_codes/E058.md"), - E059, - Error, - include_str!("./error_codes/E059.md"), - E060, - Info, - include_str!("./error_codes/E060.md"), //Variable direct access with % - E061, - Error, - include_str!("./error_codes/E061.md"), - E062, - Error, - include_str!("./error_codes/E062.md"), - E063, - Error, - include_str!("./error_codes/E063.md"), - E064, - Error, - include_str!("./error_codes/E064.md"), - E065, - Error, - include_str!("./error_codes/E065.md"), - E066, - Error, - include_str!("./error_codes/E066.md"), - E067, - Warning, - include_str!("./error_codes/E067.md"), //Implicit typecast - E068, - Error, - include_str!("./error_codes/E068.md"), - E069, - Error, - include_str!("./error_codes/E069.md"), - E070, - Error, - include_str!("./error_codes/E070.md"), - E071, - Error, - include_str!("./error_codes/E071.md"), - E072, - Error, - include_str!("./error_codes/E072.md"), - E073, - Error, - include_str!("./error_codes/E073.md"), - E074, - Error, - include_str!("./error_codes/E074.md"), - E075, - Error, - include_str!("./error_codes/E075.md"), - E076, - Error, - include_str!("./error_codes/E076.md"), - E077, - Error, - include_str!("./error_codes/E077.md"), - E078, - Error, - include_str!("./error_codes/E078.md"), - E079, - Error, - include_str!("./error_codes/E079.md"), - E080, - Error, - include_str!("./error_codes/E080.md"), - E081, - Error, - include_str!("./error_codes/E081.md"), - E082, - Error, - include_str!("./error_codes/E082.md"), - E083, - Error, - include_str!("./error_codes/E083.md"), - E084, - Error, - include_str!("./error_codes/E084.md"), - E085, - Error, - include_str!("./error_codes/E085.md"), - E086, - Error, - include_str!("./error_codes/E086.md"), - E087, - Error, - include_str!("./error_codes/E087.md"), - E088, - Error, - include_str!("./error_codes/E088.md"), - E089, - Error, - include_str!("./error_codes/E089.md"), - E090, - Warning, - include_str!("./error_codes/E090.md"), //Incompatible reference Assignment - E091, - Warning, - include_str!("./error_codes/E091.md"), - E092, - Info, - include_str!("./error_codes/E092.md"), - E093, - Warning, - include_str!("./error_codes/E093.md"), - E094, - Error, - include_str!("./error_codes/E094.md"), - E095, - Error, - include_str!("./error_codes/E095.md"), // Action call without `()` - E096, Warning, include_str!("./error_codes/E096.md"), // Integer Condition - E097, Error, include_str!("./error_codes/E097.md"), // Invalid Array Range -); + pub static ref DIAGNOSTICS: FxHashMap<&'static str, DiagnosticEntry> = add_diagnostic!( + E001, Error, include_str!("./error_codes/E001.md"), //General Error + E002, Error, include_str!("./error_codes/E002.md"), //General IO Error + E003, Error, include_str!("./error_codes/E003.md"), //Parameter Error + E004, Error, include_str!("./error_codes/E004.md"), //Duplicate Symbol + E005, Error, include_str!("./error_codes/E005.md"), //Generic LLVM Error + E006, Error, include_str!("./error_codes/E006.md"), //Missing Token + E007, Error, include_str!("./error_codes/E007.md"), //Unexpected Token + E008, Error, include_str!("./error_codes/E008.md"), //Invalid Range + E009, Error, include_str!("./error_codes/E009.md"), //Mismatched Parantheses + E010, Error, include_str!("./error_codes/E010.md"), //Invalid Time Literal + E011, Error, include_str!("./error_codes/E011.md"), //Invalid Number + E012, Error, include_str!("./error_codes/E012.md"), //Missing Case Condition + E013, Warning, include_str!("./error_codes/E013.md"), //Keywords shoud contain underscores + E014, Warning, include_str!("./error_codes/E014.md"), //Wrong parantheses type + E015, Warning, include_str!("./error_codes/E015.md"), //Pointer is not standard + E016, Warning, include_str!("./error_codes/E016.md"), //Return types cannot have a default value + E017, Error, include_str!("./error_codes/E017.md"), //Classes cannot contain implementations + E018, Error, include_str!("./error_codes/E018.md"), //Duplicate Label + E019, Error, include_str!("./error_codes/E019.md"), //Classes cannot contain IN_OUT variables + E020, Error, include_str!("./error_codes/E020.md"), //Classes cannot contain a return type + E021, Error, include_str!("./error_codes/E021.md"), //POUs cannot be extended + E022, Warning, include_str!("./error_codes/E022.md"), //Missing action container + E023, Warning, include_str!("./error_codes/E023.md"), //Statement with no effect + E024, Warning, include_str!("./error_codes/E024.md"), //Invalid pragma location + E025, Error, include_str!("./error_codes/E025.md"), // Missing return type + E026, Error, include_str!("./error_codes/E026.md"), + E027, Error, include_str!("./error_codes/E027.md"), + E028, Error, include_str!("./error_codes/E028.md"), + E029, Error, include_str!("./error_codes/E029.md"), + E030, Error, include_str!("./error_codes/E030.md"), + E031, Error, include_str!("./error_codes/E031.md"), + E032, Error, include_str!("./error_codes/E032.md"), + E033, Error, include_str!("./error_codes/E033.md"), + E034, Error, include_str!("./error_codes/E034.md"), + E035, Error, include_str!("./error_codes/E035.md"), + E036, Error, include_str!("./error_codes/E036.md"), + E037, Error, include_str!("./error_codes/E037.md"), + E038, Error, include_str!("./error_codes/E038.md"), //Missing type + E039, Warning, include_str!("./error_codes/E039.md"), + E040, Error, include_str!("./error_codes/E040.md"), + E041, Error, include_str!("./error_codes/E041.md"), + E042, Warning, include_str!("./error_codes/E042.md"), //Assignment to reference + E043, Error, include_str!("./error_codes/E043.md"), + E044, Error, include_str!("./error_codes/E044.md"), + E045, Error, include_str!("./error_codes/E045.md"), + E046, Error, include_str!("./error_codes/E046.md"), + E047, Warning, include_str!("./error_codes/E047.md"), //VLAs are always by reference + E048, Error, include_str!("./error_codes/E048.md"), + E049, Error, include_str!("./error_codes/E049.md"), + E050, Error, include_str!("./error_codes/E050.md"), + E051, Error, include_str!("./error_codes/E051.md"), + E052, Error, include_str!("./error_codes/E052.md"), + E053, Error, include_str!("./error_codes/E053.md"), + E054, Error, include_str!("./error_codes/E054.md"), + E055, Error, include_str!("./error_codes/E055.md"), + E056, Error, include_str!("./error_codes/E056.md"), + E057, Error, include_str!("./error_codes/E057.md"), + E058, Error, include_str!("./error_codes/E058.md"), + E059, Error, include_str!("./error_codes/E059.md"), + E060, Info, include_str!("./error_codes/E060.md"), //Variable direct access with % + E061, Error, include_str!("./error_codes/E061.md"), + E062, Error, include_str!("./error_codes/E062.md"), + E063, Error, include_str!("./error_codes/E063.md"), + E064, Error, include_str!("./error_codes/E064.md"), + E065, Error, include_str!("./error_codes/E065.md"), + E066, Error, include_str!("./error_codes/E066.md"), + E067, Warning, include_str!("./error_codes/E067.md"), //Implicit typecast + E068, Error, include_str!("./error_codes/E068.md"), + E069, Error, include_str!("./error_codes/E069.md"), + E070, Error, include_str!("./error_codes/E070.md"), + E071, Error, include_str!("./error_codes/E071.md"), + E072, Error, include_str!("./error_codes/E072.md"), + E073, Error, include_str!("./error_codes/E073.md"), + E074, Error, include_str!("./error_codes/E074.md"), + E075, Error, include_str!("./error_codes/E075.md"), + E076, Error, include_str!("./error_codes/E076.md"), + E077, Error, include_str!("./error_codes/E077.md"), + E078, Error, include_str!("./error_codes/E078.md"), + E079, Error, include_str!("./error_codes/E079.md"), + E080, Error, include_str!("./error_codes/E080.md"), + E081, Error, include_str!("./error_codes/E081.md"), + E082, Error, include_str!("./error_codes/E082.md"), + E083, Error, include_str!("./error_codes/E083.md"), + E084, Error, include_str!("./error_codes/E084.md"), + E085, Error, include_str!("./error_codes/E085.md"), + E086, Error, include_str!("./error_codes/E086.md"), + E087, Error, include_str!("./error_codes/E087.md"), + E088, Error, include_str!("./error_codes/E088.md"), + E089, Error, include_str!("./error_codes/E089.md"), + E090, Warning, include_str!("./error_codes/E090.md"), //Incompatible reference Assignment + E091, Warning, include_str!("./error_codes/E091.md"), + E092, Info, include_str!("./error_codes/E092.md"), + E093, Warning, include_str!("./error_codes/E093.md"), + E094, Error, include_str!("./error_codes/E094.md"), + E095, Error, include_str!("./error_codes/E095.md"), // Action call without `()` + E096, Warning, include_str!("./error_codes/E096.md"), // Integer Condition + E097, Error, include_str!("./error_codes/E097.md"), // Invalid Array Range + ); } #[cfg(test)] diff --git a/compiler/plc_diagnostics/src/diagnostics/error_codes/E032.md b/compiler/plc_diagnostics/src/diagnostics/error_codes/E032.md index 53e170129c..cb2b5ed020 100644 --- a/compiler/plc_diagnostics/src/diagnostics/error_codes/E032.md +++ b/compiler/plc_diagnostics/src/diagnostics/error_codes/E032.md @@ -1 +1,18 @@ -# Invalid number of parameters +# Invalid number of arguments + +An invalid number of arguments was passed to a POU. For example + +``` +FUNCTION foo + (* ... *) +END_FUNCTION + +FUNCTION main : DINT + foo('bar'); // Error, foo isn't expecting any arguments +END_FUNCTION +``` + +Note that for `FUNCTION`s the argument count must match with the parameter list and can be bigger if a variadic +parameter is present. For stateful POUs variadic parameters are not supported, thus the argument count must be equal +or less than the parameter list depending on whether optional arguments such as `VAR_INPUT` or `VAR_OUTPUT` were +passed or not. diff --git a/src/builtins.rs b/src/builtins.rs index de6de63e59..9f5da9f6f9 100644 --- a/src/builtins.rs +++ b/src/builtins.rs @@ -92,14 +92,14 @@ lazy_static! { }), validation: Some(|validator, operator, parameters, _, _| { let Some(params) = parameters else { - validator.push_diagnostic(Diagnostic::invalid_parameter_count(1, 0, operator.get_location())); + validator.push_diagnostic(Diagnostic::invalid_argument_count(1, 0, operator.get_location())); return; }; let params = flatten_expression_list(params); if params.len() > 1 { - validator.push_diagnostic(Diagnostic::invalid_parameter_count(1, params.len(), operator.get_location())); + validator.push_diagnostic(Diagnostic::invalid_argument_count(1, params.len(), operator.get_location())); } }), generic_name_resolver: no_generic_name_resolver, @@ -579,7 +579,7 @@ fn validate_builtin_symbol_parameter_count( operation: Operator, ) { let Some(params) = parameters else { - validator.push_diagnostic(Diagnostic::invalid_parameter_count(2, 0, operator.get_location())); + validator.push_diagnostic(Diagnostic::invalid_argument_count(2, 0, operator.get_location())); return; }; @@ -588,7 +588,7 @@ fn validate_builtin_symbol_parameter_count( // non-extensible operators Operator::Minus | Operator::Division | Operator::NotEqual => { if count != 2 { - validator.push_diagnostic(Diagnostic::invalid_parameter_count( + validator.push_diagnostic(Diagnostic::invalid_argument_count( 2, count, operator.get_location(), @@ -597,7 +597,7 @@ fn validate_builtin_symbol_parameter_count( } _ => { if count < 2 { - validator.push_diagnostic(Diagnostic::invalid_parameter_count( + validator.push_diagnostic(Diagnostic::invalid_argument_count( 2, count, operator.get_location(), @@ -746,7 +746,7 @@ fn validate_variable_length_array_bound_function( index: &Index, ) { let Some(parameters) = parameters else { - validator.push_diagnostic(Diagnostic::invalid_parameter_count(2, 0, operator.get_location())); + validator.push_diagnostic(Diagnostic::invalid_argument_count(2, 0, operator.get_location())); // no params, nothing to validate return; }; @@ -754,7 +754,7 @@ fn validate_variable_length_array_bound_function( let params = ast::flatten_expression_list(parameters); if params.len() > 2 { - validator.push_diagnostic(Diagnostic::invalid_parameter_count( + validator.push_diagnostic(Diagnostic::invalid_argument_count( 2, params.len(), operator.get_location(), @@ -798,7 +798,7 @@ fn validate_variable_length_array_bound_function( }; } (Some(_), None) => { - validator.push_diagnostic(Diagnostic::invalid_parameter_count(2, 1, operator.get_location())) + validator.push_diagnostic(Diagnostic::invalid_argument_count(2, 1, operator.get_location())) } _ => unreachable!(), } diff --git a/src/index.rs b/src/index.rs index 0370ce073a..11be9a5d1a 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1199,6 +1199,10 @@ impl Index { .collect::>() } + pub fn has_variadic_parameter(&self, pou_name: &str) -> bool { + self.get_pou_members(pou_name).iter().any(|member| member.is_parameter() && member.is_variadic()) + } + /// returns some if the current index is a VAR_INPUT, VAR_IN_OUT or VAR_OUTPUT that is not a variadic argument /// In other words it returns some if the member variable at `index` of the given container is a possible parameter in /// the call to it diff --git a/src/resolver/generics.rs b/src/resolver/generics.rs index 7cea493142..379460b346 100644 --- a/src/resolver/generics.rs +++ b/src/resolver/generics.rs @@ -440,7 +440,7 @@ pub fn generic_name_resolver( .fold(qualified_name.to_string(), |accum, s| format!("{accum}__{s}")) // TODO: Naming convention (see plc_util/src/convention.rs) } -/// This method returns the qualified name, but has the same signature as the generic resover to be used in builtins +/// This method returns the qualified name, but has the same signature as the generic resolver to be used in builtins pub fn no_generic_name_resolver( qualified_name: &str, _: &[GenericBinding], diff --git a/src/validation/statement.rs b/src/validation/statement.rs index d995ed440f..eb91f49d83 100644 --- a/src/validation/statement.rs +++ b/src/validation/statement.rs @@ -1119,7 +1119,7 @@ fn is_aggregate_type_missmatch(left_type: &DataType, right_type: &DataType, inde fn validate_call( validator: &mut Validator, operator: &AstNode, - parameters: Option<&AstNode>, + operator_arguments: Option<&AstNode>, context: &ValidationContext, ) { // visit called pou @@ -1128,20 +1128,24 @@ fn validate_call( if let Some(pou) = context.find_pou(operator) { // additional validation for builtin calls if necessary if let Some(validation) = builtins::get_builtin(pou.get_name()).and_then(BuiltIn::get_validation) { - validation(validator, operator, parameters, context.annotations, context.index) + validation(validator, operator, operator_arguments, context.annotations, context.index) } - let declared_parameters = context.index.get_declared_parameters(pou.get_name()); - let passed_parameters = parameters.map(flatten_expression_list).unwrap_or_default(); + let arguments = operator_arguments.map(flatten_expression_list).unwrap_or_default(); + let parameters = context.index.get_declared_parameters(pou.get_name()); - let mut are_implicit_parameters = true; + if builtins::get_builtin(pou.get_name()).is_none() { + validate_argument_count(context, validator, pou, &arguments, &operator.location); + } + + let mut arguments_are_implicit = true; let mut variable_location_in_parent = vec![]; // validate parameters - for (i, param) in passed_parameters.iter().enumerate() { - match get_implicit_call_parameter(param, &declared_parameters, i) { + for (i, param) in arguments.iter().enumerate() { + match get_implicit_call_parameter(param, ¶meters, i) { Ok((parameter_location_in_parent, right, is_implicit)) => { - let left = declared_parameters.get(parameter_location_in_parent); + let left = parameters.get(parameter_location_in_parent); if let Some(left) = left { validate_call_by_ref(validator, left, param); // 'parameter location in parent' and 'variable location in parent' are not the same (e.g VAR blocks are not counted as param). @@ -1155,11 +1159,11 @@ fn validate_call( validate_assignment(validator, right, None, ¶m.get_location(), context); } - // mixing implicit and explicit parameters is not allowed - // allways compare to the first passed parameter + // mixing implicit and explicit arguments is not allowed + // allways compare to the first argument if i == 0 { - are_implicit_parameters = is_implicit; - } else if are_implicit_parameters != is_implicit { + arguments_are_implicit = is_implicit; + } else if arguments_are_implicit != is_implicit { validator.push_diagnostic( Diagnostic::new("Cannot mix implicit and explicit call parameters!") .with_error_code("E031") @@ -1190,7 +1194,7 @@ fn validate_call( return; } let declared_in_out_params: Vec<&&VariableIndexEntry> = - declared_parameters.iter().filter(|p| VariableType::InOut == p.get_variable_type()).collect(); + parameters.iter().filter(|p| VariableType::InOut == p.get_variable_type()).collect(); // if the called pou has declared inouts, we need to make sure that these were passed to the pou call if !declared_in_out_params.is_empty() { @@ -1208,7 +1212,7 @@ fn validate_call( } } else { // POU could not be found, we can still partially validate the passed parameters - if let Some(s) = parameters.as_ref() { + if let Some(s) = operator_arguments.as_ref() { visit_statement(validator, s, context); } } @@ -1472,6 +1476,43 @@ fn validate_assignment_type_sizes( }); } +/// Validates if a POU call has the correct number of arguments. Specifically, for functions, +/// the argument count must be equal to the required count unless the interface is variadic, +/// in which case the argument count may be greater than or equal to the required count. For stateful +/// POUs, the argument count can be less than or equal to the required count since VAR_INPUT and +/// VAR_OUTPUT arguments are optional. +fn validate_argument_count( + context: &ValidationContext, + validator: &mut Validator, + pou: &PouIndexEntry, + arguments: &[&AstNode], + operator_location: &SourceLocation, +) { + let parameters = context.index.get_declared_parameters(pou.get_name()); + let has_variadic_parameter = context.index.has_variadic_parameter(pou.get_name()); + + let argument_count_is_incorrect = match pou { + PouIndexEntry::Function { .. } => { + !((has_variadic_parameter && arguments.len() >= parameters.len()) + || (arguments.len() == parameters.len())) + } + + PouIndexEntry::Program { .. } | PouIndexEntry::FunctionBlock { .. } => { + arguments.len() > parameters.len() && !has_variadic_parameter + } + + _ => false, + }; + + if argument_count_is_incorrect { + validator.push_diagnostic(Diagnostic::invalid_argument_count( + parameters.len(), + arguments.len(), + operator_location, + )); + } +} + mod helper { use std::ops::Range; diff --git a/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_called_with_invalid_param_count.snap b/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_called_with_invalid_param_count.snap index 118b727271..f32c66c15d 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_called_with_invalid_param_count.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__arithmetic_builtins_called_with_invalid_param_count.snap @@ -2,11 +2,11 @@ source: src/validation/tests/builtin_validation_tests.rs expression: "&diagnostics" --- -error[E032]: Invalid parameter count. Received 0 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 0 arguments were supplied ┌─ :7:13 │ 7 │ ADD(); - │ ^^^ Invalid parameter count. Received 0 parameters while 2 parameters were expected. + │ ^^^ this POU takes 2 arguments but 0 arguments were supplied error[E064]: Could not resolve generic type T with ANY_NUMBER ┌─ :7:13 @@ -14,22 +14,20 @@ error[E064]: Could not resolve generic type T with ANY_NUMBER 7 │ ADD(); │ ^^^^^^ Could not resolve generic type T with ANY_NUMBER -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :8:13 │ 8 │ MUL(x1); - │ ^^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^^ this POU takes 2 arguments but 1 argument was supplied -error[E032]: Invalid parameter count. Received 4 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 4 arguments were supplied ┌─ :9:13 │ 9 │ DIV(x2, x2, x1, x2); // DIV and SUB are not extensible - │ ^^^ Invalid parameter count. Received 4 parameters while 2 parameters were expected. + │ ^^^ this POU takes 2 arguments but 4 arguments were supplied -error[E032]: Invalid parameter count. Received 4 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 4 arguments were supplied ┌─ :10:13 │ 10 │ SUB(x2, x2, x1, x2); - │ ^^^ Invalid parameter count. Received 4 parameters while 2 parameters were expected. - - + │ ^^^ this POU takes 2 arguments but 4 arguments were supplied diff --git a/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__comparison_builtins_called_with_invalid_param_count.snap b/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__comparison_builtins_called_with_invalid_param_count.snap index cafd37f35c..5eb779a4d0 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__comparison_builtins_called_with_invalid_param_count.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__builtin_validation_tests__comparison_builtins_called_with_invalid_param_count.snap @@ -2,22 +2,20 @@ source: src/validation/tests/builtin_validation_tests.rs expression: "&diagnostics" --- -error[E032]: Invalid parameter count. Received 0 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 0 arguments were supplied ┌─ :7:13 │ 7 │ EQ(); - │ ^^ Invalid parameter count. Received 0 parameters while 2 parameters were expected. + │ ^^ this POU takes 2 arguments but 0 arguments were supplied -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :8:13 │ 8 │ GT(x1); - │ ^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^ this POU takes 2 arguments but 1 argument was supplied -error[E032]: Invalid parameter count. Received 4 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 4 arguments were supplied ┌─ :10:13 │ 10 │ NE(x2, x2, x1, x2); // NE is not extensible - │ ^^ Invalid parameter count. Received 4 parameters while 2 parameters were expected. - - + │ ^^ this POU takes 2 arguments but 4 arguments were supplied diff --git a/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__ref_builtin_function_reports_invalid_param_count.snap b/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__ref_builtin_function_reports_invalid_param_count.snap index f30dceb1b4..02950337cb 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__ref_builtin_function_reports_invalid_param_count.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__ref_builtin_function_reports_invalid_param_count.snap @@ -2,16 +2,14 @@ source: src/validation/tests/statement_validation_tests.rs expression: diagnostics --- -error[E032]: Invalid parameter count. Received 0 parameters while 1 parameters were expected. +error[E032]: this POU takes 1 argument but 0 arguments were supplied ┌─ :7:13 │ 7 │ REF(); - │ ^^^ Invalid parameter count. Received 0 parameters while 1 parameters were expected. + │ ^^^ this POU takes 1 argument but 0 arguments were supplied -error[E032]: Invalid parameter count. Received 4 parameters while 1 parameters were expected. +error[E032]: this POU takes 1 argument but 4 arguments were supplied ┌─ :8:13 │ 8 │ REF(x, 1, 2, 'abc'); - │ ^^^ Invalid parameter count. Received 4 parameters while 1 parameters were expected. - - + │ ^^^ this POU takes 1 argument but 4 arguments were supplied diff --git a/src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_number_of_params.snap b/src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_number_of_params.snap index 61e2cbe523..d2c0b22a83 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_number_of_params.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__variable_length_array_test__builtins__builtins_called_with_invalid_number_of_params.snap @@ -2,23 +2,23 @@ source: src/validation/tests/variable_length_array_test.rs expression: diagnostics --- -error[E032]: Invalid parameter count. Received 0 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 0 arguments were supplied ┌─ :13:13 │ 13 │ LOWER_BOUND(); - │ ^^^^^^^^^^^ Invalid parameter count. Received 0 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 0 arguments were supplied -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :14:13 │ 14 │ LOWER_BOUND(vla); - │ ^^^^^^^^^^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 1 argument was supplied -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :15:13 │ 15 │ LOWER_BOUND(1); - │ ^^^^^^^^^^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 1 argument was supplied error[E031]: Expected a reference for parameter arr because their type is InOut ┌─ :15:25 @@ -32,29 +32,29 @@ error[E037]: Invalid assignment: cannot assign 'DINT' to 'VARIABLE LENGTH ARRAY' 15 │ LOWER_BOUND(1); │ ^ Invalid assignment: cannot assign 'DINT' to 'VARIABLE LENGTH ARRAY' -error[E032]: Invalid parameter count. Received 4 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 4 arguments were supplied ┌─ :16:13 │ 16 │ LOWER_BOUND(vla, 1, 2, 3); - │ ^^^^^^^^^^^ Invalid parameter count. Received 4 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 4 arguments were supplied -error[E032]: Invalid parameter count. Received 0 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 0 arguments were supplied ┌─ :18:13 │ 18 │ UPPER_BOUND(); - │ ^^^^^^^^^^^ Invalid parameter count. Received 0 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 0 arguments were supplied -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :19:13 │ 19 │ UPPER_BOUND(vla); - │ ^^^^^^^^^^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 1 argument was supplied -error[E032]: Invalid parameter count. Received 1 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 1 argument was supplied ┌─ :20:13 │ 20 │ UPPER_BOUND(1); - │ ^^^^^^^^^^^ Invalid parameter count. Received 1 parameters while 2 parameters were expected. + │ ^^^^^^^^^^^ this POU takes 2 arguments but 1 argument was supplied error[E031]: Expected a reference for parameter arr because their type is InOut ┌─ :20:25 @@ -68,10 +68,8 @@ error[E037]: Invalid assignment: cannot assign 'DINT' to 'VARIABLE LENGTH ARRAY' 20 │ UPPER_BOUND(1); │ ^ Invalid assignment: cannot assign 'DINT' to 'VARIABLE LENGTH ARRAY' -error[E032]: Invalid parameter count. Received 4 parameters while 2 parameters were expected. +error[E032]: this POU takes 2 arguments but 4 arguments were supplied ┌─ :21:13 │ 21 │ UPPER_BOUND(vla, 1, 2, 3); - │ ^^^^^^^^^^^ Invalid parameter count. Received 4 parameters while 2 parameters were expected. - - + │ ^^^^^^^^^^^ this POU takes 2 arguments but 4 arguments were supplied diff --git a/src/validation/tests/statement_validation_tests.rs b/src/validation/tests/statement_validation_tests.rs index fe186996be..e2cc050b35 100644 --- a/src/validation/tests/statement_validation_tests.rs +++ b/src/validation/tests/statement_validation_tests.rs @@ -1667,3 +1667,157 @@ fn action_assignment_attempt_does_not_report_missing_parentheses() { "###); } + +#[test] +fn incorrect_argument_count_stateless_pous() { + let diagnostics = parse_and_validate_buffered( + " + FUNCTION main : DINT + fn_with_one_parameter(); + fn_with_one_parameter(1, 2); + + fn_with_two_parameters(1); + fn_with_two_parameters(1, 2, 3); + + fn_with_one_variadic_parameter(); + fn_with_one_variadic_parameter(1); + fn_with_one_variadic_parameter(1, 2); + fn_with_one_variadic_parameter(1, 2, 3); + END_FUNCTION + + FUNCTION fn_with_one_parameter + VAR_INPUT + in_one : DINT; + END_VAR + END_FUNCTION + + FUNCTION fn_with_two_parameters + VAR_INPUT + in_one : DINT; + END_VAR + + VAR_OUTPUT + out_two : DINT; + END_VAR + END_FUNCTION + + FUNCTION fn_with_one_variadic_parameter + VAR_INPUT + vararg: DINT...; + END_VAR + END_FUNCTION + ", + ); + + assert_snapshot!(diagnostics, @r###" + error[E032]: this POU takes 1 argument but 0 arguments were supplied + ┌─ :3:13 + │ + 3 │ fn_with_one_parameter(); + │ ^^^^^^^^^^^^^^^^^^^^^ this POU takes 1 argument but 0 arguments were supplied + + error[E032]: this POU takes 1 argument but 2 arguments were supplied + ┌─ :4:13 + │ + 4 │ fn_with_one_parameter(1, 2); + │ ^^^^^^^^^^^^^^^^^^^^^ this POU takes 1 argument but 2 arguments were supplied + + error[E032]: this POU takes 2 arguments but 1 argument was supplied + ┌─ :6:13 + │ + 6 │ fn_with_two_parameters(1); + │ ^^^^^^^^^^^^^^^^^^^^^^ this POU takes 2 arguments but 1 argument was supplied + + error[E032]: this POU takes 2 arguments but 3 arguments were supplied + ┌─ :7:13 + │ + 7 │ fn_with_two_parameters(1, 2, 3); + │ ^^^^^^^^^^^^^^^^^^^^^^ this POU takes 2 arguments but 3 arguments were supplied + + error[E031]: Expected a reference for parameter out_two because their type is Output + ┌─ :7:39 + │ + 7 │ fn_with_two_parameters(1, 2, 3); + │ ^ Expected a reference for parameter out_two because their type is Output + + "###); +} + +#[test] +fn incorrect_argument_count_stateful_pous() { + let source = r" + FUNCTION main : DINT + VAR + one_instance : fn_with_one_parameter; + two_instance : fn_with_two_parameters; + END_VAR + + one_instance(); + one_instance(1, 2); + + two_instance(1); + two_instance(1, 2, 3); + END_FUNCTION + + fn_with_one_parameter + VAR_INPUT + in_one : DINT; + END_VAR + END_ + + fn_with_two_parameters + VAR_INPUT + in_one : DINT; + END_VAR + + VAR_OUTPUT + out_two : DINT; + END_VAR + END_ + + "; + + let diagnostics = parse_and_validate_buffered(&source.replace("", "FUNCTION_BLOCK")); + assert_snapshot!(diagnostics, @r###" + error[E032]: this POU takes 1 argument but 2 arguments were supplied + ┌─ :9:13 + │ + 9 │ one_instance(1, 2); + │ ^^^^^^^^^^^^ this POU takes 1 argument but 2 arguments were supplied + + error[E032]: this POU takes 2 arguments but 3 arguments were supplied + ┌─ :12:13 + │ + 12 │ two_instance(1, 2, 3); + │ ^^^^^^^^^^^^ this POU takes 2 arguments but 3 arguments were supplied + + error[E031]: Expected a reference for parameter out_two because their type is Output + ┌─ :12:29 + │ + 12 │ two_instance(1, 2, 3); + │ ^ Expected a reference for parameter out_two because their type is Output + + "###); + + let diagnostics = parse_and_validate_buffered(&source.replace("", "PROGRAM")); + assert_snapshot!(diagnostics, @r###" + error[E032]: this POU takes 1 argument but 2 arguments were supplied + ┌─ :9:13 + │ + 9 │ one_instance(1, 2); + │ ^^^^^^^^^^^^ this POU takes 1 argument but 2 arguments were supplied + + error[E032]: this POU takes 2 arguments but 3 arguments were supplied + ┌─ :12:13 + │ + 12 │ two_instance(1, 2, 3); + │ ^^^^^^^^^^^^ this POU takes 2 arguments but 3 arguments were supplied + + error[E031]: Expected a reference for parameter out_two because their type is Output + ┌─ :12:29 + │ + 12 │ two_instance(1, 2, 3); + │ ^ Expected a reference for parameter out_two because their type is Output + + "###); +} From 45f487f260673af4f26ef0e83453dd72bfab79b7 Mon Sep 17 00:00:00 2001 From: Volkan Date: Tue, 18 Jun 2024 09:22:05 +0200 Subject: [PATCH 22/40] ci: Introduce llvm-lit for Linux (#1243) This PR introduces llvm-lit, which at some point will replace our current correctness tests. For now only the functionality was introduced as well as GitHub workflows executing example lit tests. --- .github/workflows/lit.yml | 35 +++++++++++++++++++ .gitignore | 4 +++ scripts/build.sh | 33 +++++++++++++---- tests/lit/lit.cfg | 20 +++++++++++ .../multi/enum__month_to_int/month_to_int.st | 26 ++++++++++++++ .../enum__month_to_int/month_to_int.test | 2 ++ tests/lit/multi/enum__month_to_int/months.dt | 3 ++ tests/lit/multi/lit.local.cfg | 1 + tests/lit/single/arithmetic/addition.st | 12 +++++++ tests/lit/single/arithmetic/sqrt.st | 8 +++++ tests/lit/single/lit.local.cfg | 2 ++ tests/lit/util/printf.pli | 9 +++++ 12 files changed, 149 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/lit.yml create mode 100644 tests/lit/lit.cfg create mode 100644 tests/lit/multi/enum__month_to_int/month_to_int.st create mode 100644 tests/lit/multi/enum__month_to_int/month_to_int.test create mode 100644 tests/lit/multi/enum__month_to_int/months.dt create mode 100644 tests/lit/multi/lit.local.cfg create mode 100644 tests/lit/single/arithmetic/addition.st create mode 100644 tests/lit/single/arithmetic/sqrt.st create mode 100644 tests/lit/single/lit.local.cfg create mode 100644 tests/lit/util/printf.pli diff --git a/.github/workflows/lit.yml b/.github/workflows/lit.yml new file mode 100644 index 0000000000..4858e5864b --- /dev/null +++ b/.github/workflows/lit.yml @@ -0,0 +1,35 @@ +name: Build + +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + lit-linux-debug: + name: lit tests (Linux, debug build) + runs-on: ubuntu-latest + container: ghcr.io/plc-lang/rust-llvm:latest + steps: + - uses: actions/checkout@v3 + + - name: Run `build.sh --lit` + shell: bash + run: | + ./scripts/build.sh --lit + + lit-linux-release: + name: lit tests (Linux, release build) + runs-on: ubuntu-latest + container: ghcr.io/plc-lang/rust-llvm:latest + steps: + - uses: actions/checkout@v3 + + - name: Run `build.sh --lit --release` + shell: bash + run: | + ./scripts/build.sh --lit --release \ No newline at end of file diff --git a/.gitignore b/.gitignore index cb17664f45..3d60db547f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,7 @@ *.a *.elf *.out + +# Garbage generated by llvm-lit +tests/lit/**/*.txt +tests/lit/**/Output/ \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index 14ece3a910..ab431fc90f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -8,6 +8,7 @@ check_style=0 build=0 doc=0 test=0 +lit=0 coverage=0 release=0 debug=0 @@ -140,6 +141,19 @@ function run_check_style() { cargo fmt -- --check } +function run_lit_test() { + # We need a binary as well as the stdlib and its *.so file before running lit tests + run_build + run_std_build + run_package_std + + if [[ $release -eq 0 ]]; then + lit -v -DLIB=$project_location/output -DCOMPILER=$project_location/target/debug/plc tests/lit/ + else + lit -v -DLIB=$project_location/output -DCOMPILER=$project_location/target/release/plc tests/lit/ + fi +} + function run_test() { CARGO_OPTIONS=$(set_cargo_options) log "Running cargo test" @@ -191,6 +205,8 @@ function set_offline() { function run_package_std() { cc=$(get_compiler) + OUTPUT_DIR=$project_location/output + make_dir "$OUTPUT_DIR" log "Packaging Standard functions" log "Removing previous output folder" rm -rf $OUTPUT_DIR @@ -291,6 +307,9 @@ function run_in_container() { if [[ $test -ne 0 ]]; then params="$params --test" fi + if [[ $lit -ne 0 ]]; then + params="$params --lit" + fi if [[ $junit -ne 0 ]]; then params="$params --junit" fi @@ -330,7 +349,7 @@ function run_in_container() { set -o errexit -o pipefail -o noclobber -o nounset OPTIONS=sorbvc -LONGOPTS=sources,offline,release,check,check-style,build,doc,test,junit,verbose,container,linux,container-name:,coverage,package,target: +LONGOPTS=sources,offline,release,check,check-style,build,doc,lit,test,junit,verbose,container,linux,container-name:,coverage,package,target: check_env # -activate quoting/enhanced mode (e.g. by writing out “--options”) @@ -382,6 +401,9 @@ while true; do --test) test=1 ;; + --lit) + lit=1 + ;; --junit) junit=1 ;; @@ -417,11 +439,6 @@ if [[ $container -ne 0 ]]; then exit 0 fi -if [[ $package -ne 0 ]]; then - OUTPUT_DIR=$project_location/output - make_dir "$OUTPUT_DIR" -fi - if [[ $vendor -ne 0 ]]; then generate_sources exit 0 @@ -457,6 +474,10 @@ if [[ $test -ne 0 ]]; then run_test fi +if [[ $lit -ne 0 ]]; then + run_lit_test +fi + if [[ $doc -ne 0 ]]; then run_doc fi diff --git a/tests/lit/lit.cfg b/tests/lit/lit.cfg new file mode 100644 index 0000000000..6b07c4aa42 --- /dev/null +++ b/tests/lit/lit.cfg @@ -0,0 +1,20 @@ +import lit.formats, os, os.path, sys, subprocess +srcDir = os.path.dirname(__file__) +config.test_format = lit.formats.ShTest(True) +config.pipefail = False +rustyRootDirectory = subprocess.check_output("dirname `cargo locate-project --message-format plain`", shell=True).decode("utf-8").strip() + +stdlibLocation = lit_config.params["LIB"] +compilerLocation = lit_config.params["COMPILER"] + +# ...to make the compile command more reable we build it over multiple lines +compile = f'{compilerLocation}' +compile = f'{compile} -o /tmp/%basename_t.out' +compile = f'{compile} -liec61131std -L{stdlibLocation}/lib -i "{stdlibLocation}/include/*.st"' +compile = f'{compile} -i {rustyRootDirectory}/tests/lit/util/*.pli' +compile = f'{compile} --linker=cc' +print(f'Compile command: {compile}') + +config.substitutions.append(('%COMPILE', f'{compile}')) +config.substitutions.append(('%RUN', f'LD_LIBRARY_PATH="{stdlibLocation}/lib" /tmp/%basename_t.out')) +config.substitutions.append(('%CHECK', f'FileCheck-14 --check-prefixes CHECK --allow-unused-prefixes --match-full-lines')) \ No newline at end of file diff --git a/tests/lit/multi/enum__month_to_int/month_to_int.st b/tests/lit/multi/enum__month_to_int/month_to_int.st new file mode 100644 index 0000000000..aeb9658971 --- /dev/null +++ b/tests/lit/multi/enum__month_to_int/month_to_int.st @@ -0,0 +1,26 @@ +FUNCTION main : DINT + printf('%d', month_to_int(MONTH#June)); +END_FUNCTION + + +FUNCTION month_to_int : INT + VAR_INPUT + month_var : MONTH; + END_VAR + + CASE month_var OF + MONTH.January: month_to_int := 1; + MONTH.February: month_to_int := 2; + MONTH.March: month_to_int := 3; + MONTH.April: month_to_int := 4; + MONTH.May: month_to_int := 5; + MONTH.June: month_to_int := 6; + MONTH.July: month_to_int := 7; + MONTH.August: month_to_int := 8; + MONTH.September: month_to_int := 9; + MONTH.October: month_to_int := 10; + MONTH.November: month_to_int := 11; + MONTH.December: month_to_int := 12; + else month_to_int := 0; + END_CASE; +END_FUNCTION diff --git a/tests/lit/multi/enum__month_to_int/month_to_int.test b/tests/lit/multi/enum__month_to_int/month_to_int.test new file mode 100644 index 0000000000..fe9a8d88f3 --- /dev/null +++ b/tests/lit/multi/enum__month_to_int/month_to_int.test @@ -0,0 +1,2 @@ +RUN: %COMPILE %S/month_to_int.st %S/months.dt && %RUN | %CHECK %s +CHECK:6 \ No newline at end of file diff --git a/tests/lit/multi/enum__month_to_int/months.dt b/tests/lit/multi/enum__month_to_int/months.dt new file mode 100644 index 0000000000..d1ff02e602 --- /dev/null +++ b/tests/lit/multi/enum__month_to_int/months.dt @@ -0,0 +1,3 @@ +TYPE + MONTH: (January, February, March, April, May, June, July, August, September, October, November, December); +END_TYPE \ No newline at end of file diff --git a/tests/lit/multi/lit.local.cfg b/tests/lit/multi/lit.local.cfg new file mode 100644 index 0000000000..4b89c231b9 --- /dev/null +++ b/tests/lit/multi/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test'] \ No newline at end of file diff --git a/tests/lit/single/arithmetic/addition.st b/tests/lit/single/arithmetic/addition.st new file mode 100644 index 0000000000..79d620ec0e --- /dev/null +++ b/tests/lit/single/arithmetic/addition.st @@ -0,0 +1,12 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +// CHECK: 10 +FUNCTION main + VAR + x : DINT; + y : DINT; + END_VAR + + x := 5; + y := 5; + printf('%d$N', x + y); +END_FUNCTION diff --git a/tests/lit/single/arithmetic/sqrt.st b/tests/lit/single/arithmetic/sqrt.st new file mode 100644 index 0000000000..5bedfc48fd --- /dev/null +++ b/tests/lit/single/arithmetic/sqrt.st @@ -0,0 +1,8 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +// CHECK: 2 +FUNCTION main + VAR + res : LREAL; + END_VAR + printf('%d$N', REAL_TO_DINT(SQRT(4.0))); +END_FUNCTION diff --git a/tests/lit/single/lit.local.cfg b/tests/lit/single/lit.local.cfg new file mode 100644 index 0000000000..4b8df7dec5 --- /dev/null +++ b/tests/lit/single/lit.local.cfg @@ -0,0 +1,2 @@ +# Declare any *.st file as a standlone test file +config.suffixes = ['.st'] \ No newline at end of file diff --git a/tests/lit/util/printf.pli b/tests/lit/util/printf.pli new file mode 100644 index 0000000000..16036e0cf3 --- /dev/null +++ b/tests/lit/util/printf.pli @@ -0,0 +1,9 @@ +{external} +FUNCTION printf: DINT +VAR_INPUT {ref} + str : STRING; +END_VAR +VAR_INPUT + args: ...; +END_VAR +END_FUNCTION \ No newline at end of file From c7f3d82b97f142890a81b3806514d5b6ddbb1a9b Mon Sep 17 00:00:00 2001 From: Volkan Date: Wed, 19 Jun 2024 15:51:11 +0200 Subject: [PATCH 23/40] fix: Bitaccess for VAR_OUTPUT (#1214) Resolves https://github.com/PLC-lang/rusty/issues/1176 --- compiler/plc_ast/src/ast.rs | 8 + libs/stdlib/tests/counters_tests.rs | 144 +++---- .../generators/expression_generator.rs | 357 +++++++++++++----- src/codegen/generators/statement_generator.rs | 107 ++---- src/codegen/tests/directaccess_test.rs | 325 ++++++++++++++++ src/index.rs | 6 + src/resolver.rs | 5 +- tests/correctness/bitaccess.rs | 126 +++++++ 8 files changed, 834 insertions(+), 244 deletions(-) diff --git a/compiler/plc_ast/src/ast.rs b/compiler/plc_ast/src/ast.rs index 7aa3a0a546..e7353608c2 100644 --- a/compiler/plc_ast/src/ast.rs +++ b/compiler/plc_ast/src/ast.rs @@ -851,6 +851,14 @@ impl AstNode { matches!(self.stmt, AstStatement::EmptyStatement(..)) } + pub fn is_assignment(&self) -> bool { + matches!(self.stmt, AstStatement::Assignment(..)) + } + + pub fn is_output_assignment(&self) -> bool { + matches!(self.stmt, AstStatement::OutputAssignment(..)) + } + pub fn is_reference(&self) -> bool { matches!(self.stmt, AstStatement::ReferenceExpr(..)) } diff --git a/libs/stdlib/tests/counters_tests.rs b/libs/stdlib/tests/counters_tests.rs index d9793768b7..431f6ac253 100644 --- a/libs/stdlib/tests/counters_tests.rs +++ b/libs/stdlib/tests/counters_tests.rs @@ -28,11 +28,11 @@ fn ctu() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= INT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= INT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= INT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -70,11 +70,11 @@ fn ctu_int() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= INT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= INT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= INT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -112,11 +112,11 @@ fn ctu_dint() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= DINT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= DINT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= DINT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -154,11 +154,11 @@ fn ctu_udint() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= UDINT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= UDINT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= UDINT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -196,11 +196,11 @@ fn ctu_lint() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= LINT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= LINT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= LINT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -238,11 +238,11 @@ fn ctu_ulint() { END_VAR // count up until Q_res true and then reset CV_res IF Q_res THEN - ctu_inst(CU:= TRUE, R:= TRUE, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= TRUE, PV:= ULINT#3, Q => Q_res, CV => CV_res); ELSE - ctu_inst(CU:= TRUE, R:= FALSE, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= TRUE, R:= FALSE, PV:= ULINT#3, Q => Q_res, CV => CV_res); // input CU evaluated by R_EDGE, this call will enable to count up again - ctu_inst(CU:= FALSE, R:= FALSE, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctu_inst(CU:= FALSE, R:= FALSE, PV:= ULINT#3, Q => Q_res, CV => CV_res); END_IF END_PROGRAM "#; @@ -290,12 +290,12 @@ fn ctd() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -333,12 +333,12 @@ fn ctd_int() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= INT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= INT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -376,12 +376,12 @@ fn ctd_dint() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= DINT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= DINT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= DINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= DINT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -419,12 +419,12 @@ fn ctd_udint() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= UDINT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= UDINT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= UDINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= UDINT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -462,12 +462,12 @@ fn ctd_lint() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= LINT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= LINT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= LINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= LINT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -505,12 +505,12 @@ fn ctd_ulint() { END_VAR // load PV value IF load THEN - ctd_inst(CD:= TRUE, LD:= load, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= ULINT#3, Q => Q_res, CV => CV_res); load := FALSE; END_IF - ctd_inst(CD:= TRUE, LD:= load, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= TRUE, LD:= load, PV:= ULINT#3, Q => Q_res, CV => CV_res); // input CD evaluated by R_EDGE, this call will enable to count down again - ctd_inst(CD:= FALSE, LD:= load, PV:= ULINT#3, Q:= Q_res, CV:= CV_res); + ctd_inst(CD:= FALSE, LD:= load, PV:= ULINT#3, Q => Q_res, CV => CV_res); END_PROGRAM "#; @@ -561,31 +561,31 @@ fn ctud() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM @@ -636,31 +636,31 @@ fn ctud_int() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= INT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= INT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM @@ -711,31 +711,31 @@ fn ctud_dint() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= DINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= DINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM @@ -786,31 +786,31 @@ fn ctud_udint() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= UDINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= UDINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM @@ -861,31 +861,31 @@ fn ctud_lint() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= LINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= LINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM @@ -936,31 +936,31 @@ fn ctud_ulint() { END_VAR // 1st call, load PV value IF load THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= TRUE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); load := FALSE; END_IF // 2nd call, CU/CD both true, nothing should happen IF i = 1 THEN - ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 3rd call, count down IF i = 2 THEN // input CD evaluated by R_EDGE, this call will enable count down again - ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); - ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); + ctud_inst(CU:= FALSE, CD:= TRUE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 4th call, count up IF i = 3 THEN // input CU evaluated by R_EDGE, third call enabled count up again - ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= TRUE, CD:= FALSE, R:= FALSE, LD:= FALSE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF // 5th call, reset IF i = 4 THEN - ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= ULINT#1, QU:= QU_res, QD:= QD_res, CV:= CV_res); + ctud_inst(CU:= FALSE, CD:= FALSE, R:= TRUE, LD:= FALSE, PV:= ULINT#1, QU => QU_res, QD => QD_res, CV => CV_res); END_IF i := i + 1; END_PROGRAM diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index 5db678157f..3ad0a9abf7 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -1,20 +1,5 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder -use crate::{ - codegen::{ - debug::{Debug, DebugBuilderEnum}, - llvm_index::LlvmTypedIndex, - llvm_typesystem::{cast_if_needed, get_llvm_int_type}, - }, - index::{ - const_expressions::ConstId, ArgumentType, ImplementationIndexEntry, Index, PouIndexEntry, - VariableIndexEntry, VariableType, - }, - resolver::{AnnotationMap, AstAnnotations, StatementAnnotation}, - typesystem::{ - is_same_type_class, DataType, DataTypeInformation, DataTypeInformationProvider, Dimension, - StringEncoding, VarArgs, DINT_TYPE, INT_SIZE, INT_TYPE, LINT_TYPE, - }, -}; + use inkwell::{ builder::Builder, types::{BasicType, BasicTypeEnum}, @@ -24,6 +9,9 @@ use inkwell::{ }, AddressSpace, FloatPredicate, IntPredicate, }; +use rustc_hash::FxHashSet; + +use plc_ast::ast::Assignment; use plc_ast::{ ast::{ flatten_expression_list, AstFactory, AstNode, AstStatement, DirectAccessType, Operator, @@ -34,10 +22,27 @@ use plc_ast::{ use plc_diagnostics::diagnostics::{Diagnostic, INTERNAL_LLVM_ERROR}; use plc_source::source_location::SourceLocation; use plc_util::convention::qualified_name; -use rustc_hash::FxHashSet; -use std::vec; + +use crate::{ + codegen::{ + debug::{Debug, DebugBuilderEnum}, + llvm_index::LlvmTypedIndex, + llvm_typesystem::{cast_if_needed, get_llvm_int_type}, + }, + index::{ + const_expressions::ConstId, ArgumentType, ImplementationIndexEntry, Index, PouIndexEntry, + VariableIndexEntry, VariableType, + }, + resolver::{AnnotationMap, AstAnnotations, StatementAnnotation}, + typesystem, + typesystem::{ + is_same_type_class, DataType, DataTypeInformation, DataTypeInformationProvider, Dimension, + StringEncoding, VarArgs, DINT_TYPE, INT_SIZE, INT_TYPE, LINT_TYPE, + }, +}; use super::{llvm::Llvm, statement_generator::FunctionContext, ADDRESS_SPACE_CONST, ADDRESS_SPACE_GENERIC}; + /// the generator for expressions pub struct ExpressionCodeGenerator<'a, 'b> { pub llvm: &'b Llvm<'a>, @@ -62,7 +67,7 @@ pub struct ExpressionCodeGenerator<'a, 'b> { #[derive(Debug)] struct CallParameterAssignment<'a, 'b> { /// the assignmentstatement in the call-argument list (a:=3) - assignment_statement: &'b AstNode, + assignment: &'b AstNode, /// the name of the function we're calling function_name: &'b str, /// the position of the argument in the POU's argument's list @@ -424,7 +429,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.index.find_pou(name) } else { None - }) + } + ) .ok_or_else(|| Diagnostic::cannot_generate_call_statement(operator))?; // find corresponding implementation @@ -500,12 +506,13 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // after the call we need to copy the values for assigned outputs // this is only necessary for outputs defined as `rusty::index::ArgumentType::ByVal` (PROGRAM, FUNCTION_BLOCK) - // FUNCTION outputs are defined as `rusty::index::ArgumentType::ByRef` + // FUNCTION outputs are defined as `rusty::index::ArgumentType::ByRef` // FIXME(mhasel): for standard-compliance functions also need to support VAR_OUTPUT if !pou.is_function() { let parameter_struct = match arguments_list.first() { Some(v) => v.into_pointer_value(), None => self.generate_lvalue(operator)?, }; + self.assign_output_values(parameter_struct, implementation_name, parameters_list)? } @@ -522,72 +529,220 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { function_name: &str, parameters: Vec<&AstNode>, ) -> Result<(), Diagnostic> { + let pou_info = self.index.get_declared_parameters(function_name); + let implicit = arguments_are_implicit(¶meters); + for (index, assignment_statement) in parameters.into_iter().enumerate() { - self.assign_output_value(&CallParameterAssignment { - assignment_statement, - function_name, - index: index as u32, - parameter_struct, - })? + let is_output = pou_info.get(index).is_some_and(|param| param.get_variable_type().is_output()); + + if assignment_statement.is_output_assignment() || (implicit && is_output) { + self.assign_output_value(&CallParameterAssignment { + assignment: assignment_statement, + function_name, + index: index as u32, + parameter_struct, + })? + } } + Ok(()) } fn assign_output_value(&self, param_context: &CallParameterAssignment) -> Result<(), Diagnostic> { - match param_context.assignment_statement.get_stmt() { - AstStatement::OutputAssignment(data) | AstStatement::Assignment(data) => self - .generate_explicit_output_assignment( - param_context.parameter_struct, - param_context.function_name, - &data.left, - &data.right, - ), + match ¶m_context.assignment.stmt { + AstStatement::OutputAssignment(assignment) => self.generate_explicit_output_assignment( + param_context.parameter_struct, + param_context.function_name, + assignment, + ), + _ => self.generate_output_assignment(param_context), } } - fn generate_output_assignment(&self, param_context: &CallParameterAssignment) -> Result<(), Diagnostic> { - let builder = &self.llvm.builder; - let expression = param_context.assignment_statement; - let parameter_struct = param_context.parameter_struct; - let function_name = param_context.function_name; - let index = param_context.index; - if let Some(parameter) = self.index.get_declared_parameter(function_name, index) { - if matches!(parameter.get_variable_type(), VariableType::Output) - && !matches!(expression.get_stmt(), AstStatement::EmptyStatement { .. }) + pub fn generate_assignment_with_direct_access( + &self, + left_statement: &AstNode, + left_value: IntValue, + left_pointer: PointerValue, + right_type: &DataType, + right_expr: BasicValueEnum, + ) -> Result<(), Diagnostic> { + let Some((target, access_sequence)) = collect_base_and_direct_access_for_assignment(left_statement) + else { + unreachable!("Invalid direct-access expression: {left_statement:#?}") + }; + + let type_left = self.get_type_hint_for(target)?; + let type_right = + if let DataTypeInformation::Integer { semantic_size: Some(typesystem::U1_SIZE), .. } = + *right_type.get_type_information() { - { - let assigned_output = self.generate_lvalue(expression)?; + // we need to switch to a faked u1 type, when dealing with a single bit + self.index.get_type_or_panic(typesystem::U1_TYPE) + } else { + right_type + }; - let assigned_output_type = - self.annotations.get_type_or_void(expression, self.index).get_type_information(); + let Some((element, direct_access)) = access_sequence.split_first() else { unreachable!("") }; - let output = builder.build_struct_gep(parameter_struct, index, "").map_err(|_| { - Diagnostic::codegen_error( - format!("Cannot build generate parameter: {parameter:#?}"), - parameter.source_location.clone(), - ) - })?; + // Build index + let mut index = if let AstStatement::DirectAccess(data, ..) = element.get_stmt() { + self.generate_direct_access_index( + &data.access, + &data.index, + type_right.get_type_information(), + type_left, + ) + } else { + // TODO: using the global context we could get a slice here; currently not possible because the + // global context isn't passed into codegen + Err(Diagnostic::new(format!("{element:?} not a direct access")) + .with_error_code("E055") + .with_location(element.get_location())) + }?; + for element in direct_access { + let rhs_next = if let AstStatement::DirectAccess(data, ..) = element.get_stmt() { + self.generate_direct_access_index( + &data.access, + &data.index, + type_right.get_type_information(), + type_left, + ) + } else { + // TODO: using the global context we could get a slice here; currently not possible because the + // global context isn't passed into codegen + Err(Diagnostic::new(&format!("{element:?} not a direct access")) + .with_error_code("E055") + .with_location(element.get_location())) + }?; + index = self.llvm.builder.build_int_add(index, rhs_next, ""); + } - let output_value_type = - self.index.get_type_information_or_void(parameter.get_type_name()); - - if assigned_output_type.is_aggregate() && output_value_type.is_aggregate() { - self.build_memcpy( - assigned_output, - assigned_output_type, - expression.get_location(), - output, - output_value_type, - parameter.source_location.clone(), - )?; - } else { - let output_value = builder.build_load(output, ""); - builder.build_store(assigned_output, output_value); - } + //Build mask for the index + //Get the target bit type as all ones + let rhs_type = self.llvm_index.get_associated_type(type_right.get_name())?.into_int_type(); + let ones = rhs_type.const_all_ones(); + + //Extend the mask to the target type + let extended_mask = self.llvm.builder.build_int_z_extend(ones, left_value.get_type(), "ext"); + //Position the ones in their correct locations + let shifted_mask = self.llvm.builder.build_left_shift(extended_mask, index, "shift"); + //Invert the mask + let mask = self.llvm.builder.build_not(shifted_mask, "invert"); + //And the result with the mask to erase the set bits at the target location + let and_value = self.llvm.builder.build_and(left_value, mask, "erase"); + + //Cast the right side to the left side type + let lhs = cast_if_needed!(self, type_left, type_right, right_expr, None).into_int_value(); + //Shift left by the direct access + let value = self.llvm.builder.build_left_shift(lhs, index, "value"); + + //OR the result and store it in the left side + let or_value = self.llvm.builder.build_or(and_value, value, "or"); + self.llvm.builder.build_store(left_pointer, or_value); + + Ok(()) + } + + fn generate_output_assignment_with_direct_access( + &self, + left_statement: &AstNode, + left_pointer: PointerValue, + right_pointer: PointerValue, + right_type: &DataType, + ) -> Result<(), Diagnostic> { + let left_value = self.llvm.builder.build_load(left_pointer, "").into_int_value(); + + //Generate an expression for the right size + let right = self.llvm.builder.build_load(right_pointer, ""); + self.generate_assignment_with_direct_access( + left_statement, + left_value, + left_pointer, + right_type, + right, + )?; + + Ok(()) + } + + fn generate_output_assignment(&self, context: &CallParameterAssignment) -> Result<(), Diagnostic> { + let &CallParameterAssignment { assignment: expr, function_name, index, parameter_struct } = context; + let builder = &self.llvm.builder; + + // We don't want to generate any code if the right side of an assignment is empty, e.g. `foo(out =>)` + if expr.is_empty_statement() { + return Ok(()); + } + + let parameter = self.index.get_declared_parameter(function_name, index).expect("must exist"); + + match expr.get_stmt() { + AstStatement::ReferenceExpr(_) if expr.has_direct_access() => { + let rhs_type = { + let pou = self.index.find_pou(function_name).unwrap(); + let pou_struct = &pou.find_instance_struct_type(self.index).unwrap().information; + let DataTypeInformation::Struct { members, .. } = pou_struct else { unreachable!() }; + + self.index.find_effective_type_by_name(&members[index as usize].data_type_name).unwrap() + }; + + let AstStatement::ReferenceExpr(ReferenceExpr { + access: ReferenceAccess::Member(member), + base, + }) = &expr.get_stmt() + else { + unreachable!("must be a bitaccess, will return early for all other cases") + }; + + if let AstStatement::DirectAccess(_) = member.as_ref().get_stmt() { + // Given `foo.bar.baz.%W1.%B1.%X3`, we want to grab the base i.e. `foo.bar.baz` + let (Some(base), _) = (base, ..) else { panic!() }; + let (base, _) = collect_base_and_direct_access_for_assignment(base).unwrap(); + + let lhs = self.generate_expression_value(base)?.get_basic_value_enum(); + let rhs = self.llvm.builder.build_struct_gep(parameter_struct, index, "").unwrap(); + + self.generate_output_assignment_with_direct_access( + expr, + lhs.into_pointer_value(), + rhs, + rhs_type, + )?; + }; + } + + _ => { + let assigned_output = self.generate_lvalue(expr)?; + let assigned_output_type = + self.annotations.get_type_or_void(expr, self.index).get_type_information(); + + let output = builder.build_struct_gep(parameter_struct, index, "").map_err(|_| { + Diagnostic::codegen_error( + format!("Cannot build generate parameter: {parameter:#?}"), + parameter.source_location.clone(), + ) + })?; + + let output_value_type = self.index.get_type_information_or_void(parameter.get_type_name()); + + if assigned_output_type.is_aggregate() && output_value_type.is_aggregate() { + self.build_memcpy( + assigned_output, + assigned_output_type, + expr.get_location(), + output, + output_value_type, + parameter.source_location.clone(), + )?; + } else { + let output_value = builder.build_load(output, ""); + builder.build_store(assigned_output, output_value); } } - } + }; + Ok(()) } @@ -595,22 +750,25 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { &self, parameter_struct: PointerValue<'ink>, function_name: &str, - left: &AstNode, - right: &AstNode, + assignment: &Assignment, ) -> Result<(), Diagnostic> { + let Assignment { left, right } = assignment; + if let Some(StatementAnnotation::Variable { qualified_name, .. }) = self.annotations.get(left) { let parameter = self .index .find_fully_qualified_variable(qualified_name) .ok_or_else(|| Diagnostic::unresolved_reference(qualified_name, left.get_location()))?; let index = parameter.get_location_in_parent(); - self.assign_output_value(&CallParameterAssignment { - assignment_statement: right, + + self.generate_output_assignment(&CallParameterAssignment { + assignment: right, function_name, index, parameter_struct, })? }; + Ok(()) } @@ -973,7 +1131,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .unwrap_or_else(|| vec![parameter_struct.as_basic_value_enum().into()]); for (i, stmt) in passed_parameters.iter().enumerate() { let parameter = self.generate_call_struct_argument_assignment(&CallParameterAssignment { - assignment_statement: stmt, + assignment: stmt, function_name: pou_name, index: i as u32, parameter_struct, @@ -1049,7 +1207,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { &self, param_context: &CallParameterAssignment, ) -> Result>, Diagnostic> { - let parameter_value = match param_context.assignment_statement.get_stmt() { + let parameter_value = match param_context.assignment.get_stmt() { // explicit call parameter: foo(param := value) AstStatement::OutputAssignment(data) | AstStatement::Assignment(data) => { self.generate_formal_parameter(param_context, &data.left, &data.right)?; @@ -1072,7 +1230,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let function_name = param_context.function_name; let index = param_context.index; let parameter_struct = param_context.parameter_struct; - let expression = param_context.assignment_statement; + let expression = param_context.assignment; if let Some(parameter) = self.index.get_declared_parameter(function_name, index) { // this happens before the pou call // before the call statement we may only consider inputs and inouts @@ -1148,7 +1306,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { ); if !right.is_empty_statement() || is_auto_deref { self.generate_call_struct_argument_assignment(&CallParameterAssignment { - assignment_statement: right, + assignment: right, function_name, index, parameter_struct, @@ -2115,7 +2273,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { return Err(Diagnostic::codegen_error( format!("Cannot generate phi-expression for operator {operator:}"), left.get_location(), - )) + )); } }; @@ -2361,7 +2519,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { (ReferenceAccess::Member(member), base) => { let base_value = base.map(|it| self.generate_expression_value(it)).transpose()?; - if let AstStatement::DirectAccess (data) = member.as_ref().get_stmt() { + if let AstStatement::DirectAccess(data) = member.as_ref().get_stmt() { let (Some(base), Some(base_value)) = (base, base_value) else { return Err(Diagnostic::codegen_error("Cannot generate DirectAccess without base value.", original_expression.get_location())); }; @@ -2373,7 +2531,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.get_load_name(member).as_deref().unwrap_or(member_name), original_expression, ) - .map(ExpressionValue::LValue) + .map(ExpressionValue::LValue) } } @@ -2386,8 +2544,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.annotations.get(base).expect(""), array_idx.as_ref(), ) - .map_err(|_| unreachable!("invalid access statement")) - .map(ExpressionValue::LValue) + .map_err(|_| unreachable!("invalid access statement")) + .map(ExpressionValue::LValue) } else { // normal array expression self.generate_element_pointer_for_array(base, array_idx).map(ExpressionValue::LValue) @@ -2425,7 +2583,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { | (ReferenceAccess::Cast(_), None) // INT#; | (ReferenceAccess::Deref, None) // ^; | (ReferenceAccess::Address, None) // &; - => Err(Diagnostic::codegen_error( + => Err(Diagnostic::codegen_error( "Expected a base-expressions, but found none.", original_expression.get_location(), )), @@ -2646,3 +2804,32 @@ fn int_value_multiply_accumulate<'ink>( } llvm.builder.build_load(accum, "accessor").into_int_value() } + +// XXX: Could be problematic with https://github.com/PLC-lang/rusty/issues/668 +/// Returns false if any argument in the given list is an (output-)assignment and true otherwise +fn arguments_are_implicit(arguments: &[&AstNode]) -> bool { + !arguments.iter().any(|argument| argument.is_assignment() || argument.is_output_assignment()) +} + +/// when generating an assignment to a direct-access (e.g. a.b.c.%W3.%X2 := 2;) +/// we want to deconstruct the sequence into the base-statement (a.b.c) and the sequence +/// of direct-access commands (vec![%W3, %X2]) +fn collect_base_and_direct_access_for_assignment( + left_statement: &AstNode, +) -> Option<(&AstNode, Vec<&AstNode>)> { + let mut current = Some(left_statement); + let mut access_sequence = Vec::new(); + + while let Some(AstStatement::ReferenceExpr(ReferenceExpr { access: ReferenceAccess::Member(m), base })) = + current.map(|it| it.get_stmt()) + { + if matches!(m.get_stmt(), AstStatement::DirectAccess { .. }) { + access_sequence.insert(0, m.as_ref()); + current = base.as_deref(); + } else { + break; + } + } + + current.zip(Some(access_sequence)) +} diff --git a/src/codegen/generators/statement_generator.rs b/src/codegen/generators/statement_generator.rs index 40b36c193f..30d125f57f 100644 --- a/src/codegen/generators/statement_generator.rs +++ b/src/codegen/generators/statement_generator.rs @@ -4,11 +4,11 @@ use super::{ llvm::Llvm, }; use crate::{ - codegen::{debug::Debug, llvm_typesystem::cast_if_needed}, + codegen::debug::Debug, codegen::{debug::DebugBuilderEnum, LlvmTypedIndex}, index::{ImplementationIndexEntry, Index}, resolver::{AnnotationMap, AstAnnotations, StatementAnnotation}, - typesystem::{self, DataTypeInformation}, + typesystem::DataTypeInformation, }; use inkwell::{ basic_block::BasicBlock, @@ -244,7 +244,7 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { self.register_debug_location(left_statement); //TODO: Looks hacky, the strings will be similar so we should look into making the assignment a bit nicer. if left_statement.has_direct_access() { - return self.generate_direct_access_assignment(left_statement, right_statement); + return self.generate_assignment_statement_direct_access(left_statement, right_statement); } //TODO: Also hacky but for now we cannot generate assignments for hardware access if matches!(left_statement.get_stmt(), AstStatement::HardwareAccess { .. }) { @@ -279,96 +279,32 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { self.debug.set_debug_location(self.llvm, &self.function_context.function, line, column); } - fn generate_direct_access_assignment( + fn generate_assignment_statement_direct_access( &self, left_statement: &AstNode, right_statement: &AstNode, ) -> Result<(), Diagnostic> { - //TODO : Validation let exp_gen = self.create_expr_generator(); - // given a complex direct-access assignemnt: a.b.c.%W3,%X1 - // we want to deconstruct the targe-part (a.b.c) and the direct-access sequence (%W3.%X1) - let Some((target, access_sequence)) = collect_base_and_direct_access_for_assignment(left_statement) - else { + // Left pointer + let Some((base, _)) = collect_base_and_direct_access_for_assignment(left_statement) else { unreachable!("Invalid direct-access expression: {left_statement:#?}") }; + let left_expr_value = exp_gen.generate_expression_value(base)?; + let left_value = left_expr_value.as_r_value(self.llvm, None).into_int_value(); + let left_pointer = left_expr_value.get_basic_value_enum().into_pointer_value(); - let left_type = exp_gen.get_type_hint_for(target)?; + // Generate an expression for the right size let right_type = exp_gen.get_type_hint_for(right_statement)?; - - //special case if we deal with a single bit, then we need to switch to a faked u1 type - let right_type = - if let DataTypeInformation::Integer { semantic_size: Some(typesystem::U1_SIZE), .. } = - *right_type.get_type_information() - { - self.index.get_type_or_panic(typesystem::U1_TYPE) - } else { - right_type - }; - - //Left pointer - let left_expression_value = exp_gen.generate_expression_value(target)?; - let left_value = left_expression_value.as_r_value(self.llvm, None).into_int_value(); - let left = left_expression_value.get_basic_value_enum().into_pointer_value(); - //Build index - if let Some((element, direct_access)) = access_sequence.split_first() { - let mut rhs = if let AstStatement::DirectAccess(data, ..) = element.get_stmt() { - exp_gen.generate_direct_access_index( - &data.access, - &data.index, - right_type.get_type_information(), - left_type, - ) - } else { - //TODO: using the global context we could get a slice here - Err(Diagnostic::new(format!("{element:?} not a direct access")) - .with_error_code("E055") - .with_location(element.get_location())) - }?; - for element in direct_access { - let rhs_next = if let AstStatement::DirectAccess(data, ..) = element.get_stmt() { - exp_gen.generate_direct_access_index( - &data.access, - &data.index, - right_type.get_type_information(), - left_type, - ) - } else { - //TODO: using the global context we could get a slice here - Err(Diagnostic::new(&format!("{element:?} not a direct access")) - .with_error_code("E055") - .with_location(element.get_location())) - }?; - rhs = self.llvm.builder.build_int_add(rhs, rhs_next, ""); - } - //Build mask for the index - //Get the target bit type as all ones - let rhs_type = self.llvm_index.get_associated_type(right_type.get_name())?.into_int_type(); - let ones = rhs_type.const_all_ones(); - //Extend the mask to the target type - let extended_mask = self.llvm.builder.build_int_z_extend(ones, left_value.get_type(), "ext"); - //Position the ones in their correct locations - let shifted_mask = self.llvm.builder.build_left_shift(extended_mask, rhs, "shift"); - //Invert the mask - let mask = self.llvm.builder.build_not(shifted_mask, "invert"); - //And the result with the mask to erase the set bits at the target location - let and_value = self.llvm.builder.build_and(left_value, mask, "erase"); - - //Generate an expression for the right size - let right = exp_gen.generate_expression(right_statement)?; - //Cast the right side to the left side type - let lhs = cast_if_needed!(self, left_type, right_type, right, None).into_int_value(); - //Shift left by the direct access - let value = self.llvm.builder.build_left_shift(lhs, rhs, "value"); - - //OR the result and store it in the left side - let or_value = self.llvm.builder.build_or(and_value, value, "or"); - self.llvm.builder.build_store(left, or_value); - } else { - unreachable!(); - } - Ok(()) + let right_expr = exp_gen.generate_expression(right_statement)?; + + exp_gen.generate_assignment_with_direct_access( + left_statement, + left_value, + left_pointer, + right_type, + right_expr, + ) } /// generates a for-loop statement @@ -842,9 +778,8 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { } } -/// when generating an assignment to a direct-access (e.g. a.b.c.%W3.%X2 := 2;) -/// we want to deconstruct the sequence into the base-statement (a.b.c) and the sequence -/// of direct-access commands (vec![%W3, %X2]) +/// Deconstructs assignments such as `a.b.c.%W3.%X2 := 2` into a base statement and its direct-access sequences. +/// For the given example this function would return `(Node(a.b.c), vec![Node(%W3), Node(%X2)])` fn collect_base_and_direct_access_for_assignment( left_statement: &AstNode, ) -> Option<(&AstNode, Vec<&AstNode>)> { diff --git a/src/codegen/tests/directaccess_test.rs b/src/codegen/tests/directaccess_test.rs index df69af8891..26e2604ff3 100644 --- a/src/codegen/tests/directaccess_test.rs +++ b/src/codegen/tests/directaccess_test.rs @@ -1,3 +1,4 @@ +use insta::assert_snapshot; // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use crate::test_utils::tests::codegen; @@ -112,3 +113,327 @@ fn qualified_reference_assignment() { ); insta::assert_snapshot!(prog); } + +#[test] +fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { + let ir = codegen( + r" + FUNCTION_BLOCK FOO + VAR_INPUT + X : BOOL; + END_VAR + VAR_OUTPUT + Y : BOOL; + END_VAR + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + error_bits : BYTE; + f : FOO; + END_VAR + + f(X := error_bits.0, Y => error_bits.0); + f(Y => error_bits.0, x := error_bits.0); + f(error_bits.0, error_bits.0); + f(X := error_bits.0, Y =>); + END_FUNCTION + ", + ); + + assert_snapshot!(ir, @r###" + ; ModuleID = 'main' + source_filename = "main" + + %FOO = type { i8, i8 } + + @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-$RUSTY$__FOO__init:r2u8u8" + + define void @FOO(%FOO* %0) section "fn-$RUSTY$FOO:v[u8][u8]" { + entry: + %X = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 + %Y = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 + ret void + } + + define i32 @main() section "fn-$RUSTY$main:i32" { + entry: + %main = alloca i32, align 4 + %error_bits = alloca i8, align 1 + %f = alloca %FOO, align 8 + store i8 0, i8* %error_bits, align 1 + %0 = bitcast %FOO* %f to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) + store i32 0, i32* %main, align 4 + %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %load_error_bits = load i8, i8* %error_bits, align 1 + %shift = lshr i8 %load_error_bits, 0 + %2 = and i8 %shift, 1 + store i8 %2, i8* %1, align 1 + call void @FOO(%FOO* %f) + %3 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 + %4 = load i8, i8* %error_bits, align 1 + %5 = load i8, i8* %3, align 1 + %erase = and i8 %4, -2 + %value = shl i8 %5, 0 + %or = or i8 %erase, %value + store i8 %or, i8* %error_bits, align 1 + %6 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %load_error_bits1 = load i8, i8* %error_bits, align 1 + %shift2 = lshr i8 %load_error_bits1, 0 + %7 = and i8 %shift2, 1 + store i8 %7, i8* %6, align 1 + call void @FOO(%FOO* %f) + %8 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 + %9 = load i8, i8* %error_bits, align 1 + %10 = load i8, i8* %8, align 1 + %erase3 = and i8 %9, -2 + %value4 = shl i8 %10, 0 + %or5 = or i8 %erase3, %value4 + store i8 %or5, i8* %error_bits, align 1 + %11 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %load_error_bits6 = load i8, i8* %error_bits, align 1 + %shift7 = lshr i8 %load_error_bits6, 0 + %12 = and i8 %shift7, 1 + store i8 %12, i8* %11, align 1 + call void @FOO(%FOO* %f) + %13 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 + %14 = load i8, i8* %error_bits, align 1 + %15 = load i8, i8* %13, align 1 + %erase8 = and i8 %14, -2 + %value9 = shl i8 %15, 0 + %or10 = or i8 %erase8, %value9 + store i8 %or10, i8* %error_bits, align 1 + %16 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %load_error_bits11 = load i8, i8* %error_bits, align 1 + %shift12 = lshr i8 %load_error_bits11, 0 + %17 = and i8 %shift12, 1 + store i8 %17, i8* %16, align 1 + call void @FOO(%FOO* %f) + %main_ret = load i32, i32* %main, align 4 + ret i32 %main_ret + } + + ; Function Attrs: argmemonly nofree nounwind willreturn + declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + + attributes #0 = { argmemonly nofree nounwind willreturn } + "###); +} + +#[test] +fn direct_acess_in_output_assignment_with_simple_expression() { + let ir = codegen( + r" + FUNCTION_BLOCK FOO + VAR_OUTPUT + Q : BOOL := TRUE; + END_VAR + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + error_bits : BYTE := 2#1110_1111; + f : FOO; + END_VAR + + f(Q => error_bits.4); + END_FUNCTION + ", + ); + + assert_snapshot!(ir, @r###" + ; ModuleID = 'main' + source_filename = "main" + + %FOO = type { i8 } + + @__FOO__init = unnamed_addr constant %FOO { i8 1 }, section "var-$RUSTY$__FOO__init:r1u8" + + define void @FOO(%FOO* %0) section "fn-$RUSTY$FOO:v[u8]" { + entry: + %Q = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 + ret void + } + + define i32 @main() section "fn-$RUSTY$main:i32" { + entry: + %main = alloca i32, align 4 + %error_bits = alloca i8, align 1 + %f = alloca %FOO, align 8 + store i8 -17, i8* %error_bits, align 1 + %0 = bitcast %FOO* %f to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) + store i32 0, i32* %main, align 4 + call void @FOO(%FOO* %f) + %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %2 = load i8, i8* %error_bits, align 1 + %3 = load i8, i8* %1, align 1 + %erase = and i8 %2, -17 + %value = shl i8 %3, 4 + %or = or i8 %erase, %value + store i8 %or, i8* %error_bits, align 1 + %main_ret = load i32, i32* %main, align 4 + ret i32 %main_ret + } + + ; Function Attrs: argmemonly nofree nounwind willreturn + declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + + attributes #0 = { argmemonly nofree nounwind willreturn } + "###); +} + +#[test] +fn direct_acess_in_output_assignment_with_simple_expression_implicit() { + let ir = codegen( + r" + FUNCTION_BLOCK FOO + VAR_OUTPUT + Q : BOOL := TRUE; + END_VAR + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + error_bits : BYTE := 2#1110_1111; + f : FOO; + END_VAR + + f(error_bits.4); + END_FUNCTION + ", + ); + + assert_snapshot!(ir, @r###" + ; ModuleID = 'main' + source_filename = "main" + + %FOO = type { i8 } + + @__FOO__init = unnamed_addr constant %FOO { i8 1 }, section "var-$RUSTY$__FOO__init:r1u8" + + define void @FOO(%FOO* %0) section "fn-$RUSTY$FOO:v[u8]" { + entry: + %Q = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 + ret void + } + + define i32 @main() section "fn-$RUSTY$main:i32" { + entry: + %main = alloca i32, align 4 + %error_bits = alloca i8, align 1 + %f = alloca %FOO, align 8 + store i8 -17, i8* %error_bits, align 1 + %0 = bitcast %FOO* %f to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) + store i32 0, i32* %main, align 4 + call void @FOO(%FOO* %f) + %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 + %2 = load i8, i8* %error_bits, align 1 + %3 = load i8, i8* %1, align 1 + %erase = and i8 %2, -17 + %value = shl i8 %3, 4 + %or = or i8 %erase, %value + store i8 %or, i8* %error_bits, align 1 + %main_ret = load i32, i32* %main, align 4 + ret i32 %main_ret + } + + ; Function Attrs: argmemonly nofree nounwind willreturn + declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + + attributes #0 = { argmemonly nofree nounwind willreturn } + "###); +} + +#[test] +fn direct_acess_in_output_assignment_with_complexe_expression() { + let ir = codegen( + r" + TYPE foo_struct : STRUCT + bar : bar_struct; + END_STRUCT END_TYPE + + TYPE bar_struct : STRUCT + baz : LWORD; + END_STRUCT END_TYPE + + FUNCTION_BLOCK QUUX + VAR_OUTPUT + Q : BOOL; + END_VAR + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + foo : foo_struct; + f : QUUX; + END_VAR + + f(Q => foo.bar.baz.%W3); + f(Q => foo.bar.baz.%W3.%B0.%X2); + END_FUNCTION + ", + ); + + assert_snapshot!(ir, @r###" + ; ModuleID = 'main' + source_filename = "main" + + %QUUX = type { i8 } + %foo_struct = type { %bar_struct } + %bar_struct = type { i64 } + + @__QUUX__init = unnamed_addr constant %QUUX zeroinitializer, section "var-$RUSTY$__QUUX__init:r1u8" + @__foo_struct__init = unnamed_addr constant %foo_struct zeroinitializer, section "var-$RUSTY$__foo_struct__init:r1r1u64" + @__bar_struct__init = unnamed_addr constant %bar_struct zeroinitializer, section "var-$RUSTY$__bar_struct__init:r1u64" + + define void @QUUX(%QUUX* %0) section "fn-$RUSTY$QUUX:v[u8]" { + entry: + %Q = getelementptr inbounds %QUUX, %QUUX* %0, i32 0, i32 0 + ret void + } + + define i32 @main() section "fn-$RUSTY$main:i32" { + entry: + %main = alloca i32, align 4 + %foo = alloca %foo_struct, align 8 + %f = alloca %QUUX, align 8 + %0 = bitcast %foo_struct* %foo to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo_struct* @__foo_struct__init to i8*), i64 ptrtoint (%foo_struct* getelementptr (%foo_struct, %foo_struct* null, i32 1) to i64), i1 false) + %1 = bitcast %QUUX* %f to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds (%QUUX, %QUUX* @__QUUX__init, i32 0, i32 0), i64 ptrtoint (%QUUX* getelementptr (%QUUX, %QUUX* null, i32 1) to i64), i1 false) + store i32 0, i32* %main, align 4 + call void @QUUX(%QUUX* %f) + %bar = getelementptr inbounds %foo_struct, %foo_struct* %foo, i32 0, i32 0 + %baz = getelementptr inbounds %bar_struct, %bar_struct* %bar, i32 0, i32 0 + %2 = getelementptr inbounds %QUUX, %QUUX* %f, i32 0, i32 0 + %3 = load i64, i64* %baz, align 4 + %4 = load i8, i8* %2, align 1 + %erase = and i64 %3, -281474976710657 + %5 = zext i8 %4 to i64 + %value = shl i64 %5, 48 + %or = or i64 %erase, %value + store i64 %or, i64* %baz, align 4 + call void @QUUX(%QUUX* %f) + %bar1 = getelementptr inbounds %foo_struct, %foo_struct* %foo, i32 0, i32 0 + %baz2 = getelementptr inbounds %bar_struct, %bar_struct* %bar1, i32 0, i32 0 + %6 = getelementptr inbounds %QUUX, %QUUX* %f, i32 0, i32 0 + %7 = load i64, i64* %baz2, align 4 + %8 = load i8, i8* %6, align 1 + %erase3 = and i64 %7, -1125899906842625 + %9 = zext i8 %8 to i64 + %value4 = shl i64 %9, 50 + %or5 = or i64 %erase3, %value4 + store i64 %or5, i64* %baz2, align 4 + %main_ret = load i32, i32* %main, align 4 + ret i32 %main_ret + } + + ; Function Attrs: argmemonly nofree nounwind willreturn + declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + + attributes #0 = { argmemonly nofree nounwind willreturn } + "###); +} diff --git a/src/index.rs b/src/index.rs index 11be9a5d1a..cb0fdd9837 100644 --- a/src/index.rs +++ b/src/index.rs @@ -347,6 +347,12 @@ pub enum VariableType { Return, } +impl VariableType { + pub fn is_output(&self) -> bool { + matches!(self, VariableType::Output) + } +} + impl std::fmt::Display for VariableType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { diff --git a/src/resolver.rs b/src/resolver.rs index 6bf25261a2..a77e99ad46 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -545,7 +545,10 @@ pub trait AnnotationMap { fn get_qualified_name(&self, s: &AstNode) -> Option<&str> { match self.get(s) { - Some(StatementAnnotation::Function { qualified_name, .. }) => Some(qualified_name.as_str()), + Some(StatementAnnotation::Function { qualified_name, .. }) + | Some(StatementAnnotation::Variable { qualified_name, .. }) + | Some(StatementAnnotation::Program { qualified_name, .. }) => Some(qualified_name.as_str()), + _ => self.get_call_name(s), } } diff --git a/tests/correctness/bitaccess.rs b/tests/correctness/bitaccess.rs index 06d6e6728f..a412bf4f6a 100644 --- a/tests/correctness/bitaccess.rs +++ b/tests/correctness/bitaccess.rs @@ -1,5 +1,9 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder +// TODO: Some of these tests are incorrect, because a `default()` call will override the values defined in the +// VAR block. Thus any tests relying on data initialized in the VAR block needs to be updated such that +// the initialization happens in the POU body. However, this won't be any issue once we convert to LIT. + use crate::*; use pretty_assertions::assert_eq; @@ -214,3 +218,125 @@ fn byteaccess_assignment_should_not_override_current_values() { let res: i32 = compile_and_run(prog, &mut crate::MainType::default); assert_eq!(res, 0b0000_0000_1100_0011_1010_1010_0101_0101); } + +#[test] +fn bitaccess_in_output_assignments_with_simple_expression() { + let prog = " + FUNCTION_BLOCK foo + VAR_OUTPUT + OUT_FALSE : BOOL; + OUT_TRUE : BOOL; + END_VAR + + OUT_TRUE := TRUE; + OUT_FALSE := FALSE; + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + a : BYTE; + END_VAR + + VAR_TEMP + foo_instance : foo; + END_VAR + + a := 2#1010_1010; + + // Invert these ~~bitc-~~bits + foo_instance(OUT_TRUE => a.0); + foo_instance(OUT_TRUE => a.2); + foo_instance(OUT_TRUE => a.4); + foo_instance(OUT_TRUE => a.6); + + foo_instance(OUT_FALSE => a.1); + foo_instance(OUT_FALSE => a.3); + foo_instance(OUT_FALSE => a.5); + foo_instance(OUT_FALSE => a.7); + + main := a; + END_FUNCTION"; + + let res: i32 = compile_and_run(prog, &mut crate::MainType::default()); + assert_eq!(res, 0b0101_0101); +} + +#[test] +fn bitaccess_in_output_assignment_with_complexish_expression() { + let prog = " + TYPE foo_struct : STRUCT + bar : bar_struct; + END_STRUCT END_TYPE + + TYPE bar_struct : STRUCT + baz : DINT; // 0000_0000_0000_0000_0000_0000_0000_0000 + END_STRUCT END_TYPE + + FUNCTION_BLOCK QUUX + VAR_OUTPUT + Q : BOOL; + END_VAR + + Q := TRUE; + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + foo : foo_struct; + f : QUUX; + END_VAR + + foo.bar.baz := 0; // ...just to be sure + + + // foo.bar.baz: 0000_0000_0000_0000_0000_0000_0000_0000 + f(Q => foo.bar.baz.%W1.%B1.%X3); // 0000_1000_0000_0000_0000_0000_0000_0000 + f(Q => foo.bar.baz.%W1.%B1.%X1); // 0000_1010_0000_0000_0000_0000_0000_0000 + main := foo.bar.baz; + END_FUNCTION + "; + + let res: i32 = compile_and_run(prog, &mut crate::MainType::default()); + assert_eq!(res, 0b0000_1010_0000_0000_0000_0000_0000_0000); +} + +#[test] +fn bitaccess_in_output_assignment_with_complexish_expression_implicit() { + let prog = " + TYPE foo_struct : STRUCT + bar : bar_struct; + END_STRUCT END_TYPE + + TYPE bar_struct : STRUCT + baz : DINT; // 0000_0000_0000_0000_0000_0000_0000_0000 + END_STRUCT END_TYPE + + FUNCTION_BLOCK QUUX + VAR_INPUT + x : DINT; + END_VAR + VAR_OUTPUT + Q : BOOL; + END_VAR + + Q := TRUE; + END_FUNCTION_BLOCK + + FUNCTION main : DINT + VAR + foo : foo_struct; + f : QUUX; + END_VAR + + foo.bar.baz := 0; // ...just to be sure + + // foo.bar.baz: 0000_0000_0000_0000_0000_0000_0000_0000 + f(x := 0, Q => foo.bar.baz.%W1.%B1.%X3); // 0000_1000_0000_0000_0000_0000_0000_0000 + f(0, foo.bar.baz.%W1.%B1.%X1); // 0000_1010_0000_0000_0000_0000_0000_0000 + main := foo.bar.baz; + END_FUNCTION + "; + + let res: i32 = compile_and_run(prog, &mut crate::MainType::default()); + assert_eq!(res, 0b0000_1010_0000_0000_0000_0000_0000_0000); +} From ef09b87e731e0f7df9a3fda6be6ccffb6c031d48 Mon Sep 17 00:00:00 2001 From: Michael <78988079+mhasel@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:13:21 +0200 Subject: [PATCH 24/40] fix: for loops no longer execute once when condition is already met (#1248) * fix: for loop condition This PR fixes for loops executing once when the predicate already should not be met for decrementing loops. I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more readable IR. Resolves #1207 --- src/codegen/generators/statement_generator.rs | 199 +++++++++--------- src/codegen/tests/code_gen_tests.rs | 139 ++++++++++++ ...gging__for_conditions_location_marked.snap | 75 ++----- ...ode_gen_tests__for_statement_continue.snap | 72 ++----- ...ts__code_gen_tests__for_statement_int.snap | 76 ++----- ...s__code_gen_tests__for_statement_lint.snap | 72 ++----- ...s__code_gen_tests__for_statement_sint.snap | 76 ++----- ...en_tests__for_statement_with_continue.snap | 82 ++------ ...de_gen_tests__for_statement_with_exit.snap | 80 ++----- ..._statement_with_references_steps_test.snap | 84 +++----- ..._tests__for_statement_with_steps_test.snap | 72 ++----- ...sts__for_statement_without_steps_test.snap | 72 ++----- tests/correctness/control_flow.rs | 103 +++++++++ 13 files changed, 542 insertions(+), 660 deletions(-) diff --git a/src/codegen/generators/statement_generator.rs b/src/codegen/generators/statement_generator.rs index 30d125f57f..d9edbd130c 100644 --- a/src/codegen/generators/statement_generator.rs +++ b/src/codegen/generators/statement_generator.rs @@ -1,20 +1,23 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use super::{ - expression_generator::{to_i1, ExpressionCodeGenerator}, + expression_generator::{to_i1, ExpressionCodeGenerator, ExpressionValue}, llvm::Llvm, }; use crate::{ - codegen::debug::Debug, - codegen::{debug::DebugBuilderEnum, LlvmTypedIndex}, + codegen::{ + debug::{Debug, DebugBuilderEnum}, + llvm_typesystem::cast_if_needed, + LlvmTypedIndex, + }, index::{ImplementationIndexEntry, Index}, resolver::{AnnotationMap, AstAnnotations, StatementAnnotation}, - typesystem::DataTypeInformation, + typesystem::{get_bigger_type, DataTypeInformation, DINT_TYPE}, }; use inkwell::{ basic_block::BasicBlock, builder::Builder, context::Context, - values::{BasicValueEnum, FunctionValue, PointerValue}, + values::{FunctionValue, PointerValue}, }; use plc_ast::{ ast::{ @@ -325,117 +328,107 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { body: &[AstNode], ) -> Result<(), Diagnostic> { let (builder, current_function, context) = self.get_llvm_deps(); - self.generate_assignment_statement(counter, start)?; - let condition_check = context.append_basic_block(current_function, "condition_check"); - let for_body = context.append_basic_block(current_function, "for_body"); - let increment_block = context.append_basic_block(current_function, "increment"); - let continue_block = context.append_basic_block(current_function, "continue"); - - //Generate an initial jump to the for condition - builder.build_unconditional_branch(condition_check); - - //Check loop condition - builder.position_at_end(condition_check); let exp_gen = self.create_expr_generator(); - let counter_statement = exp_gen.generate_expression(counter)?; - //. / and_2 \ - //. / and 1 \ - //. (counter_end_le && counter_start_ge) || (counter_end_ge && counter_start_le) - let or_eval = self.generate_compare_expression(counter, end, start, &exp_gen)?; + let end_ty = self.annotations.get_type_or_void(end, self.index); + let counter_ty = self.annotations.get_type_or_void(counter, self.index); + let cast_target_ty = get_bigger_type(self.index.get_type_or_panic(DINT_TYPE), counter_ty, self.index); + let cast_target_llty = self.llvm_index.find_associated_type(cast_target_ty.get_name()).unwrap(); + + let step_ty = by_step.as_ref().map(|it| { + self.register_debug_location(it); + self.annotations.get_type_or_void(it, self.index) + }); + + let eval_step = || { + step_ty.map_or_else( + || self.llvm.create_const_numeric(&cast_target_llty, "1", SourceLocation::undefined()), + |step_ty| { + let step = exp_gen.generate_expression(by_step.as_ref().unwrap())?; + Ok(cast_if_needed!(exp_gen, cast_target_ty, step_ty, step, None)) + }, + ) + }; - builder.build_conditional_branch(to_i1(or_eval.into_int_value(), builder), for_body, continue_block); + let predicate_incrementing = context.append_basic_block(current_function, "predicate_sle"); + let predicate_decrementing = context.append_basic_block(current_function, "predicate_sge"); + let loop_body = context.append_basic_block(current_function, "loop"); + let increment = context.append_basic_block(current_function, "increment"); + let afterloop = context.append_basic_block(current_function, "continue"); - //Enter the for loop - builder.position_at_end(for_body); - let body_generator = StatementCodeGenerator { - current_loop_exit: Some(continue_block), - current_loop_continue: Some(increment_block), + self.generate_assignment_statement(counter, start)?; + let counter = exp_gen.generate_lvalue(counter)?; + + // generate loop predicate selector. since `STEP` can be a reference, this needs to be a runtime eval + // XXX(mhasel): IR could possibly be improved by generating phi instructions. + // Candidate for frontend optimization for builds without optimization when `STEP` + // is a compile-time constant + let is_incrementing = builder.build_int_compare( + inkwell::IntPredicate::SGT, + eval_step()?.into_int_value(), + self.llvm + .create_const_numeric(&cast_target_llty, "0", SourceLocation::undefined())? + .into_int_value(), + "is_incrementing", + ); + builder.build_conditional_branch(is_incrementing, predicate_incrementing, predicate_decrementing); + // generate predicates for incrementing and decrementing counters + let generate_predicate = |predicate| { + builder.position_at_end(match predicate { + inkwell::IntPredicate::SLE => predicate_incrementing, + inkwell::IntPredicate::SGE => predicate_decrementing, + _ => unreachable!(), + }); + + let end = exp_gen.generate_expression_value(end).unwrap(); + let end_value = match end { + ExpressionValue::LValue(ptr) => builder.build_load(ptr, ""), + ExpressionValue::RValue(val) => val, + }; + let counter_value = builder.build_load(counter, ""); + let cmp = builder.build_int_compare( + predicate, + cast_if_needed!(exp_gen, cast_target_ty, counter_ty, counter_value, None).into_int_value(), + cast_if_needed!(exp_gen, cast_target_ty, end_ty, end_value, None).into_int_value(), + "condition", + ); + builder.build_conditional_branch(cmp, loop_body, afterloop); + }; + generate_predicate(inkwell::IntPredicate::SLE); + generate_predicate(inkwell::IntPredicate::SGE); + + // generate loop body + builder.position_at_end(loop_body); + let body_builder = StatementCodeGenerator { + current_loop_continue: Some(increment), + current_loop_exit: Some(afterloop), load_prefix: self.load_prefix.clone(), load_suffix: self.load_suffix.clone(), ..*self }; - body_generator.generate_body(body)?; - builder.build_unconditional_branch(increment_block); - - //Increment - builder.position_at_end(increment_block); - let expression_generator = self.create_expr_generator(); - let step_by_value = by_step.as_ref().map_or_else( - || { - self.llvm.create_const_numeric( - &counter_statement.get_type(), - "1", - SourceLocation::undefined(), - ) - }, - |step| { - self.register_debug_location(step); - expression_generator.generate_expression(step) - }, - )?; - - let next = builder.build_int_add( - counter_statement.into_int_value(), - step_by_value.into_int_value(), - "tmpVar", + body_builder.generate_body(body)?; + + // increment counter + builder.build_unconditional_branch(increment); + builder.position_at_end(increment); + let counter_value = builder.build_load(counter, ""); + let inc = inkwell::values::BasicValue::as_basic_value_enum(&builder.build_int_add( + eval_step()?.into_int_value(), + cast_if_needed!(exp_gen, cast_target_ty, counter_ty, counter_value, None).into_int_value(), + "next", + )); + builder.build_store( + counter, + cast_if_needed!(exp_gen, counter_ty, cast_target_ty, inc, None).into_int_value(), ); - let ptr = expression_generator.generate_lvalue(counter)?; - builder.build_store(ptr, next); - - //Loop back - builder.build_unconditional_branch(condition_check); - - //Continue - builder.position_at_end(continue_block); - + // check condition + builder.build_conditional_branch(is_incrementing, predicate_incrementing, predicate_decrementing); + // continue + builder.position_at_end(afterloop); Ok(()) } - fn generate_compare_expression( - &'a self, - counter: &AstNode, - end: &AstNode, - start: &AstNode, - exp_gen: &'a ExpressionCodeGenerator, - ) -> Result, Diagnostic> { - let bool_id = self.annotations.get_bool_id(); - let counter_end_ge = AstFactory::create_binary_expression( - counter.clone(), - Operator::GreaterOrEqual, - end.clone(), - bool_id, - ); - let counter_start_ge = AstFactory::create_binary_expression( - counter.clone(), - Operator::GreaterOrEqual, - start.clone(), - bool_id, - ); - let counter_end_le = AstFactory::create_binary_expression( - counter.clone(), - Operator::LessOrEqual, - end.clone(), - bool_id, - ); - let counter_start_le = AstFactory::create_binary_expression( - counter.clone(), - Operator::LessOrEqual, - start.clone(), - bool_id, - ); - let and_1 = - AstFactory::create_binary_expression(counter_end_le, Operator::And, counter_start_ge, bool_id); - let and_2 = - AstFactory::create_binary_expression(counter_end_ge, Operator::And, counter_start_le, bool_id); - let or = AstFactory::create_binary_expression(and_1, Operator::Or, and_2, bool_id); - - self.register_debug_location(&or); - let or_eval = exp_gen.generate_expression(&or)?; - Ok(or_eval) - } - /// genertes a case statement /// /// CASE selector OF diff --git a/src/codegen/tests/code_gen_tests.rs b/src/codegen/tests/code_gen_tests.rs index d149b7df35..0d34a3dfd5 100644 --- a/src/codegen/tests/code_gen_tests.rs +++ b/src/codegen/tests/code_gen_tests.rs @@ -1155,6 +1155,145 @@ fn for_statement_with_references_steps_test() { insta::assert_snapshot!(result); } +#[test] +fn for_statement_with_binary_expressions() { + let result = codegen( + " + PROGRAM prg + VAR + step: DINT; + x : DINT; + y : DINT; + z : DINT; + END_VAR + FOR x := y + 1 TO z - 2 BY step * 3 DO + x; + END_FOR + END_PROGRAM + ", + ); + + insta::assert_snapshot!(result, @r###" + ; ModuleID = 'main' + source_filename = "main" + + %prg = type { i32, i32, i32, i32 } + + @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i32i32i32i32" + + define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + entry: + %step = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 + %load_y = load i32, i32* %y, align 4 + %tmpVar = add i32 %load_y, 1 + store i32 %tmpVar, i32* %x, align 4 + %load_step = load i32, i32* %step, align 4 + %tmpVar1 = mul i32 %load_step, 3 + %is_incrementing = icmp sgt i32 %tmpVar1, 0 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge + + predicate_sle: ; preds = %increment, %entry + %load_z = load i32, i32* %z, align 4 + %tmpVar2 = sub i32 %load_z, 2 + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, %tmpVar2 + br i1 %condition, label %loop, label %continue + + predicate_sge: ; preds = %increment, %entry + %load_z3 = load i32, i32* %z, align 4 + %tmpVar4 = sub i32 %load_z3, 2 + %2 = load i32, i32* %x, align 4 + %condition5 = icmp sge i32 %2, %tmpVar4 + br i1 %condition5, label %loop, label %continue + + loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 + br label %increment + + increment: ; preds = %loop + %3 = load i32, i32* %x, align 4 + %load_step6 = load i32, i32* %step, align 4 + %tmpVar7 = mul i32 %load_step6, 3 + %next = add i32 %tmpVar7, %3 + store i32 %next, i32* %x, align 4 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge + + continue: ; preds = %predicate_sge, %predicate_sle + ret void + } + "###); +} + +#[test] +fn for_statement_type_casting() { + let result = codegen( + "FUNCTION main + VAR + a: USINT; + b: INT := 1; + END_VAR + FOR a := 0 TO 10 BY b DO + b := b * 3; + END_FOR + END_FUNCTION", + ); + insta::assert_snapshot!(result, @r###" + ; ModuleID = 'main' + source_filename = "main" + + define void @main() section "fn-$RUSTY$main:v" { + entry: + %a = alloca i8, align 1 + %b = alloca i16, align 2 + store i8 0, i8* %a, align 1 + store i16 1, i16* %b, align 2 + store i8 0, i8* %a, align 1 + %load_b = load i16, i16* %b, align 2 + %0 = trunc i16 %load_b to i8 + %1 = sext i8 %0 to i32 + %is_incrementing = icmp sgt i32 %1, 0 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge + + predicate_sle: ; preds = %increment, %entry + %2 = load i8, i8* %a, align 1 + %3 = zext i8 %2 to i32 + %condition = icmp sle i32 %3, 10 + br i1 %condition, label %loop, label %continue + + predicate_sge: ; preds = %increment, %entry + %4 = load i8, i8* %a, align 1 + %5 = zext i8 %4 to i32 + %condition1 = icmp sge i32 %5, 10 + br i1 %condition1, label %loop, label %continue + + loop: ; preds = %predicate_sge, %predicate_sle + %load_b2 = load i16, i16* %b, align 2 + %6 = sext i16 %load_b2 to i32 + %tmpVar = mul i32 %6, 3 + %7 = trunc i32 %tmpVar to i16 + store i16 %7, i16* %b, align 2 + br label %increment + + increment: ; preds = %loop + %8 = load i8, i8* %a, align 1 + %load_b3 = load i16, i16* %b, align 2 + %9 = trunc i16 %load_b3 to i8 + %10 = sext i8 %9 to i32 + %11 = zext i8 %8 to i32 + %next = add i32 %10, %11 + %12 = trunc i32 %next to i8 + store i8 %12, i8* %a, align 1 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge + + continue: ; preds = %predicate_sge, %predicate_sle + ret void + } + "###); +} + #[test] fn while_statement() { let result = codegen( diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index 113f95b2ce..6e12617d29 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -11,67 +11,31 @@ entry: call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 store i32 0, i32* %myFunc, align 4, !dbg !8 store i32 1, i32* %myFunc, align 4, !dbg !12 - br label %condition_check, !dbg !12 + br i1 true, label %predicate_sle, label %predicate_sge, !dbg !12 -condition_check: ; preds = %increment, %entry - %load_myFunc = load i32, i32* %myFunc, align 4, !dbg !12 - %load_myFunc1 = load i32, i32* %myFunc, align 4, !dbg !12 - %tmpVar = icmp sle i32 %load_myFunc1, 20, !dbg !12 - %0 = zext i1 %tmpVar to i8, !dbg !12 - %1 = icmp ne i8 %0, 0, !dbg !12 - br i1 %1, label %2, label %5, !dbg !12 +predicate_sle: ; preds = %increment, %entry + %0 = load i32, i32* %myFunc, align 4, !dbg !12 + %condition = icmp sle i32 %0, 20, !dbg !12 + br i1 %condition, label %loop, label %continue, !dbg !12 -for_body: ; preds = %12 +predicate_sge: ; preds = %increment, %entry + %1 = load i32, i32* %myFunc, align 4, !dbg !12 + %condition1 = icmp sge i32 %1, 20, !dbg !12 + br i1 %condition1, label %loop, label %continue, !dbg !12 + +loop: ; preds = %predicate_sge, %predicate_sle store i32 1, i32* %myFunc, align 4, !dbg !13 br label %increment, !dbg !13 -increment: ; preds = %for_body - %tmpVar8 = add i32 %load_myFunc, 2, !dbg !14 - store i32 %tmpVar8, i32* %myFunc, align 4, !dbg !14 - br label %condition_check, !dbg !14 - -continue: ; preds = %12 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !14 - ret i32 %myFunc_ret, !dbg !14 - -2: ; preds = %condition_check - %load_myFunc2 = load i32, i32* %myFunc, align 4, !dbg !12 - %tmpVar3 = icmp sge i32 %load_myFunc2, 1, !dbg !12 - %3 = zext i1 %tmpVar3 to i8, !dbg !12 - %4 = icmp ne i8 %3, 0, !dbg !12 - br label %5, !dbg !12 - -5: ; preds = %2, %condition_check - %6 = phi i1 [ %1, %condition_check ], [ %4, %2 ], !dbg !12 - %7 = zext i1 %6 to i8, !dbg !12 - %8 = icmp ne i8 %7, 0, !dbg !12 - br i1 %8, label %12, label %9, !dbg !12 - -9: ; preds = %5 - %load_myFunc4 = load i32, i32* %myFunc, align 4, !dbg !12 - %tmpVar5 = icmp sge i32 %load_myFunc4, 20, !dbg !12 - %10 = zext i1 %tmpVar5 to i8, !dbg !12 - %11 = icmp ne i8 %10, 0, !dbg !12 - br i1 %11, label %16, label %19, !dbg !12 - -12: ; preds = %19, %5 - %13 = phi i1 [ %8, %5 ], [ %22, %19 ], !dbg !12 - %14 = zext i1 %13 to i8, !dbg !12 - %15 = icmp ne i8 %14, 0, !dbg !12 - br i1 %15, label %for_body, label %continue, !dbg !12 - -16: ; preds = %9 - %load_myFunc6 = load i32, i32* %myFunc, align 4, !dbg !12 - %tmpVar7 = icmp sle i32 %load_myFunc6, 1, !dbg !12 - %17 = zext i1 %tmpVar7 to i8, !dbg !12 - %18 = icmp ne i8 %17, 0, !dbg !12 - br label %19, !dbg !12 +increment: ; preds = %loop + %2 = load i32, i32* %myFunc, align 4, !dbg !13 + %next = add i32 2, %2, !dbg !13 + store i32 %next, i32* %myFunc, align 4, !dbg !13 + br i1 true, label %predicate_sle, label %predicate_sge, !dbg !13 -19: ; preds = %16, %9 - %20 = phi i1 [ %11, %9 ], [ %18, %16 ], !dbg !12 - %21 = zext i1 %20 to i8, !dbg !12 - %22 = icmp ne i8 %21, 0, !dbg !12 - br label %12, !dbg !12 +continue: ; preds = %predicate_sge, %predicate_sle + %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !13 + ret i32 %myFunc_ret, !dbg !13 } ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn @@ -96,4 +60,3 @@ attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } !11 = !DILocation(line: 2, column: 17, scope: !4) !12 = !DILocation(line: 3, column: 16, scope: !4) !13 = !DILocation(line: 4, column: 16, scope: !4) -!14 = !DILocation(line: 3, column: 37, scope: !4) 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 9f41468169..ccff95cd6e 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 @@ -13,64 +13,28 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %tmpVar = icmp sle i32 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 +loop: ; preds = %predicate_sge, %predicate_sle br label %increment -increment: ; preds = %for_body - %tmpVar8 = add i32 %load_x, 1 - store i32 %tmpVar8, i32* %x, align 4 - br label %condition_check +increment: ; preds = %loop + %3 = load i32, i32* %x, align 4 + %next = add i32 1, %3 + store i32 %next, i32* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 - %load_x9 = load i32, i32* %x, align 4 +continue: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %tmpVar3 = icmp sge i32 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i32, i32* %x, align 4 - %tmpVar5 = icmp sge i32 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i32, i32* %x, align 4 - %tmpVar7 = icmp sle i32 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 2dca83f31a..58c3bc0e70 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 @@ -13,64 +13,32 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i16 3, i16* %x, align 2 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i16, i16* %x, align 2 - %load_x1 = load i16, i16* %x, align 2 - %tmpVar = icmp sle i16 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i16, i16* %x, align 2 + %2 = sext i16 %1 to i32 + %condition = icmp sle i32 %2, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %3 = load i16, i16* %x, align 2 + %4 = sext i16 %3 to i32 + %condition1 = icmp sge i32 %4, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i16, i16* %x, align 2 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i16, i16* %x, align 2 br label %increment -increment: ; preds = %for_body - %tmpVar9 = add i16 %load_x, 1 - store i16 %tmpVar9, i16* %x, align 2 - br label %condition_check +increment: ; preds = %loop + %5 = load i16, i16* %x, align 2 + %6 = sext i16 %5 to i32 + %next = add i32 1, %6 + %7 = trunc i32 %next to i16 + store i16 %7, i16* %x, align 2 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i16, i16* %x, align 2 - %tmpVar3 = icmp sge i16 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i16, i16* %x, align 2 - %tmpVar5 = icmp sge i16 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i16, i16* %x, align 2 - %tmpVar7 = icmp sle i16 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 0310b77ae1..f0ba938547 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 @@ -13,64 +13,28 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 3, i64* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i64, i64* %x, align 4 - %load_x1 = load i64, i64* %x, align 4 - %tmpVar = icmp sle i64 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i64, i64* %x, align 4 + %condition = icmp sle i64 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i64, i64* %x, align 4 + %condition1 = icmp sge i64 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i64, i64* %x, align 4 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i64, i64* %x, align 4 br label %increment -increment: ; preds = %for_body - %tmpVar9 = add i64 %load_x, 1 - store i64 %tmpVar9, i64* %x, align 4 - br label %condition_check +increment: ; preds = %loop + %3 = load i64, i64* %x, align 4 + %next = add i64 1, %3 + store i64 %next, i64* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i64, i64* %x, align 4 - %tmpVar3 = icmp sge i64 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i64, i64* %x, align 4 - %tmpVar5 = icmp sge i64 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i64, i64* %x, align 4 - %tmpVar7 = icmp sle i64 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 9d83bc8b7d..939f4cbb48 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 @@ -13,64 +13,32 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 3, i8* %x, align 1 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i8, i8* %x, align 1 - %load_x1 = load i8, i8* %x, align 1 - %tmpVar = icmp sle i8 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i8, i8* %x, align 1 + %2 = sext i8 %1 to i32 + %condition = icmp sle i32 %2, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %3 = load i8, i8* %x, align 1 + %4 = sext i8 %3 to i32 + %condition1 = icmp sge i32 %4, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i8, i8* %x, align 1 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i8, i8* %x, align 1 br label %increment -increment: ; preds = %for_body - %tmpVar9 = add i8 %load_x, 1 - store i8 %tmpVar9, i8* %x, align 1 - br label %condition_check +increment: ; preds = %loop + %5 = load i8, i8* %x, align 1 + %6 = sext i8 %5 to i32 + %next = add i32 1, %6 + %7 = trunc i32 %next to i8 + store i8 %7, i8* %x, align 1 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i8, i8* %x, align 1 - %tmpVar3 = icmp sge i8 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i8, i8* %x, align 1 - %tmpVar5 = icmp sge i8 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i8, i8* %x, align 1 - %tmpVar7 = icmp sle i8 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 08569854f0..d8dcfd34db 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 @@ -13,72 +13,36 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %tmpVar = icmp sle i32 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i32, i32* %x, align 4 - %tmpVar9 = add i32 %load_x8, 1 - store i32 %tmpVar9, i32* %x, align 4 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 + %tmpVar = add i32 %load_x, 1 + store i32 %tmpVar, i32* %x, align 4 br label %increment buffer_block: ; No predecessors! - %load_x10 = load i32, i32* %x, align 4 - %tmpVar11 = sub i32 %load_x10, 1 - store i32 %tmpVar11, i32* %x, align 4 + %load_x2 = load i32, i32* %x, align 4 + %tmpVar3 = sub i32 %load_x2, 1 + store i32 %tmpVar3, i32* %x, align 4 br label %increment -increment: ; preds = %buffer_block, %for_body - %tmpVar12 = add i32 %load_x, 7 - store i32 %tmpVar12, i32* %x, align 4 - br label %condition_check +increment: ; preds = %buffer_block, %loop + %3 = load i32, i32* %x, align 4 + %next = add i32 7, %3 + store i32 %next, i32* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %tmpVar3 = icmp sge i32 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i32, i32* %x, align 4 - %tmpVar5 = icmp sge i32 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i32, i32* %x, align 4 - %tmpVar7 = icmp sle i32 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 1a9a034b13..00a9396ea4 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 @@ -13,72 +13,36 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %tmpVar = icmp sle i32 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i32, i32* %x, align 4 - %tmpVar9 = add i32 %load_x8, 2 - store i32 %tmpVar9, i32* %x, align 4 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 + %tmpVar = add i32 %load_x, 2 + store i32 %tmpVar, i32* %x, align 4 br label %continue buffer_block: ; No predecessors! - %load_x10 = load i32, i32* %x, align 4 - %tmpVar11 = add i32 %load_x10, 5 - store i32 %tmpVar11, i32* %x, align 4 + %load_x2 = load i32, i32* %x, align 4 + %tmpVar3 = add i32 %load_x2, 5 + store i32 %tmpVar3, i32* %x, align 4 br label %increment increment: ; preds = %buffer_block - %tmpVar12 = add i32 %load_x, 7 - store i32 %tmpVar12, i32* %x, align 4 - br label %condition_check + %3 = load i32, i32* %x, align 4 + %next = add i32 7, %3 + store i32 %next, i32* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %for_body, %13 +continue: ; preds = %loop, %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %tmpVar3 = icmp sge i32 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i32, i32* %x, align 4 - %tmpVar5 = icmp sge i32 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i32, i32* %x, align 4 - %tmpVar7 = icmp sle i32 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 a3881483a7..28d0351a43 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 @@ -17,69 +17,33 @@ entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 %load_y = load i32, i32* %y, align 4 store i32 %load_y, i32* %x, align 4 - br label %condition_check - -condition_check: ; preds = %increment, %entry + %load_step = load i32, i32* %step, align 4 + %is_incrementing = icmp sgt i32 %load_step, 0 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge + +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %z, align 4 + %2 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %2, %1 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %3 = load i32, i32* %z, align 4 + %4 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %4, %3 + br i1 %condition1, label %loop, label %continue + +loop: ; preds = %predicate_sge, %predicate_sle %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %load_z = load i32, i32* %z, align 4 - %tmpVar = icmp sle i32 %load_x1, %load_z - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 - -for_body: ; preds = %13 - %load_x11 = load i32, i32* %x, align 4 br label %increment -increment: ; preds = %for_body - %load_step = load i32, i32* %step, align 4 - %tmpVar12 = add i32 %load_x, %load_step - store i32 %tmpVar12, i32* %x, align 4 - br label %condition_check +increment: ; preds = %loop + %5 = load i32, i32* %x, align 4 + %load_step2 = load i32, i32* %step, align 4 + %next = add i32 %load_step2, %5 + store i32 %next, i32* %x, align 4 + br i1 %is_incrementing, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %load_y3 = load i32, i32* %y, align 4 - %tmpVar4 = icmp sge i32 %load_x2, %load_y3 - %4 = zext i1 %tmpVar4 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x5 = load i32, i32* %x, align 4 - %load_z6 = load i32, i32* %z, align 4 - %tmpVar7 = icmp sge i32 %load_x5, %load_z6 - %11 = zext i1 %tmpVar7 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x8 = load i32, i32* %x, align 4 - %load_y9 = load i32, i32* %y, align 4 - %tmpVar10 = icmp sle i32 %load_x8, %load_y9 - %18 = zext i1 %tmpVar10 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 f0bb8cb4e5..d32995dea1 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 @@ -13,64 +13,28 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %tmpVar = icmp sle i32 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i32, i32* %x, align 4 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 br label %increment -increment: ; preds = %for_body - %tmpVar9 = add i32 %load_x, 7 - store i32 %tmpVar9, i32* %x, align 4 - br label %condition_check +increment: ; preds = %loop + %3 = load i32, i32* %x, align 4 + %next = add i32 7, %3 + store i32 %next, i32* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %tmpVar3 = icmp sge i32 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i32, i32* %x, align 4 - %tmpVar5 = icmp sge i32 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i32, i32* %x, align 4 - %tmpVar7 = icmp sle i32 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } 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 6c28295463..411285a0cc 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 @@ -13,64 +13,28 @@ define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 - br label %condition_check + br i1 true, label %predicate_sle, label %predicate_sge -condition_check: ; preds = %increment, %entry - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 - %tmpVar = icmp sle i32 %load_x1, 10 - %1 = zext i1 %tmpVar to i8 - %2 = icmp ne i8 %1, 0 - br i1 %2, label %3, label %6 +predicate_sle: ; preds = %increment, %entry + %1 = load i32, i32* %x, align 4 + %condition = icmp sle i32 %1, 10 + br i1 %condition, label %loop, label %continue + +predicate_sge: ; preds = %increment, %entry + %2 = load i32, i32* %x, align 4 + %condition1 = icmp sge i32 %2, 10 + br i1 %condition1, label %loop, label %continue -for_body: ; preds = %13 - %load_x8 = load i32, i32* %x, align 4 +loop: ; preds = %predicate_sge, %predicate_sle + %load_x = load i32, i32* %x, align 4 br label %increment -increment: ; preds = %for_body - %tmpVar9 = add i32 %load_x, 1 - store i32 %tmpVar9, i32* %x, align 4 - br label %condition_check +increment: ; preds = %loop + %3 = load i32, i32* %x, align 4 + %next = add i32 1, %3 + store i32 %next, i32* %x, align 4 + br i1 true, label %predicate_sle, label %predicate_sge -continue: ; preds = %13 +continue: ; preds = %predicate_sge, %predicate_sle ret void - -3: ; preds = %condition_check - %load_x2 = load i32, i32* %x, align 4 - %tmpVar3 = icmp sge i32 %load_x2, 3 - %4 = zext i1 %tmpVar3 to i8 - %5 = icmp ne i8 %4, 0 - br label %6 - -6: ; preds = %3, %condition_check - %7 = phi i1 [ %2, %condition_check ], [ %5, %3 ] - %8 = zext i1 %7 to i8 - %9 = icmp ne i8 %8, 0 - br i1 %9, label %13, label %10 - -10: ; preds = %6 - %load_x4 = load i32, i32* %x, align 4 - %tmpVar5 = icmp sge i32 %load_x4, 10 - %11 = zext i1 %tmpVar5 to i8 - %12 = icmp ne i8 %11, 0 - br i1 %12, label %17, label %20 - -13: ; preds = %20, %6 - %14 = phi i1 [ %9, %6 ], [ %23, %20 ] - %15 = zext i1 %14 to i8 - %16 = icmp ne i8 %15, 0 - br i1 %16, label %for_body, label %continue - -17: ; preds = %10 - %load_x6 = load i32, i32* %x, align 4 - %tmpVar7 = icmp sle i32 %load_x6, 3 - %18 = zext i1 %tmpVar7 to i8 - %19 = icmp ne i8 %18, 0 - br label %20 - -20: ; preds = %17, %10 - %21 = phi i1 [ %12, %10 ], [ %19, %17 ] - %22 = zext i1 %21 to i8 - %23 = icmp ne i8 %22, 0 - br label %13 } diff --git a/tests/correctness/control_flow.rs b/tests/correctness/control_flow.rs index d84495f16a..cef4a61aef 100644 --- a/tests/correctness/control_flow.rs +++ b/tests/correctness/control_flow.rs @@ -483,6 +483,109 @@ fn for_loop_and_increment_10_times_skipping_1() { assert_eq!(res, 1005); } +#[test] +fn for_loop_does_not_execute_if_condition_is_not_met() { + let function = r#" + FUNCTION main : DINT + VAR + i, end, step, res: DINT; + END_VAR + end := -1; + step := -1; + res := 100; + + FOR i := end TO 0 BY step DO + res := i; + END_FOR + + main := res; + END_FUNCTION + "#; + + let res: i32 = compile_and_run(function.to_string(), &mut crate::MainType::default()); + assert_eq!(res, 100); +} + +#[test] +fn for_loop_step_changes_sign_in_loop_body() { + let function = r#" + FUNCTION main : DINT + VAR + i, step, temp, iteration: DINT; + END_VAR + step := 1; + iteration := 0; + + FOR i := 5 TO 10 BY step DO + temp := (step + 1) * -1 ; + IF i + temp > 0 THEN + step := temp; + ELSE + step := step + 3; + END_IF; + + // i: 5, 3, 4, 2, 3, 1, 2, 6, 1, 5, 12 + // step: -2, 1, -2, 1, -2, 1, 4, -5, 4, 7 + iteration := iteration + 1; + END_FOR + + main := iteration; + END_FUNCTION + "#; + + let res: i32 = compile_and_run(function.to_string(), &mut crate::MainType::default()); + assert_eq!(res, 10); +} + +#[test] +fn for_loop_step_and_counter_change_sign_in_loop_body() { + let function = r#" + FUNCTION main : DINT + VAR + i, step, temp, iteration: DINT; + END_VAR + step := 1; + iteration := 0; + + FOR i := 3 TO 10 BY step DO + step := (step + 1) * -2; + + // i: 3, -1, 5, -9, 17 + // step: -4, 5, -14, 26 + iteration := iteration + 1; + END_FOR + + main := iteration; + END_FUNCTION + "#; + + let res: i32 = compile_and_run(function.to_string(), &mut crate::MainType::default()); + assert_eq!(res, 4); +} + +#[test] +fn for_loop_statement_with_binary_expressions() { + let function = r#" + FUNCTION main : DINT + VAR + step: DINT := 1; + x, y, iteration : DINT; + z : DINT := 25; + END_VAR + // 1 TO 23 BY 3 + FOR x := y + 1 TO z - 2 BY step * 3 DO + // x: 1, 4, 7, 10, 13, 16, 19, 22 + iteration := iteration + 1; + END_FOR + + main := iteration; + END_FUNCTION + "#; + + let res: i32 = compile_and_run(function.to_string(), &mut crate::MainType::default()); + assert_eq!(res, 8); +} + #[test] fn while_loop_no_entry() { let function = r#" From 4aea520a6a3422ffc1b7170933712922d0877610 Mon Sep 17 00:00:00 2001 From: Neil Turley <79152732+nturley-copia@users.noreply.github.com> Date: Tue, 9 Jul 2024 01:31:22 -0600 Subject: [PATCH 25/40] feat: Add --ast CLI argument to emit the AST to stdout (#1256) * add ast cli argument to print the AST to stdout * use pretty printed format Co-authored-by: Volkan --------- Co-authored-by: Volkan --- compiler/plc_driver/src/cli.rs | 24 ++++++++++++++++++++++++ compiler/plc_driver/src/lib.rs | 5 +++++ src/resolver.rs | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/compiler/plc_driver/src/cli.rs b/compiler/plc_driver/src/cli.rs index b086c79cfd..20ab63fae9 100644 --- a/compiler/plc_driver/src/cli.rs +++ b/compiler/plc_driver/src/cli.rs @@ -22,6 +22,14 @@ pub struct CompileParameters { #[clap(short, long, global = true, name = "output-file", help = "Write output to ")] pub output: Option, + #[clap( + long = "ast", + group = "format", + global = true, + help = "Emit AST (Abstract Syntax Tree) as output" + )] + pub output_ast: bool, + #[clap( long = "ir", group = "format", @@ -637,6 +645,16 @@ mod cli_tests { fn valid_output_formats() { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--ir")).unwrap(); assert!(parameters.output_ir); + assert!(!parameters.output_ast); + assert!(!parameters.output_bit_code); + assert!(!parameters.output_obj_code); + assert!(!parameters.output_pic_obj); + assert!(!parameters.output_shared_obj); + assert!(!parameters.output_reloc_code); + + let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--ast")).unwrap(); + assert!(!parameters.output_ir); + assert!(parameters.output_ast); assert!(!parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(!parameters.output_pic_obj); @@ -645,6 +663,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--bc")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(!parameters.output_pic_obj); @@ -653,6 +672,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--static")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(!parameters.output_bit_code); assert!(parameters.output_obj_code); assert!(!parameters.output_pic_obj); @@ -661,6 +681,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--pic")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(!parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(parameters.output_pic_obj); @@ -669,6 +690,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--shared")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(!parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(!parameters.output_pic_obj); @@ -677,6 +699,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st", "--relocatable")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(!parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(!parameters.output_pic_obj); @@ -685,6 +708,7 @@ mod cli_tests { let parameters = CompileParameters::parse(vec_of_strings!("input.st")).unwrap(); assert!(!parameters.output_ir); + assert!(!parameters.output_ast); assert!(!parameters.output_bit_code); assert!(!parameters.output_obj_code); assert!(!parameters.output_pic_obj); diff --git a/compiler/plc_driver/src/lib.rs b/compiler/plc_driver/src/lib.rs index 750095032c..142a901863 100644 --- a/compiler/plc_driver/src/lib.rs +++ b/compiler/plc_driver/src/lib.rs @@ -247,6 +247,11 @@ pub fn compile_with_options(compile_options: CompilationContext) -> Result<()> { .index(ctxt.provider()) .annotate(ctxt.provider()); + if compile_parameters.output_ast { + println!("{:#?}", annotated_project.units); + return Ok(()); + } + // 4 : Validate annotated_project.validate(&ctxt, &mut diagnostician)?; diff --git a/src/resolver.rs b/src/resolver.rs index a77e99ad46..58186c0a8c 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -701,7 +701,7 @@ impl AnnotationMap for AnnotationMapImpl { } } -#[derive(Default)] +#[derive(Default, Debug)] pub struct StringLiterals { pub utf08: FxHashSet, pub utf16: FxHashSet, From 79abdb6f8c8255303ba5bffe8ba562931398e583 Mon Sep 17 00:00:00 2001 From: Volkan Date: Wed, 10 Jul 2024 15:33:40 +0200 Subject: [PATCH 26/40] feat: Introduce `REF=` and `REFERENCE_TO` (#1251) This PR introduces two new keywords, namely `REF=` and `REFERENCE TO`: * `REF=` is essentially syntactic sugar for an assignment where the right-hand side is wrapped in a `REF()` function call. Therefore `foo := REF(bar)` and `foo REF= bar` are equivalent. * `REFERENCE TO` is identical to `REF_TO` with the exception of being auto-deref by default. A variable `foo` declared as `REFERENCE TO` will therefore auto-deref on assignments, i.e. `foo := 5` is equivalent to `foo^ := 5`. More information on CodeSys' [REF=](https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_ref_assignment/) and [REFERENCE TO](https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_datatype_reference/) documentation pages. --- compiler/plc_ast/src/ast.rs | 34 ++- compiler/plc_ast/src/visitor.rs | 10 + .../src/diagnostics/diagnostics_registry.rs | 2 + .../src/diagnostics/error_codes/E098.md | 19 ++ .../src/diagnostics/error_codes/E099.md | 8 + .../generators/expression_generator.rs | 3 +- src/codegen/generators/statement_generator.rs | 29 +- src/codegen/tests/statement_codegen_test.rs | 124 ++++++++ src/index.rs | 1 + src/index/tests/index_tests.rs | 4 + ...generates_inline_pointer_to_pointer-2.snap | 2 + ...g_generates_inline_pointer_to_pointer.snap | 2 + ..._processing_generates_inline_pointers.snap | 2 + ...g_generates_pointer_to_pointer_type-2.snap | 2 + ...ing_generates_pointer_to_pointer_type.snap | 2 + src/index/visitor.rs | 8 +- src/lexer/tokens.rs | 6 + src/parser.rs | 24 +- src/parser/expressions_parser.rs | 16 +- .../parse_error_statements_tests.rs | 4 + ...r_tests__global_pointer_declaration-2.snap | 2 + ...ser_tests__global_pointer_declaration.snap | 2 + ..._type_parser_tests__pointer_type_test.snap | 2 + ...sts__type_parser_tests__ref_type_test.snap | 2 + src/parser/tests/statement_parser_tests.rs | 78 ++++- src/resolver.rs | 26 +- src/resolver/generics.rs | 10 +- .../tests/resolve_expressions_tests.rs | 38 ++- src/resolver/tests/resolve_literals_tests.rs | 3 +- src/tests/adr/annotated_ast_adr.rs | 9 +- src/tests/adr/vla_adr.rs | 1 + src/typesystem.rs | 9 +- src/validation/statement.rs | 90 +++++- .../tests/assignment_validation_tests.rs | 274 ++++++++++++++++++ ...ts__constant_fb_instances_are_illegal.snap | 10 +- src/validation/variable.rs | 54 +++- tests/integration/cfc/resolver_tests.rs | 1 + ...r_tests__action_variables_annotated-3.snap | 1 + ...r_tests__action_variables_annotated-4.snap | 1 + .../single/pointer/ref_assignment_operator.st | 11 + .../pointer/referenceto_variable_autoderef.st | 28 ++ .../referenceto_variable_referencing_array.st | 15 + ...referenceto_variable_referencing_itself.st | 17 ++ ..._referencing_other_referenceto_variable.st | 15 + ...referenceto_variable_referencing_struct.st | 24 ++ 45 files changed, 971 insertions(+), 54 deletions(-) create mode 100644 compiler/plc_diagnostics/src/diagnostics/error_codes/E098.md create mode 100644 compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md create mode 100644 tests/lit/single/pointer/ref_assignment_operator.st create mode 100644 tests/lit/single/pointer/referenceto_variable_autoderef.st create mode 100644 tests/lit/single/pointer/referenceto_variable_referencing_array.st create mode 100644 tests/lit/single/pointer/referenceto_variable_referencing_itself.st create mode 100644 tests/lit/single/pointer/referenceto_variable_referencing_other_referenceto_variable.st create mode 100644 tests/lit/single/pointer/referenceto_variable_referencing_struct.st diff --git a/compiler/plc_ast/src/ast.rs b/compiler/plc_ast/src/ast.rs index e7353608c2..20ce291232 100644 --- a/compiler/plc_ast/src/ast.rs +++ b/compiler/plc_ast/src/ast.rs @@ -487,6 +487,9 @@ pub enum DataType { PointerType { name: Option, referenced_type: Box, + auto_deref: bool, + /// Denotes whether the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT` + is_reference_to: bool, }, StringType { name: Option, @@ -596,11 +599,14 @@ pub struct AstNode { #[derive(Debug, Clone, PartialEq)] pub enum AstStatement { EmptyStatement(EmptyStatement), - // a placeholder that indicates a default value of a datatype + + // A placeholder which indicates a default value of a datatype DefaultValue(DefaultValue), + // Literals Literal(AstLiteral), MultipliedStatement(MultipliedStatement), + // Expressions ReferenceExpr(ReferenceExpr), Identifier(String), @@ -612,15 +618,17 @@ pub enum AstStatement { ParenExpression(Box), RangeStatement(RangeStatement), VlaRangeStatement, - // Assignment + + // TODO: Merge these variants with a `kind` field? + // Assignments Assignment(Assignment), - // OutputAssignment OutputAssignment(Assignment), - //Call Statement + RefAssignment(Assignment), + CallStatement(CallStatement), + // Control Statements ControlStatement(AstControlStatement), - CaseCondition(Box), ExitStatement(()), ContinueStatement(()), @@ -661,6 +669,9 @@ impl Debug for AstNode { AstStatement::OutputAssignment(Assignment { left, right }) => { f.debug_struct("OutputAssignment").field("left", left).field("right", right).finish() } + AstStatement::RefAssignment(Assignment { left, right }) => { + f.debug_struct("ReferenceAssignment").field("left", left).field("right", right).finish() + } AstStatement::CallStatement(CallStatement { operator, parameters }) => f .debug_struct("CallStatement") .field("operator", operator) @@ -1319,6 +1330,19 @@ impl AstFactory { ) } + // TODO: Merge `create_assignment`, `create_output_assignment` and `create_ref_assignment` + // once the the Assignment AstStatements have been merged and a `kind` field is available + // I.e. something like `AstStatement::Assignment { data, kind: AssignmentKind { Normal, Output, Reference } } + // and then fn create_assignment(kind: AssignmentKind, ...) + pub fn create_ref_assignment(left: AstNode, right: AstNode, id: AstId) -> AstNode { + let location = left.location.span(&right.location); + AstNode::new( + AstStatement::RefAssignment(Assignment { left: Box::new(left), right: Box::new(right) }), + id, + location, + ) + } + pub fn create_member_reference(member: AstNode, base: Option, id: AstId) -> AstNode { let location = base .as_ref() diff --git a/compiler/plc_ast/src/visitor.rs b/compiler/plc_ast/src/visitor.rs index 0aab9108ea..c50b7c3c1b 100644 --- a/compiler/plc_ast/src/visitor.rs +++ b/compiler/plc_ast/src/visitor.rs @@ -312,6 +312,15 @@ pub trait AstVisitor: Sized { stmt.walk(self) } + /// Visits an `RefAssignment` node. + /// Make sure to call `walk` on the `Assignment` node to visit its children. + /// # Arguments + /// * `stmt` - The unwraped, typed `Assignment` node to visit. + /// * `node` - The wrapped `AstNode` node to visit. Offers access to location information and AstId + fn visit_ref_assignment(&mut self, stmt: &Assignment, _node: &AstNode) { + stmt.walk(self) + } + /// Visits a `CallStatement` node. /// Make sure to call `walk` on the `CallStatement` node to visit its children. /// # Arguments @@ -556,6 +565,7 @@ impl Walker for AstNode { AstStatement::VlaRangeStatement => visitor.visit_vla_range_statement(node), AstStatement::Assignment(stmt) => visitor.visit_assignment(stmt, node), AstStatement::OutputAssignment(stmt) => visitor.visit_output_assignment(stmt, node), + AstStatement::RefAssignment(stmt) => visitor.visit_ref_assignment(stmt, node), AstStatement::CallStatement(stmt) => visitor.visit_call_statement(stmt, node), AstStatement::ControlStatement(stmt) => visitor.visit_control_statement(stmt, node), AstStatement::CaseCondition(stmt) => visitor.visit_case_condition(stmt, node), diff --git a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs index f076bdf045..874f1c4eb1 100644 --- a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs +++ b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs @@ -199,6 +199,8 @@ lazy_static! { E095, Error, include_str!("./error_codes/E095.md"), // Action call without `()` E096, Warning, include_str!("./error_codes/E096.md"), // Integer Condition E097, Error, include_str!("./error_codes/E097.md"), // Invalid Array Range + E098, Error, include_str!("./error_codes/E098.md"), // Invalid `REF=` assignment + E099, Error, include_str!("./error_codes/E099.md"), // Invalid `REFERENCE TO` declaration ); } diff --git a/compiler/plc_diagnostics/src/diagnostics/error_codes/E098.md b/compiler/plc_diagnostics/src/diagnostics/error_codes/E098.md new file mode 100644 index 0000000000..f550271947 --- /dev/null +++ b/compiler/plc_diagnostics/src/diagnostics/error_codes/E098.md @@ -0,0 +1,19 @@ +# Invalid REF= assignment + +`REF=` assignments are considered valid if the left-hand side of the assignment is a pointer variable +and the right-hand side is a variable of the type that is being referenced. + +For example assignments such as the following are invalid + +```smalltalk +VAR + foo : DINT; + bar : DINT; + qux : SINT; + refFoo : REFERENCE TO DINT; +END_VAR + +refFoo REF= 5; // `5` is not a variable +foo REF= bar; // `foo` is not a pointer +refFoo REF= qux; // `refFoo` and `qux` have different types, DINT vs SINT +``` \ No newline at end of file diff --git a/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md b/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md new file mode 100644 index 0000000000..d327378250 --- /dev/null +++ b/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md @@ -0,0 +1,8 @@ +# Invalid `REFERENCE TO` declaration + +`REFERENCE TO` variable declarations are considered valid if the referenced type is not of the following form +* `foo : REFERENCE TO REFERENCE TO (* ... *)` +* `foo : ARRAY[...] OF REFERENCE TO (* ... *)` +* `foo : REF_TO REFERENCE TO (* ... *)` + +Furthermore `REFERENCE_TO` variables must not be initialized in their declaration, e.g. `foo : REFERENCE TO DINT := bar`. \ No newline at end of file diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index 3ad0a9abf7..b9a1941bb5 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -2507,14 +2507,13 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { /// - `access` the ReferenceAccess of the reference to generate /// - `base` the "previous" segment of an optional qualified reference-access /// - `original_expression` the original ast-statement used to report Diagnostics - fn generate_reference_expression( + pub(crate) fn generate_reference_expression( &self, access: &ReferenceAccess, base: Option<&AstNode>, original_expression: &AstNode, ) -> Result, Diagnostic> { match (access, base) { - // expressions like `base.member`, or just `member` (ReferenceAccess::Member(member), base) => { let base_value = base.map(|it| self.generate_expression_value(it)).transpose()?; diff --git a/src/codegen/generators/statement_generator.rs b/src/codegen/generators/statement_generator.rs index d9edbd130c..7c053ddf93 100644 --- a/src/codegen/generators/statement_generator.rs +++ b/src/codegen/generators/statement_generator.rs @@ -125,7 +125,9 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { AstStatement::Assignment(data, ..) => { self.generate_assignment_statement(&data.left, &data.right)?; } - + AstStatement::RefAssignment(data, ..) => { + self.generate_ref_assignment(&data.left, &data.right)?; + } AstStatement::ControlStatement(ctl_statement, ..) => { self.generate_control_statement(ctl_statement)? } @@ -234,6 +236,31 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { } } + /// Generates IR for a `REF=` assignment, which is syntactic sugar for an assignment where the + /// right-hand side is wrapped in a `REF(...)` call. Specifically `foo REF= bar` and + /// `foo := REF(bar)` are the same. + /// + /// Note: Although somewhat similar to the [`generate_assignment_statement`] function, we can't + /// apply the code here because the left side of a `REF=` assignment is flagged as auto-deref. + /// For `REF=` assignments we don't want (and can't) deref without generating incorrect IR. + pub fn generate_ref_assignment(&self, left: &AstNode, right: &AstNode) -> Result<(), Diagnostic> { + let exp = self.create_expr_generator(); + let ref_builtin = self.index.get_builtin_function("REF").expect("REF must exist"); + + let AstStatement::ReferenceExpr(data) = &left.stmt else { + unreachable!("should be covered by a validation") + }; + + let left_ptr_val = { + let expr = exp.generate_reference_expression(&data.access, data.base.as_deref(), left)?; + expr.get_basic_value_enum().into_pointer_value() + }; + let right_expr_val = ref_builtin.codegen(&exp, &[&right], right.get_location())?; + + self.llvm.builder.build_store(left_ptr_val, right_expr_val.get_basic_value_enum()); + Ok(()) + } + /// generates an assignment statement _left_ := _right_ /// /// `left_statement` the left side of the assignment diff --git a/src/codegen/tests/statement_codegen_test.rs b/src/codegen/tests/statement_codegen_test.rs index b4dd2e88ca..9f8a4db6d0 100644 --- a/src/codegen/tests/statement_codegen_test.rs +++ b/src/codegen/tests/statement_codegen_test.rs @@ -184,3 +184,127 @@ fn floating_point_type_casting() { insta::assert_snapshot!(result); } + +#[test] +fn ref_assignment() { + let result = codegen( + r#" + FUNCTION main + VAR + a : REF_TO DINT; + b : DINT; + END_VAR + a REF= b; + END_PROGRAM + "#, + ); + + insta::assert_snapshot!(result, @r###" + ; ModuleID = 'main' + source_filename = "main" + + define void @main() section "fn-$RUSTY$main:v" { + entry: + %a = alloca i32*, align 8 + %b = alloca i32, align 4 + store i32* null, i32** %a, align 8 + store i32 0, i32* %b, align 4 + store i32* %b, i32** %a, align 8 + ret void + } + "###); +} + +#[test] +fn reference_to_assignment() { + let auto_deref = codegen( + r#" + FUNCTION main + VAR + a : REFERENCE TO DINT; + END_VAR + a := 5; + END_FUNCTION + "#, + ); + + let manual_deref = codegen( + r#" + FUNCTION main + VAR + a : REF_TO DINT; + END_VAR + a^ := 5; + END_FUNCTION + "#, + ); + + // We want to assert that `a := 5` and `a^ := 5` yield identical IR + assert_eq!(auto_deref, manual_deref); + + insta::assert_snapshot!(auto_deref, @r###" + ; ModuleID = 'main' + source_filename = "main" + + define void @main() section "fn-$RUSTY$main:v" { + entry: + %a = alloca i32*, align 8 + store i32* null, i32** %a, align 8 + %deref = load i32*, i32** %a, align 8 + store i32 5, i32* %deref, align 4 + ret void + } + "###); +} + +#[test] +fn reference_to_string_assignment() { + let auto_deref = codegen( + r#" + FUNCTION main + VAR + a : REFERENCE TO STRING; + END_VAR + + a := 'hello'; + END_FUNCTION + "#, + ); + + let manual_deref = codegen( + r#" + FUNCTION main + VAR + a : REF_TO STRING; + END_VAR + + a^ := 'hello'; + END_FUNCTION + "#, + ); + + // We want to assert that `a := 'hello'` and `a^ := 'hello'` yield identical IR + assert_eq!(auto_deref, manual_deref); + + insta::assert_snapshot!(auto_deref, @r###" + ; ModuleID = 'main' + source_filename = "main" + + @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" + + define void @main() section "fn-$RUSTY$main:v" { + entry: + %a = alloca [81 x i8]*, align 8 + store [81 x i8]* null, [81 x i8]** %a, align 8 + %deref = load [81 x i8]*, [81 x i8]** %a, align 8 + %0 = bitcast [81 x i8]* %deref to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %0, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + ret void + } + + ; Function Attrs: argmemonly nofree nounwind willreturn + declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + + attributes #0 = { argmemonly nofree nounwind willreturn } + "###); +} diff --git a/src/index.rs b/src/index.rs index cb0fdd9837..474217b662 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1130,6 +1130,7 @@ impl Index { if segments.is_empty() { return None; } + //For the first element, if the context does not contain that element, it is possible that the element is also a global variable let init = match context { Some(context) => self diff --git a/src/index/tests/index_tests.rs b/src/index/tests/index_tests.rs index b9dc72dc62..2e8eb9dacb 100644 --- a/src/index/tests/index_tests.rs +++ b/src/index/tests/index_tests.rs @@ -1253,6 +1253,7 @@ fn pointer_and_in_out_pointer_should_not_conflict() { name: "__main_x".to_string(), inner_type_name: "INT".to_string(), auto_deref: false, + is_reference_to: false, } ); @@ -1264,6 +1265,7 @@ fn pointer_and_in_out_pointer_should_not_conflict() { name: "__auto_pointer_to_INT".to_string(), inner_type_name: "INT".to_string(), auto_deref: true, + is_reference_to: false, } ); } @@ -1303,6 +1305,7 @@ fn pointer_and_in_out_pointer_should_not_conflict_2() { name: "__main_x".to_string(), inner_type_name: "INT".to_string(), auto_deref: false, + is_reference_to: false, } ); @@ -1314,6 +1317,7 @@ fn pointer_and_in_out_pointer_should_not_conflict_2() { name: "__auto_pointer_to_INT".to_string(), inner_type_name: "INT".to_string(), auto_deref: true, + is_reference_to: false, } ); } diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap index 16bd9f9481..e3895d6f10 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "__foo_inline_pointer_", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap index 493df6f2fd..8acc34ac46 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap index e603f07e5d..be433f8b03 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap index df5d0ae77a..6bd5e157f6 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "__pointer_to_pointer", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: None, diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap index f5332a5730..f8a2939b47 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: None, diff --git a/src/index/visitor.rs b/src/index/visitor.rs index cff5e49e47..f0ecd18a1e 100644 --- a/src/index/visitor.rs +++ b/src/index/visitor.rs @@ -273,6 +273,7 @@ fn register_byref_pointer_type_for(index: &mut Index, inner_type_name: &str) -> name: type_name.clone(), inner_type_name: inner_type_name.to_string(), auto_deref: true, + is_reference_to: false, }, nature: TypeNature::Any, location: SourceLocation::internal(), @@ -400,12 +401,13 @@ fn visit_data_type(index: &mut Index, type_declaration: &UserTypeDeclaration) { DataType::ArrayType { name: Some(name), bounds, referenced_type, .. } => { visit_array(bounds, index, scope, referenced_type, name, type_declaration); } - DataType::PointerType { name: Some(name), referenced_type, .. } => { + DataType::PointerType { name: Some(name), referenced_type, auto_deref, is_reference_to } => { let inner_type_name = referenced_type.get_name().expect("named datatype"); let information = DataTypeInformation::Pointer { name: name.clone(), inner_type_name: inner_type_name.into(), - auto_deref: false, + auto_deref: *auto_deref, + is_reference_to: *is_reference_to, }; let init = index.get_mut_const_expressions().maybe_add_constant_expression( @@ -572,6 +574,8 @@ fn visit_variable_length_array( referenced_type: dummy_array_name, location: SourceLocation::undefined(), }), + auto_deref: false, + is_reference_to: false, }, location: SourceLocation::undefined(), scope: None, diff --git a/src/lexer/tokens.rs b/src/lexer/tokens.rs index 02baa2a7e1..d7c72a5394 100644 --- a/src/lexer/tokens.rs +++ b/src/lexer/tokens.rs @@ -159,6 +159,9 @@ pub enum Token { #[token("=>")] KeywordOutputAssignment, + #[token("REF=", ignore(case))] + KeywordReferenceAssignment, + #[token("(")] KeywordParensOpen, @@ -252,6 +255,9 @@ pub enum Token { #[token("REFTO", ignore(case))] KeywordRef, + #[token("REFERENCE TO", ignore(case))] + KeywordReferenceTo, + #[token("ARRAY", ignore(case))] KeywordArray, diff --git a/src/parser.rs b/src/parser.rs index 385322fd28..f113e44549 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -676,9 +676,9 @@ fn parse_data_type_definition( if expect_keyword_to(lexer).is_some() { lexer.advance(); } - parse_pointer_definition(lexer, name, start_pos) + parse_pointer_definition(lexer, name, start_pos, false) } else if lexer.try_consume(&KeywordRef) { - parse_pointer_definition(lexer, name, lexer.last_range.start) + parse_pointer_definition(lexer, name, lexer.last_range.start, false) } else if lexer.try_consume(&KeywordParensOpen) { //enum without datatype parse_enum_type_definition(lexer, name) @@ -701,11 +701,17 @@ fn parse_pointer_definition( lexer: &mut ParseSession, name: Option, start_pos: usize, + is_reference_to: bool, ) -> Option<(DataTypeDeclaration, Option)> { parse_data_type_definition(lexer, None).map(|(decl, initializer)| { ( DataTypeDeclaration::DataTypeDefinition { - data_type: DataType::PointerType { name, referenced_type: Box::new(decl) }, + data_type: DataType::PointerType { + name, + referenced_type: Box::new(decl), + auto_deref: is_reference_to, + is_reference_to, + }, location: lexer.source_range_factory.create_range(start_pos..lexer.last_range.end), scope: lexer.scope.clone(), }, @@ -1108,7 +1114,16 @@ fn parse_variable_line(lexer: &mut ParseSession) -> Vec { // create variables with the same data type for each of the names let mut variables = vec![]; - if let Some((data_type, initializer)) = parse_full_data_type_definition(lexer, None) { + + let parse_definition_opt = if lexer.try_consume(&KeywordReferenceTo) { + parse_pointer_definition(lexer, None, lexer.last_range.start, true) + } else { + parse_full_data_type_definition(lexer, None) + }; + + lexer.try_consume(&KeywordSemicolon); + + if let Some((data_type, initializer)) = parse_definition_opt { for (name, range) in var_names { variables.push(Variable { name, @@ -1119,6 +1134,7 @@ fn parse_variable_line(lexer: &mut ParseSession) -> Vec { }); } } + variables } diff --git a/src/parser/expressions_parser.rs b/src/parser/expressions_parser.rs index 798de92813..c9760451ff 100644 --- a/src/parser/expressions_parser.rs +++ b/src/parser/expressions_parser.rs @@ -213,17 +213,21 @@ fn parse_leaf_expression(lexer: &mut ParseSession) -> AstNode { }; match literal_parse_result { - Some(statement) => { - if lexer.token == KeywordAssignment { + Some(statement) => match lexer.token { + KeywordAssignment => { lexer.advance(); AstFactory::create_assignment(statement, parse_range_statement(lexer), lexer.next_id()) - } else if lexer.token == KeywordOutputAssignment { + } + KeywordOutputAssignment => { lexer.advance(); AstFactory::create_output_assignment(statement, parse_range_statement(lexer), lexer.next_id()) - } else { - statement } - } + KeywordReferenceAssignment => { + lexer.advance(); + AstFactory::create_ref_assignment(statement, parse_range_statement(lexer), lexer.next_id()) + } + _ => statement, + }, None => { let statement = AstFactory::create_empty_statement( lexer.diagnostics.last().map_or(SourceLocation::undefined(), |d| d.get_location()), diff --git a/src/parser/tests/parse_errors/parse_error_statements_tests.rs b/src/parser/tests/parse_errors/parse_error_statements_tests.rs index ca29b7abba..635dd03792 100644 --- a/src/parser/tests/parse_errors/parse_error_statements_tests.rs +++ b/src/parser/tests/parse_errors/parse_error_statements_tests.rs @@ -1128,6 +1128,8 @@ fn pointer_type_without_to_test() { referenced_type: "INT".to_string(), location: SourceLocation::undefined(), }), + auto_deref: false, + is_reference_to: false, }, location: SourceLocation::undefined(), initializer: None, @@ -1154,6 +1156,8 @@ fn pointer_type_with_wrong_keyword_to_test() { referenced_type: "tu".to_string(), location: SourceLocation::undefined(), }), + auto_deref: false, + is_reference_to: false, }, location: SourceLocation::undefined(), initializer: None, diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap index f430f66293..b7f3076003 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap @@ -10,6 +10,8 @@ Variable { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, }, } diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap index f7426bc0ee..fcdb7bc49c 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap @@ -10,6 +10,8 @@ Variable { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, }, } diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap index 1bd1d207de..576dcbd116 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: None, diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap index 9402582b6e..332f301817 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap @@ -10,6 +10,8 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, + auto_deref: false, + is_reference_to: false, }, initializer: None, scope: None, diff --git a/src/parser/tests/statement_parser_tests.rs b/src/parser/tests/statement_parser_tests.rs index ffddd7578f..c1b1c51d6e 100644 --- a/src/parser/tests/statement_parser_tests.rs +++ b/src/parser/tests/statement_parser_tests.rs @@ -1,6 +1,6 @@ use crate::{ parser::tests::{empty_stmt, ref_to}, - test_utils::tests::parse, + test_utils::tests::{parse, parse_and_validate_buffered}, typesystem::DINT_TYPE, }; use insta::assert_snapshot; @@ -262,3 +262,79 @@ fn empty_parameter_assignments_in_call_statement() { let ast_string = format!("{:#?}", &result); insta::assert_snapshot!(ast_string); } + +#[test] +fn ref_assignment() { + let result = &parse("PROGRAM main x REF= y END_PROGRAM").0.implementations[0]; + insta::assert_debug_snapshot!(result.statements, @r###" + [ + ReferenceAssignment { + left: ReferenceExpr { + kind: Member( + Identifier { + name: "x", + }, + ), + base: None, + }, + right: ReferenceExpr { + kind: Member( + Identifier { + name: "y", + }, + ), + base: None, + }, + }, + ] + "###) +} + +#[test] +fn reference_to_declaration() { + let (result, diagnostics) = parse( + r" + FUNCTION foo + VAR + bar : DINT; + baz : REFERENCE TO DINT; + qux : DINT; + END_VAR + END_FUNCTION + ", + ); + + assert!(diagnostics.is_empty()); + insta::assert_debug_snapshot!(result.units[0].variable_blocks[0], @r###" + VariableBlock { + variables: [ + Variable { + name: "bar", + data_type: DataTypeReference { + referenced_type: "DINT", + }, + }, + Variable { + name: "baz", + data_type: DataTypeDefinition { + data_type: PointerType { + name: None, + referenced_type: DataTypeReference { + referenced_type: "DINT", + }, + auto_deref: true, + is_reference_to: true, + }, + }, + }, + Variable { + name: "qux", + data_type: DataTypeReference { + referenced_type: "DINT", + }, + }, + ], + variable_block_type: Local, + } + "###); +} diff --git a/src/resolver.rs b/src/resolver.rs index 58186c0a8c..2038bc223f 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -393,6 +393,8 @@ pub enum StatementAnnotation { argument_type: ArgumentType, /// denotes whether this variable-reference should be automatically dereferenced when accessed is_auto_deref: bool, + /// denotes whether this variable is declared as `REFERENCE TO` (e.g. `foo : REFERENCE TO DINT`) + is_reference_to: bool, }, /// a reference to a function Function { @@ -433,6 +435,14 @@ impl StatementAnnotation { } } + pub fn is_auto_deref(&self) -> bool { + matches!(self, StatementAnnotation::Variable { is_auto_deref: true, .. }) + } + + pub fn is_reference_to(&self) -> bool { + matches!(self, StatementAnnotation::Variable { is_reference_to: true, .. }) + } + pub fn data_type(type_name: &str) -> Self { StatementAnnotation::Type { type_name: type_name.into() } } @@ -1419,7 +1429,7 @@ impl<'i> TypeAnnotator<'i> { AstStatement::RangeStatement(data, ..) => { visit_all_statements!(self, ctx, &data.start, &data.end); } - AstStatement::Assignment(data, ..) => { + AstStatement::Assignment(data, ..) | AstStatement::RefAssignment(data, ..) => { self.visit_statement(&ctx.enter_control(), &data.right); if let Some(lhs) = ctx.lhs { //special context for left hand side @@ -1628,7 +1638,7 @@ impl<'i> TypeAnnotator<'i> { else { unreachable!("expected a vla reference, but got {statement:#?}"); }; - if let DataTypeInformation::Pointer { inner_type_name, .. } = &self + if let DataTypeInformation::Pointer { inner_type_name, is_reference_to, .. } = &self .index .get_effective_type_or_void_by_name( members.first().expect("internal VLA struct ALWAYS has this member").get_type_name(), @@ -1664,6 +1674,7 @@ impl<'i> TypeAnnotator<'i> { constant: false, argument_type, is_auto_deref: false, + is_reference_to: *is_reference_to, }; self.annotation_map.annotate_type_hint(statement, hint_annotation) } @@ -1749,7 +1760,12 @@ impl<'i> TypeAnnotator<'i> { } pub(crate) fn annotate_parameters(&mut self, p: &AstNode, type_name: &str) { - if !matches!(p.get_stmt(), AstStatement::Assignment(..) | AstStatement::OutputAssignment(..)) { + if !matches!( + p.get_stmt(), + AstStatement::Assignment(..) + | AstStatement::OutputAssignment(..) + | AstStatement::RefAssignment(..) + ) { if let Some(effective_member_type) = self.index.find_effective_type_by_name(type_name) { //update the type hint self.annotation_map @@ -1869,10 +1885,11 @@ pub(crate) fn add_pointer_type(index: &mut Index, inner_type_name: String) -> St name: new_type_name.clone(), initial_value: None, nature: TypeNature::Any, - information: crate::typesystem::DataTypeInformation::Pointer { + information: DataTypeInformation::Pointer { auto_deref: false, inner_type_name, name: new_type_name.clone(), + is_reference_to: false, }, location: SourceLocation::internal(), }); @@ -1932,6 +1949,7 @@ fn to_variable_annotation( constant: v.is_constant() || constant_override, argument_type: v.get_declaration_type(), is_auto_deref, + is_reference_to: v_type.get_type_information().is_reference_to(), } } diff --git a/src/resolver/generics.rs b/src/resolver/generics.rs index 379460b346..6d7861b7e4 100644 --- a/src/resolver/generics.rs +++ b/src/resolver/generics.rs @@ -201,14 +201,18 @@ impl<'i> TypeAnnotator<'i> { .unwrap_or_else(|| member_name) .to_string() } - Some(DataTypeInformation::Pointer { name, inner_type_name, auto_deref: true }) => { + Some(DataTypeInformation::Pointer { name, inner_type_name, auto_deref: true, .. }) => { // This is an auto deref pointer (VAR_IN_OUT or VAR_INPUT {ref}) that points to a // generic. We first resolve the generic type, then create a new pointer type of // the combination let inner_type_name = self.find_or_create_datatype(inner_type_name, generics); let name = format!("{name}__{inner_type_name}"); // TODO: Naming convention (see plc_util/src/convention.rs) - let new_type_info = - DataTypeInformation::Pointer { name: name.clone(), inner_type_name, auto_deref: true }; + let new_type_info = DataTypeInformation::Pointer { + name: name.clone(), + inner_type_name, + auto_deref: true, + is_reference_to: false, + }; // Registers a new pointer type to the index self.annotation_map.new_index.register_type(DataType { diff --git a/src/resolver/tests/resolve_expressions_tests.rs b/src/resolver/tests/resolve_expressions_tests.rs index 44d1537f19..44872aec2b 100644 --- a/src/resolver/tests/resolve_expressions_tests.rs +++ b/src/resolver/tests/resolve_expressions_tests.rs @@ -162,7 +162,8 @@ fn cast_expressions_of_enum_with_resolves_types() { qualified_name: "MyEnum.a".to_string(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }) ); @@ -178,7 +179,8 @@ fn cast_expressions_of_enum_with_resolves_types() { qualified_name: "MyEnum.b".to_string(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }) ); } @@ -1313,6 +1315,7 @@ fn function_expression_resolves_to_the_function_itself_not_its_return_type() { constant: false, is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Return), + is_reference_to: false, }), foo_annotation ); @@ -1574,6 +1577,7 @@ fn qualified_expressions_dont_fallback_to_globals() { constant: false, is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Input), + is_reference_to: false, }), annotations.get(&statements[1]) ); @@ -1815,6 +1819,7 @@ fn method_references_are_resolved() { constant: false, is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Return), + is_reference_to: false, }), annotation ); @@ -2448,7 +2453,8 @@ fn struct_member_explicit_initialization_test() { qualified_name: "myStruct.var1".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }), annotations.get(left) ); @@ -2462,7 +2468,8 @@ fn struct_member_explicit_initialization_test() { qualified_name: "myStruct.var2".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }), annotations.get(left) ); @@ -2944,6 +2951,7 @@ fn action_body_gets_resolved() { constant: false, is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Local), + is_reference_to: false, }), a ); @@ -3385,6 +3393,7 @@ fn address_of_is_annotated_correctly() { if let Some(&StatementAnnotation::Value { resulting_type }) = annotations.get(s).as_ref() { assert_eq!( Some(&DataTypeInformation::Pointer { + is_reference_to: false, auto_deref: false, inner_type_name: "INT".to_string(), name: "__POINTER_TO_INT".to_string(), @@ -3468,7 +3477,8 @@ fn call_explicit_parameter_name_is_resolved() { qualified_name: "fb.b".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }), annotations.get(b.as_ref()) ); @@ -3479,7 +3489,8 @@ fn call_explicit_parameter_name_is_resolved() { qualified_name: "fb.a".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }), annotations.get(a) ); @@ -3701,7 +3712,8 @@ fn function_block_initialization_test() { qualified_name: "TON.PT".into(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, } ) } else { @@ -3836,7 +3848,8 @@ fn resolve_return_variable_in_nested_call() { qualified_name: "main.main".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Return), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, } ) } @@ -5081,6 +5094,7 @@ fn annotate_variable_in_parent_class() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5096,6 +5110,7 @@ fn annotate_variable_in_parent_class() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5134,6 +5149,7 @@ fn annotate_variable_in_grandparent_class() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5179,6 +5195,7 @@ fn annotate_variable_in_field() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5236,6 +5253,7 @@ fn annotate_method_in_super() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5251,6 +5269,7 @@ fn annotate_method_in_super() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5266,6 +5285,7 @@ fn annotate_method_in_super() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5281,6 +5301,7 @@ fn annotate_method_in_super() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); @@ -5296,6 +5317,7 @@ fn annotate_method_in_super() { constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), is_auto_deref: false, + is_reference_to: false, }, annotation.unwrap() ); diff --git a/src/resolver/tests/resolve_literals_tests.rs b/src/resolver/tests/resolve_literals_tests.rs index 559da46845..42d39cd54d 100644 --- a/src/resolver/tests/resolve_literals_tests.rs +++ b/src/resolver/tests/resolve_literals_tests.rs @@ -312,7 +312,8 @@ fn enum_literals_target_are_annotated() { qualified_name: "Color.Red".into(), constant: true, argument_type: ArgumentType::ByVal(crate::index::VariableType::Global), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, }), annotations.get(target) ); diff --git a/src/tests/adr/annotated_ast_adr.rs b/src/tests/adr/annotated_ast_adr.rs index bdfc003e7c..6845bd2163 100644 --- a/src/tests/adr/annotated_ast_adr.rs +++ b/src/tests/adr/annotated_ast_adr.rs @@ -49,7 +49,8 @@ fn references_to_variables_are_annotated() { qualified_name: "prg.a".into(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, } ); @@ -61,7 +62,8 @@ fn references_to_variables_are_annotated() { qualified_name: "gX".into(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false + is_auto_deref: false, + is_reference_to: false, } ); } @@ -105,6 +107,7 @@ fn different_types_of_annotations() { resulting_type: "SINT".into(), // the variable's type constant: false, // whether this variable is a constant or not is_auto_deref: false, // whether this pointerType should be automatically dereferenced + is_reference_to: false, // whether this pointerType was declared as `REFERENCE TO`, making it auto-deref by default argument_type: ArgumentType::ByVal(VariableType::Input), // the type of declaration }) ); @@ -154,6 +157,7 @@ fn different_types_of_annotations() { resulting_type: "INT".into(), constant: false, is_auto_deref: false, + is_reference_to: false, argument_type: ArgumentType::ByVal(VariableType::Input), }) ); @@ -166,6 +170,7 @@ fn different_types_of_annotations() { resulting_type: "INT".into(), constant: false, is_auto_deref: false, + is_reference_to: false, argument_type: ArgumentType::ByVal(VariableType::Input), }) ); diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index e4ba8d7512..29c9816894 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -104,6 +104,7 @@ fn representation() { name: "__ptr_to___arr_vla_1_dint", inner_type_name: "__arr_vla_1_dint", auto_deref: false, + is_reference_to: false, }, nature: Any, location: SourceLocation { diff --git a/src/typesystem.rs b/src/typesystem.rs index eaead48113..3e19f5665d 100644 --- a/src/typesystem.rs +++ b/src/typesystem.rs @@ -96,7 +96,7 @@ mod tests; #[derive(Debug, Clone)] pub struct DataType { pub name: String, - /// the initial value defined on the TYPE-declration + /// the initial value defined on the TYPE-declaration pub initial_value: Option, pub information: DataTypeInformation, pub nature: TypeNature, @@ -391,6 +391,8 @@ pub enum DataTypeInformation { name: TypeId, inner_type_name: TypeId, auto_deref: bool, + /// Denotes whether the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT` + is_reference_to: bool, }, Integer { name: TypeId, @@ -559,6 +561,11 @@ impl DataTypeInformation { } } + /// Returns true if the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT`. + pub fn is_reference_to(&self) -> bool { + matches!(self, DataTypeInformation::Pointer { is_reference_to: true, .. }) + } + pub fn is_aggregate(&self) -> bool { matches!( self, diff --git a/src/validation/statement.rs b/src/validation/statement.rs index eb91f49d83..2115972180 100644 --- a/src/validation/statement.rs +++ b/src/validation/statement.rs @@ -1,6 +1,7 @@ use rustc_hash::{FxHashMap, FxHashSet}; use std::mem::discriminant; +use plc_ast::ast::Assignment; use plc_ast::control_statements::ForLoopStatement; use plc_ast::{ ast::{ @@ -13,7 +14,9 @@ use plc_ast::{ use plc_diagnostics::diagnostics::Diagnostic; use plc_source::source_location::SourceLocation; +use super::{array::validate_array_assignment, ValidationContext, Validator, Validators}; use crate::index::ImplementationType; +use crate::typesystem::VOID_TYPE; use crate::validation::statement::helper::{get_datatype_name_or_slice, get_literal_int_or_const_expr_value}; use crate::{ builtins::{self, BuiltIn}, @@ -26,8 +29,6 @@ use crate::{ }, }; -use super::{array::validate_array_assignment, ValidationContext, Validator, Validators}; - macro_rules! visit_all_statements { ($validator:expr, $context:expr, $last:expr ) => { visit_statement($validator, $last, $context); @@ -85,14 +86,20 @@ pub fn visit_statement( visit_statement(validator, &data.left, context); visit_statement(validator, &data.right, context); - validate_assignment(validator, &data.right, Some(&data.left), &statement.get_location(), context); + validate_assignment(validator, &data.right, Some(&data.left), &statement.location, context); validate_array_assignment(validator, context, statement); } AstStatement::OutputAssignment(data) => { visit_statement(validator, &data.left, context); visit_statement(validator, &data.right, context); - validate_assignment(validator, &data.right, Some(&data.left), &statement.get_location(), context); + validate_assignment(validator, &data.right, Some(&data.left), &statement.location, context); + } + AstStatement::RefAssignment(data) => { + visit_statement(validator, &data.left, context); + visit_statement(validator, &data.right, context); + + validate_ref_assignment(context, validator, data, &statement.location); } AstStatement::CallStatement(data) => { validate_call(validator, &data.operator, data.parameters.as_deref(), &context.set_is_call()); @@ -762,6 +769,81 @@ fn validate_call_by_ref(validator: &mut Validator, param: &VariableIndexEntry, a } } +/// Checks if `REF=` assignments are correct, specifically if the left-hand side is a reference declared +/// as `REFERENCE TO` and the right hand side is a lvalue of the same type that is being referenced. +fn validate_ref_assignment( + context: &ValidationContext, + validator: &mut Validator, + assignment: &Assignment, + assignment_location: &SourceLocation, +) { + let type_lhs = context.annotations.get_type_or_void(&assignment.left, context.index); + let type_rhs = context.annotations.get_type_or_void(&assignment.right, context.index); + let type_info_lhs = context.index.find_elementary_pointer_type(type_lhs.get_type_information()); + let type_info_rhs = context.index.find_elementary_pointer_type(type_rhs.get_type_information()); + let annotation_lhs = context.annotations.get(&assignment.left); + + // Assert that the right-hand side is a reference + if !assignment.right.is_reference() { + validator.push_diagnostic( + Diagnostic::new("Invalid assignment, expected a reference") + .with_location(&assignment.right.location) + .with_error_code("E098"), + ); + } + + // Assert that the left-hand side is a valid pointer-reference + if !annotation_lhs.is_some_and(StatementAnnotation::is_reference_to) && !type_lhs.is_pointer() { + validator.push_diagnostic( + Diagnostic::new("Invalid assignment, expected a pointer reference") + .with_location(&assignment.left.location) + .with_error_code("E098"), + ) + } + + if type_info_lhs.is_array() && type_info_rhs.is_array() { + let mut messages = Vec::new(); + + let len_lhs = type_info_lhs.get_array_length(context.index).unwrap_or_default(); + let len_rhs = type_info_rhs.get_array_length(context.index).unwrap_or_default(); + + if len_lhs < len_rhs { + messages.push(format!("Invalid assignment, array lengths {len_lhs} and {len_rhs} differ")); + } + + let inner_ty_name_lhs = type_info_lhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); + let inner_ty_name_rhs = type_info_rhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); + let inner_ty_lhs = context.index.find_effective_type_by_name(inner_ty_name_lhs); + let inner_ty_rhs = context.index.find_effective_type_by_name(inner_ty_name_rhs); + + if inner_ty_lhs != inner_ty_rhs { + messages.push(format!( + "Invalid assignment, array types {inner_ty_name_lhs} and {inner_ty_name_rhs} differ" + )); + } + + for message in messages { + validator.push_diagnostic( + Diagnostic::new(message).with_location(assignment_location).with_error_code("E098"), + ) + } + + return; + } + + if type_info_lhs != type_info_rhs { + validator.push_diagnostic( + Diagnostic::new(format!( + "Invalid assignment, types {} and {} differ", + get_datatype_name_or_slice(validator.context, type_lhs), + get_datatype_name_or_slice(validator.context, type_rhs), + )) + .with_location(assignment_location) + .with_error_code("E098"), + ); + } +} + fn validate_assignment( validator: &mut Validator, right: &AstNode, diff --git a/src/validation/tests/assignment_validation_tests.rs b/src/validation/tests/assignment_validation_tests.rs index 40da9e7fc4..219dc6872d 100644 --- a/src/validation/tests/assignment_validation_tests.rs +++ b/src/validation/tests/assignment_validation_tests.rs @@ -1217,3 +1217,277 @@ fn void_assignment_validation() { "###) } + +#[test] +fn ref_assignments() { + let diagnostics = parse_and_validate_buffered( + " + FUNCTION main + VAR + localINT : INT; + localDINT : DINT; + localSTRING : STRING; + + localRefTo : REF_TO DINT; + localReferenceTo : REFERENCE TO DINT; + END_VAR + + localRefTo REF= localDINT; + localReferenceTo REF= localDINT; + + // The following are invalid + 1 REF= localDINT; + localINT REF= localDINT; + localRefTo REF= 1; + localReferenceTo REF= 1; + + localReferenceTo REF= localINT; + localReferenceTo REF= localSTRING; + localReferenceTo REF= 'howdy'; + END_FUNCTION + ", + ); + + assert_snapshot!(diagnostics, @r###" + error[E098]: Invalid assignment, expected a pointer reference + ┌─ :16:13 + │ + 16 │ 1 REF= localDINT; + │ ^ Invalid assignment, expected a pointer reference + + error[E098]: Invalid assignment, expected a pointer reference + ┌─ :17:13 + │ + 17 │ localINT REF= localDINT; + │ ^^^^^^^^ Invalid assignment, expected a pointer reference + + error[E098]: Invalid assignment, types INT and DINT differ + ┌─ :17:13 + │ + 17 │ localINT REF= localDINT; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types INT and DINT differ + + error[E098]: Invalid assignment, expected a reference + ┌─ :18:38 + │ + 18 │ localRefTo REF= 1; + │ ^ Invalid assignment, expected a reference + + error[E098]: Invalid assignment, expected a reference + ┌─ :19:38 + │ + 19 │ localReferenceTo REF= 1; + │ ^ Invalid assignment, expected a reference + + error[E098]: Invalid assignment, types DINT and INT differ + ┌─ :21:13 + │ + 21 │ localReferenceTo REF= localINT; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and INT differ + + error[E098]: Invalid assignment, types DINT and STRING differ + ┌─ :22:13 + │ + 22 │ localReferenceTo REF= localSTRING; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + + error[E098]: Invalid assignment, expected a reference + ┌─ :23:38 + │ + 23 │ localReferenceTo REF= 'howdy'; + │ ^^^^^^^ Invalid assignment, expected a reference + + error[E098]: Invalid assignment, types DINT and STRING differ + ┌─ :23:13 + │ + 23 │ localReferenceTo REF= 'howdy'; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + + "###); +} + +#[test] +fn ref_assignment_with_global_local_variables_and_aliased_types() { + let diagnostics = parse_and_validate_buffered( + " + VAR_GLOBAL + fooGlobal : DINT; + END_VAR + + FUNCTION main + VAR + fooLocal : DINT; + referenceToFooFirstOfHisName : REFERENCE TO DINT; + referenceToFooSecondOfHisName : REFERENCE TO DINT; + referenceToAlias : REFERENCE TO AliasedDINT; + + intLocal : INT; + stringLocal : STRING; + + // Invalid, types should be referenced rather than literals or variables + invalidA : REFERENCE TO fooLocal; + invalidB : REFERENCE TO fooGlobal; + invalidC : REFERENCE TO DINT := 5; + END_VAR + + referenceToFooFirstOfHisName REF= fooLocal; + referenceToFooFirstOfHisName REF= fooGlobal; + referenceToFooFirstOfHisName REF= referenceToFooFirstOfHisName; // Valid, albeit questionable + referenceToFooFirstOfHisName REF= referenceToFooSecondOfHisName; + + // Invalid, type mismatch + referenceToFooFirstOfHisName REF= intLocal; + referenceToFooFirstOfHisName REF= stringLocal; + END_FUNCTION + ", + ); + + assert_snapshot!(diagnostics, @r###" + error[E099]: REFERENCE TO variables can not reference other variables + ┌─ :17:28 + │ + 17 │ invalidA : REFERENCE TO fooLocal; + │ ^^^^^^^^^^^^^^^^^^^^^ REFERENCE TO variables can not reference other variables + + error[E099]: REFERENCE TO variables can not reference other variables + ┌─ :18:28 + │ + 18 │ invalidB : REFERENCE TO fooGlobal; + │ ^^^^^^^^^^^^^^^^^^^^^^ REFERENCE TO variables can not reference other variables + + error[E099]: Initializations of REFERENCE TO variables are disallowed + ┌─ :19:49 + │ + 19 │ invalidC : REFERENCE TO DINT := 5; + │ ^ Initializations of REFERENCE TO variables are disallowed + + error[E098]: Invalid assignment, types DINT and INT differ + ┌─ :28:13 + │ + 28 │ referenceToFooFirstOfHisName REF= intLocal; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and INT differ + + error[E098]: Invalid assignment, types DINT and STRING differ + ┌─ :29:13 + │ + 29 │ referenceToFooFirstOfHisName REF= stringLocal; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + + "###); +} + +#[test] +fn ref_assignment_with_reference_to_array_variable() { + let diagnostics = parse_and_validate_buffered( + " + FUNCTION main + VAR + arrSTRING : ARRAY[1..6] OF STRING; + arrDINT : ARRAY[1..5] OF DINT; + arrReferenceDINT : REFERENCE TO ARRAY[1..5] OF DINT; + END_VAR + + arrReferenceDINT REF= arrDINT; + arrReferenceDINT REF= arrSTRING; + END_FUNCTION + ", + ); + + assert_snapshot!(diagnostics, @r###" + error[E098]: Invalid assignment, array lengths 5 and 6 differ + ┌─ :10:13 + │ + 10 │ arrReferenceDINT REF= arrSTRING; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, array lengths 5 and 6 differ + + error[E098]: Invalid assignment, array types DINT and STRING differ + ┌─ :10:13 + │ + 10 │ arrReferenceDINT REF= arrSTRING; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, array types DINT and STRING differ + + "###); +} + +#[test] +fn ref_assignment_with_reference_to_string_variable() { + let diagnostics = parse_and_validate_buffered( + " + FUNCTION main + VAR + localCHAR : CHAR; + localSTRING : STRING; + localWSTRING : WSTRING; + referenceToString : REFERENCE TO STRING; + END_VAR + + referenceToString REF= localCHAR; + referenceToString REF= localSTRING; + referenceToString REF= localWSTRING; + END_FUNCTION + ", + ); + + assert_snapshot!(diagnostics, @r###" + error[E098]: Invalid assignment, types STRING and CHAR differ + ┌─ :10:13 + │ + 10 │ referenceToString REF= localCHAR; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types STRING and CHAR differ + + error[E098]: Invalid assignment, types STRING and WSTRING differ + ┌─ :12:13 + │ + 12 │ referenceToString REF= localWSTRING; + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types STRING and WSTRING differ + + "###); +} + +// TODO(volsa): Improve the error messages here; these are the default messages returned by the parser +// without any modifications. +#[test] +fn invalid_reference_to_declaration() { + let diagnostics = parse_and_validate_buffered( + r" + FUNCTION foo + VAR + bar : ARRAY[1..5] OF REFERENCE TO DINT; + baz : REFERENCE TO REFERENCE TO DINT; + qux : REF_TO REFERENCE TO DINT; + END_VAR + END_FUNCTION + ", + ); + + insta::assert_snapshot!(diagnostics, @r###" + error[E007]: Unexpected token: expected DataTypeDefinition but found KeywordReferenceTo + ┌─ :4:38 + │ + 4 │ bar : ARRAY[1..5] OF REFERENCE TO DINT; + │ ^^^^^^^^^^^^ Unexpected token: expected DataTypeDefinition but found KeywordReferenceTo + + error[E007]: Unexpected token: expected KeywordSemicolon but found 'REFERENCE TO DINT' + ┌─ :4:38 + │ + 4 │ bar : ARRAY[1..5] OF REFERENCE TO DINT; + │ ^^^^^^^^^^^^^^^^^ Unexpected token: expected KeywordSemicolon but found 'REFERENCE TO DINT' + + error[E007]: Unexpected token: expected DataTypeDefinition but found KeywordReferenceTo + ┌─ :5:36 + │ + 5 │ baz : REFERENCE TO REFERENCE TO DINT; + │ ^^^^^^^^^^^^ Unexpected token: expected DataTypeDefinition but found KeywordReferenceTo + + error[E007]: Unexpected token: expected KeywordEndVar but found 'REFERENCE TO DINT; + qux : REF_TO REFERENCE TO DINT;' + ┌─ :5:36 + │ + 5 │ baz : REFERENCE TO REFERENCE TO DINT; + │ ╭────────────────────────────────────^ + 6 │ │ qux : REF_TO REFERENCE TO DINT; + │ ╰───────────────────────────────────────────────^ Unexpected token: expected KeywordEndVar but found 'REFERENCE TO DINT; + qux : REF_TO REFERENCE TO DINT;' + + "###); +} diff --git a/src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__constant_fb_instances_are_illegal.snap b/src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__constant_fb_instances_are_illegal.snap index 52d6277b77..a6062071b6 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__constant_fb_instances_are_illegal.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__variable_validation_tests__constant_fb_instances_are_illegal.snap @@ -2,16 +2,14 @@ source: src/validation/tests/variable_validation_tests.rs expression: "&diagnostics" --- -error[E035]: Invalid constant y - Functionblock- and Class-instances cannot be delcared constant +error[E035]: Invalid constant y, FUNCTION_BLOCK- and CLASS-instances cannot be declared constant ┌─ :15:13 │ 15 │ y : MyFb; - │ ^ Invalid constant y - Functionblock- and Class-instances cannot be delcared constant + │ ^ Invalid constant y, FUNCTION_BLOCK- and CLASS-instances cannot be declared constant -error[E035]: Invalid constant z - Functionblock- and Class-instances cannot be delcared constant +error[E035]: Invalid constant z, FUNCTION_BLOCK- and CLASS-instances cannot be declared constant ┌─ :16:13 │ 16 │ z : cls; - │ ^ Invalid constant z - Functionblock- and Class-instances cannot be delcared constant - - + │ ^ Invalid constant z, FUNCTION_BLOCK- and CLASS-instances cannot be declared constant diff --git a/src/validation/variable.rs b/src/validation/variable.rs index f841b0001f..ed07481734 100644 --- a/src/validation/variable.rs +++ b/src/validation/variable.rs @@ -1,15 +1,15 @@ use plc_ast::ast::{ArgumentProperty, Pou, PouType, Variable, VariableBlock, VariableBlockType}; use plc_diagnostics::diagnostics::Diagnostic; -use crate::typesystem::DataTypeInformation; -use crate::{index::const_expressions::ConstExpression, resolver::AnnotationMap}; - use super::{ array::validate_array_assignment, statement::{validate_enum_variant_assignment, visit_statement}, types::{data_type_is_fb_or_class_instance, visit_data_type_declaration}, ValidationContext, Validator, Validators, }; +use crate::index::VariableIndexEntry; +use crate::typesystem::DataTypeInformation; +use crate::{index::const_expressions::ConstExpression, resolver::AnnotationMap}; pub fn visit_variable_block( validator: &mut Validator, @@ -143,6 +143,8 @@ fn validate_variable( validate_array_ranges(validator, variable, context); if let Some(v_entry) = context.index.find_variable(context.qualifier, &[&variable.name]) { + validate_reference_to_declaration(validator, context, variable, v_entry); + if let Some(initializer) = &variable.initializer { // Assume `foo : ARRAY[1..5] OF DINT := [...]`, here the first function call validates the // assignment as a whole whereas the second function call (`visit_statement`) validates the @@ -198,7 +200,7 @@ fn validate_variable( { validator.push_diagnostic( Diagnostic::new(format!( - "Invalid constant {} - Functionblock- and Class-instances cannot be delcared constant", + "Invalid constant {}, FUNCTION_BLOCK- and CLASS-instances cannot be declared constant", v_entry.get_name() )) .with_error_code("E035") @@ -208,6 +210,50 @@ fn validate_variable( } } +/// Returns a diagnostic if a `REFERENCE TO` variable is incorrectly declared (or initialized). +fn validate_reference_to_declaration( + validator: &mut Validator, + context: &ValidationContext, + variable: &Variable, + variable_entry: &VariableIndexEntry, +) { + let Some(variable_ty) = context.index.find_effective_type_by_name(variable_entry.get_type_name()) else { + return; + }; + + if !variable_ty.get_type_information().is_reference_to() { + return; + } + + let Some(inner_ty_name) = variable_ty.get_type_information().get_inner_pointer_type_name() else { + unreachable!("`REFERENCE TO` is defined as a pointer, hence this must exist") + }; + + // Assert that no initializers are present in the `REFERENCE TO` declaration + if let Some(ref initializer) = variable.initializer { + if variable_ty.get_type_information().is_reference_to() { + validator.push_diagnostic( + Diagnostic::new("Initializations of REFERENCE TO variables are disallowed") + .with_location(&initializer.location) + .with_error_code("E099"), + ); + } + } + + // Assert that the referenced type is no variable reference + let qualifier = context.qualifier.unwrap_or_default(); + let inner_ty_is_local_var = context.index.find_member(qualifier, inner_ty_name).is_some(); + let inner_ty_is_global_var = context.index.find_global_variable(inner_ty_name).is_some(); + + if inner_ty_is_local_var || inner_ty_is_global_var { + validator.push_diagnostic( + Diagnostic::new("REFERENCE TO variables can not reference other variables") + .with_location(&variable_ty.location) + .with_error_code("E099"), + ); + } +} + #[cfg(test)] mod variable_validator_tests { use insta::assert_snapshot; diff --git a/tests/integration/cfc/resolver_tests.rs b/tests/integration/cfc/resolver_tests.rs index f11c866739..dd11728f65 100644 --- a/tests/integration/cfc/resolver_tests.rs +++ b/tests/integration/cfc/resolver_tests.rs @@ -99,6 +99,7 @@ fn function_block_calls_are_annotated_correctly() { Local, ), is_auto_deref: false, + is_reference_to: false, } "###); } diff --git a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap index 5d46308218..5fdbebac50 100644 --- a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap +++ b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap @@ -11,5 +11,6 @@ Some( Local, ), is_auto_deref: false, + is_reference_to: false, }, ) diff --git a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap index 1cb6d633ba..2d8cbaeaf2 100644 --- a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap +++ b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap @@ -11,5 +11,6 @@ Some( Local, ), is_auto_deref: false, + is_reference_to: false, }, ) diff --git a/tests/lit/single/pointer/ref_assignment_operator.st b/tests/lit/single/pointer/ref_assignment_operator.st new file mode 100644 index 0000000000..72f5a9f97c --- /dev/null +++ b/tests/lit/single/pointer/ref_assignment_operator.st @@ -0,0 +1,11 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main : DINT + VAR + a : REF_TO DINT; + b : DINT := 5; + END_VAR + a REF= b; + + // CHECK: 5 + printf('%d$N', a^); +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/referenceto_variable_autoderef.st b/tests/lit/single/pointer/referenceto_variable_autoderef.st new file mode 100644 index 0000000000..400b2ffc56 --- /dev/null +++ b/tests/lit/single/pointer/referenceto_variable_autoderef.st @@ -0,0 +1,28 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main: DINT + VAR + foo : REFERENCE TO DINT; + bar : DINT; + baz : DINT; + qux : DINT; + END_VAR + + foo REF= bar; + bar := 1; + baz := 2; + qux := 2; + + // CHECK: 2 + bar := bar + foo; // bar + bar => 1 + 1 + printf('%d$N', foo); + + // CHECK: 4 + baz := baz + foo; // baz + foo => baz + bar => 2 + 2 + foo REF= baz; + printf('%d$N', foo); + + // CHECK: 6 + qux := qux + foo; // qux + foo => qux + baz => 2 + 4 + foo REF= qux; + printf('%d$N', foo); +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/referenceto_variable_referencing_array.st b/tests/lit/single/pointer/referenceto_variable_referencing_array.st new file mode 100644 index 0000000000..f3e255a388 --- /dev/null +++ b/tests/lit/single/pointer/referenceto_variable_referencing_array.st @@ -0,0 +1,15 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main: DINT + VAR + arr : ARRAY[1..3] OF DINT; + refArr : REFERENCE TO ARRAY[1..3] OF DINT; + END_VAR + + refArr REF= arr; + arr[1] := 3; + arr[2] := 2; + arr[3] := 1; + + // CHECK: 1, 2, 3 + printf('%d, %d, %d$N', refArr[3], refArr[2], refArr[1]); +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/referenceto_variable_referencing_itself.st b/tests/lit/single/pointer/referenceto_variable_referencing_itself.st new file mode 100644 index 0000000000..c108e8917e --- /dev/null +++ b/tests/lit/single/pointer/referenceto_variable_referencing_itself.st @@ -0,0 +1,17 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main : DINT + VAR + foo : REFERENCE TO DINT; + bar : REFERENCE TO DINT; + qux : DINT; + END_VAR + + foo REF= bar; + bar REF= qux; + + bar REF= bar; + qux := 5; + + // CHECK: 5 + printf('%d$N', bar); // bar (-> bar) -> qux +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/referenceto_variable_referencing_other_referenceto_variable.st b/tests/lit/single/pointer/referenceto_variable_referencing_other_referenceto_variable.st new file mode 100644 index 0000000000..9b739965c9 --- /dev/null +++ b/tests/lit/single/pointer/referenceto_variable_referencing_other_referenceto_variable.st @@ -0,0 +1,15 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main : DINT + VAR + foo : REFERENCE TO DINT; + bar : REFERENCE TO DINT; + qux : DINT; + END_VAR + + bar REF= qux; + foo REF= bar; + qux := 5; + + // CHECK: 5 + printf('%d$N', foo); // foo -> bar -> qux +END_FUNCTION diff --git a/tests/lit/single/pointer/referenceto_variable_referencing_struct.st b/tests/lit/single/pointer/referenceto_variable_referencing_struct.st new file mode 100644 index 0000000000..77e6502ce3 --- /dev/null +++ b/tests/lit/single/pointer/referenceto_variable_referencing_struct.st @@ -0,0 +1,24 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +TYPE Transaction : STRUCT + id : DINT; + amount : DINT; + message : STRING; +END_STRUCT END_TYPE + +FUNCTION main : DINT + VAR + txn : Transaction := (id := 1, amount := 5, message := 'whats up'); + refTxn : REFERENCE TO Transaction; + END_VAR + + refTxn REF= txn; + + // CHECK: 1 + printf('%d$N', refTxn.id); + + // CHECK: 5 + printf('%d$N', refTxn.amount); + + // CHECK: whats up + printf('%s$N', REF(refTxn.message)); +END_FUNCTION \ No newline at end of file From 03972888f59dc04c099e86ec462f391d6c6b9050 Mon Sep 17 00:00:00 2001 From: Volkan Date: Wed, 17 Jul 2024 11:08:44 +0200 Subject: [PATCH 27/40] chore: Enable logging in VSCode debug view (#1262) Prints any log calls in VSCodes debug console --- .vscode/launch.json | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 21eab6ec81..8241a1f9ec 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -20,9 +20,13 @@ } }, "args": [ - "target/demo.st", + "target/demo.st" ], - "cwd": "${workspaceFolder}" + "cwd": "${workspaceFolder}", + "env": { + "RUST_LOG": "rusty" + }, + "terminal": "integrated" }, { "type": "lldb", @@ -43,7 +47,11 @@ "args": [ "demo" ], - "cwd": "${workspaceFolder}" + "cwd": "${workspaceFolder}", + "env": { + "RUST_LOG": "rusty" + }, + "terminal": "integrated" }, ] } \ No newline at end of file From 0c04d5401a65e00f5b269d96b5007b3d2db831fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:25:54 +0200 Subject: [PATCH 28/40] chore: Bump openssl from 0.10.64 to 0.10.66 (#1264) Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.64 to 0.10.66. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.64...openssl-v0.10.66) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4f0e6aa9e..6d6370cf6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2221,9 +2221,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -2253,9 +2253,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", From 446f073a2ee5aeeb5563688e327d2547eae0d92f Mon Sep 17 00:00:00 2001 From: Volkan Date: Thu, 25 Jul 2024 11:45:11 +0200 Subject: [PATCH 29/40] feat: Aliasing (#1258) This commit introduces aliasing, where the `AT` keyword can be used on a reference declaration to create a `REFERENCE TO` pointer. Specifically `foo AT bar : DINT` internally resolves to `foo : REFERENCE TO DINT := REF(bar)`. --- compiler/plc_ast/src/ast.rs | 34 ++- compiler/plc_diagnostics/src/diagnostics.rs | 5 +- .../src/diagnostics/diagnostics_registry.rs | 1 + .../src/diagnostics/error_codes/E099.md | 4 +- .../src/diagnostics/error_codes/E100.md | 15 ++ .../generators/expression_generator.rs | 28 +- src/codegen/llvm_typesystem.rs | 2 +- src/codegen/tests/statement_codegen_test.rs | 59 +++++ src/index/tests/index_tests.rs | 15 +- ...generates_inline_pointer_to_pointer-2.snap | 3 +- ...g_generates_inline_pointer_to_pointer.snap | 3 +- ..._processing_generates_inline_pointers.snap | 3 +- ...g_generates_pointer_to_pointer_type-2.snap | 3 +- ...ing_generates_pointer_to_pointer_type.snap | 3 +- src/index/visitor.rs | 17 +- src/parser.rs | 85 +++++-- src/parser/expressions_parser.rs | 4 +- src/parser/tests.rs | 2 +- src/parser/tests/expressions_parser_tests.rs | 2 +- .../parse_error_statements_tests.rs | 6 +- ...r_tests__global_pointer_declaration-2.snap | 3 +- ...ser_tests__global_pointer_declaration.snap | 3 +- ..._type_parser_tests__pointer_type_test.snap | 3 +- ...sts__type_parser_tests__ref_type_test.snap | 3 +- src/parser/tests/statement_parser_tests.rs | 57 ++++- src/resolver.rs | 99 +++++--- src/resolver/generics.rs | 5 +- src/resolver/tests.rs | 1 + src/resolver/tests/lowering.rs | 240 ++++++++++++++++++ .../tests/resolve_expressions_tests.rs | 66 ++--- src/resolver/tests/resolve_generic_calls.rs | 4 +- src/resolver/tests/resolve_literals_tests.rs | 3 +- src/tests/adr/annotated_ast_adr.rs | 15 +- src/tests/adr/vla_adr.rs | 3 +- src/typesystem.rs | 32 ++- src/validation/array.rs | 7 +- src/validation/statement.rs | 114 +++++---- .../tests/assignment_validation_tests.rs | 152 ++++++++--- ..._tests__pointer_assignment_validation.snap | 8 +- ...n_tests__struct_assignment_validation.snap | 12 +- ...nce_assignments_in_function_arguments.snap | 12 +- src/validation/variable.rs | 25 +- tests/integration/cfc/resolver_tests.rs | 3 +- ...r_tests__action_variables_annotated-3.snap | 3 +- ...r_tests__action_variables_annotated-4.snap | 3 +- tests/lit/single/pointer/alias_array.ignore | 14 + .../lit/single/pointer/alias_autoderef.ignore | 13 + tests/lit/single/pointer/alias_struct.ignore | 22 ++ 48 files changed, 901 insertions(+), 318 deletions(-) create mode 100644 compiler/plc_diagnostics/src/diagnostics/error_codes/E100.md create mode 100644 src/resolver/tests/lowering.rs create mode 100644 tests/lit/single/pointer/alias_array.ignore create mode 100644 tests/lit/single/pointer/alias_autoderef.ignore create mode 100644 tests/lit/single/pointer/alias_struct.ignore diff --git a/compiler/plc_ast/src/ast.rs b/compiler/plc_ast/src/ast.rs index 20ce291232..f851a8fd31 100644 --- a/compiler/plc_ast/src/ast.rs +++ b/compiler/plc_ast/src/ast.rs @@ -487,9 +487,7 @@ pub enum DataType { PointerType { name: Option, referenced_type: Box, - auto_deref: bool, - /// Denotes whether the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT` - is_reference_to: bool, + auto_deref: Option, }, StringType { name: Option, @@ -507,6 +505,18 @@ pub enum DataType { }, } +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum AutoDerefType { + /// A plain pointer variable with the auto-deref trait, e.g. VAR_IN_OUT or VAR_INPUT{ref} variables + Default, + + /// An alias pointer variable, e.g. `foo AT bar : DINT` + Alias, + + /// A reference pointer variable, e.g. `foo : REFERENCE TO DINT;` + Reference, +} + impl DataType { pub fn set_name(&mut self, new_name: String) { match self { @@ -1295,8 +1305,11 @@ impl AstFactory { } /// creates a new Identifier - pub fn create_identifier(name: &str, location: &SourceLocation, id: AstId) -> AstNode { - AstNode::new(AstStatement::Identifier(name.to_string()), id, location.clone()) + pub fn create_identifier(name: &str, location: T, id: AstId) -> AstNode + where + T: Into, + { + AstNode::new(AstStatement::Identifier(name.to_string()), id, location.into()) } pub fn create_unary_expression( @@ -1441,18 +1454,21 @@ impl AstFactory { } } - pub fn create_call_statement( + pub fn create_call_statement( operator: AstNode, parameters: Option, id: usize, - location: SourceLocation, - ) -> AstNode { + location: T, + ) -> AstNode + where + T: Into, + { AstNode { stmt: AstStatement::CallStatement(CallStatement { operator: Box::new(operator), parameters: parameters.map(Box::new), }), - location, + location: location.into(), id, } } diff --git a/compiler/plc_diagnostics/src/diagnostics.rs b/compiler/plc_diagnostics/src/diagnostics.rs index 669ffa7b2e..1aa1441df2 100644 --- a/compiler/plc_diagnostics/src/diagnostics.rs +++ b/compiler/plc_diagnostics/src/diagnostics.rs @@ -234,7 +234,10 @@ impl Diagnostic { .with_location(location) } - pub fn invalid_assignment(right_type: &str, left_type: &str, location: SourceLocation) -> Diagnostic { + pub fn invalid_assignment(right_type: &str, left_type: &str, location: T) -> Diagnostic + where + T: Into, + { Diagnostic::new(format!("Invalid assignment: cannot assign '{right_type}' to '{left_type}'")) .with_error_code("E037") .with_location(location) diff --git a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs index 874f1c4eb1..f3db285d77 100644 --- a/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs +++ b/compiler/plc_diagnostics/src/diagnostics/diagnostics_registry.rs @@ -201,6 +201,7 @@ lazy_static! { E097, Error, include_str!("./error_codes/E097.md"), // Invalid Array Range E098, Error, include_str!("./error_codes/E098.md"), // Invalid `REF=` assignment E099, Error, include_str!("./error_codes/E099.md"), // Invalid `REFERENCE TO` declaration + E100, Error, include_str!("./error_codes/E100.md"), // Immutable variable address ); } diff --git a/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md b/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md index d327378250..f78cc78448 100644 --- a/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md +++ b/compiler/plc_diagnostics/src/diagnostics/error_codes/E099.md @@ -3,6 +3,4 @@ `REFERENCE TO` variable declarations are considered valid if the referenced type is not of the following form * `foo : REFERENCE TO REFERENCE TO (* ... *)` * `foo : ARRAY[...] OF REFERENCE TO (* ... *)` -* `foo : REF_TO REFERENCE TO (* ... *)` - -Furthermore `REFERENCE_TO` variables must not be initialized in their declaration, e.g. `foo : REFERENCE TO DINT := bar`. \ No newline at end of file +* `foo : REF_TO REFERENCE TO (* ... *)` \ No newline at end of file diff --git a/compiler/plc_diagnostics/src/diagnostics/error_codes/E100.md b/compiler/plc_diagnostics/src/diagnostics/error_codes/E100.md new file mode 100644 index 0000000000..5d9e852ac4 --- /dev/null +++ b/compiler/plc_diagnostics/src/diagnostics/error_codes/E100.md @@ -0,0 +1,15 @@ +# Immutable Variable Address + +Alias variables are immutable with regards to their pointer address, thus re-assigning an address will return an error. For example the following code will not compile +```ST +FUNCTION main + VAR + foo AT bar : DINT; + bar : DINT; + baz : DINT; + END_VAR + + foo := baz; // Valid, because we are changing the pointers dereferenced value + foo REF= baz; // Invalid, `foo` is immutable with regards to it's pointer address +END_FUNCTION +``` \ No newline at end of file diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index b9a1941bb5..09039ab0b3 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -844,8 +844,9 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .get(i) .map(|it| { let name = it.get_type_name(); - if let Some(DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. }) = - self.index.find_effective_type_info(name) + if let Some(DataTypeInformation::Pointer { + inner_type_name, auto_deref: Some(_), .. + }) = self.index.find_effective_type_info(name) { // for auto_deref pointers (VAR_INPUT {ref}, VAR_IN_OUT) we call generate_argument_by_ref() // we need the inner_type and not pointer to type otherwise we would generate a double pointer @@ -1145,7 +1146,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } fn get_parameter_type(&self, parameter: &VariableIndexEntry) -> String { - if let Some(DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. }) = + if let Some(DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(_), .. }) = self.index.find_effective_type_info(parameter.get_type_name()) { inner_type_name.into() @@ -1253,7 +1254,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .map(|var| var.get_type_information()) .unwrap_or_else(|| self.index.get_void_type().get_type_information()); - if let DataTypeInformation::Pointer { auto_deref: true, inner_type_name, .. } = parameter { + if let DataTypeInformation::Pointer { auto_deref: Some(_), inner_type_name, .. } = parameter { //this is a VAR_IN_OUT assignment, so don't load the value, assign the pointer //expression may be empty -> generate a local variable for it let generated_exp = if expression.is_empty_statement() { @@ -1297,13 +1298,12 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // don't generate param assignments for empty statements, with the exception // of VAR_IN_OUT params - they need an address to point to - let is_auto_deref = matches!( - self.index - .find_effective_type_by_name(parameter.get_type_name()) - .map(|var| var.get_type_information()) - .unwrap_or_else(|| self.index.get_void_type().get_type_information()), - DataTypeInformation::Pointer { auto_deref: true, .. } - ); + let is_auto_deref = self + .index + .find_effective_type_by_name(parameter.get_type_name()) + .map(|var| var.get_type_information()) + .unwrap_or(self.index.get_void_type().get_type_information()) + .is_auto_deref(); if !right.is_empty_statement() || is_auto_deref { self.generate_call_struct_argument_assignment(&CallParameterAssignment { assignment: right, @@ -1419,9 +1419,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { accessor_ptr: PointerValue<'ink>, statement: &AstNode, ) -> PointerValue<'ink> { - if let Some(StatementAnnotation::Variable { is_auto_deref: true, .. }) = - self.annotations.get(statement) - { + if self.annotations.get(statement).is_some_and(|opt| opt.is_auto_deref()) { self.deref(accessor_ptr) } else { accessor_ptr @@ -1976,7 +1974,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } } - DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. } => { + DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(_), .. } => { let inner_type = self.index.get_type_information_or_void(inner_type_name); self.generate_string_literal_for_type(inner_type, value, location) } diff --git a/src/codegen/llvm_typesystem.rs b/src/codegen/llvm_typesystem.rs index d84bf1bbe1..5082365452 100644 --- a/src/codegen/llvm_typesystem.rs +++ b/src/codegen/llvm_typesystem.rs @@ -114,7 +114,7 @@ impl<'ctx, 'cast> CastInstructionData<'ctx, 'cast> { let value_type = index.get_intrinsic_type_by_name(value_type.get_name()).get_type_information(); let target_type = - if let DataTypeInformation::Pointer { auto_deref: true, inner_type_name, .. } = target_type { + if let DataTypeInformation::Pointer { auto_deref: Some(_), inner_type_name, .. } = target_type { // Deref auto-deref pointers before casting index.get_intrinsic_type_by_name(inner_type_name.as_str()).get_type_information() } else { diff --git a/src/codegen/tests/statement_codegen_test.rs b/src/codegen/tests/statement_codegen_test.rs index 9f8a4db6d0..5b627712f3 100644 --- a/src/codegen/tests/statement_codegen_test.rs +++ b/src/codegen/tests/statement_codegen_test.rs @@ -1,3 +1,5 @@ +use insta::assert_snapshot; + // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use crate::test_utils::tests::codegen; @@ -308,3 +310,60 @@ fn reference_to_string_assignment() { attributes #0 = { argmemonly nofree nounwind willreturn } "###); } + +#[test] +#[ignore = "Not working because of REF(...) initializer; should be resolved with https://github.com/PLC-lang/rusty/pull/1259"] +fn alias_dint() { + let content = codegen( + r#" + FUNCTION main + VAR + foo AT bar : DINT; + bar : DINT; + END_VAR + END_FUNCTION + "#, + ); + + assert_snapshot!(content, @r""); +} + +#[test] +#[ignore = "Not working because of REF(...) initializer; should be resolved with https://github.com/PLC-lang/rusty/pull/1259"] +fn alias_string() { + let content = codegen( + r#" + FUNCTION main + VAR + foo AT bar : STRING; + bar : STRING; + END_VAR + END_FUNCTION + "#, + ); + + assert_snapshot!(content, @r""); +} + +#[test] +#[ignore = "Not working because of REF(...) initializer; should be resolved with https://github.com/PLC-lang/rusty/pull/1259"] +fn alias_struct() { + let content = codegen( + r#" + TYPE Node : STRUCT + id : DINT; + child : REF_TO Node; + parent : REF_TO Node; + END_STRUCT END_TYPE + + FUNCTION main + VAR + foo AT bar : STRING; + bar : STRING; + END_VAR + END_FUNCTION + "#, + ); + + assert_snapshot!(content, @r""); +} diff --git a/src/index/tests/index_tests.rs b/src/index/tests/index_tests.rs index 2e8eb9dacb..7b1d2e4d08 100644 --- a/src/index/tests/index_tests.rs +++ b/src/index/tests/index_tests.rs @@ -1,7 +1,8 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use insta::assert_debug_snapshot; use plc_ast::ast::{ - pre_process, AstFactory, DataType, GenericBinding, LinkageType, Operator, TypeNature, UserTypeDeclaration, + pre_process, AstFactory, AutoDerefType, DataType, GenericBinding, LinkageType, Operator, TypeNature, + UserTypeDeclaration, }; use plc_ast::provider::IdProvider; use plc_source::source_location::{SourceLocation, SourceLocationFactory}; @@ -1252,8 +1253,7 @@ fn pointer_and_in_out_pointer_should_not_conflict() { &DataTypeInformation::Pointer { name: "__main_x".to_string(), inner_type_name: "INT".to_string(), - auto_deref: false, - is_reference_to: false, + auto_deref: None, } ); @@ -1264,8 +1264,7 @@ fn pointer_and_in_out_pointer_should_not_conflict() { &DataTypeInformation::Pointer { name: "__auto_pointer_to_INT".to_string(), inner_type_name: "INT".to_string(), - auto_deref: true, - is_reference_to: false, + auto_deref: Some(AutoDerefType::Default), } ); } @@ -1304,8 +1303,7 @@ fn pointer_and_in_out_pointer_should_not_conflict_2() { &DataTypeInformation::Pointer { name: "__main_x".to_string(), inner_type_name: "INT".to_string(), - auto_deref: false, - is_reference_to: false, + auto_deref: None, } ); @@ -1316,8 +1314,7 @@ fn pointer_and_in_out_pointer_should_not_conflict_2() { &DataTypeInformation::Pointer { name: "__auto_pointer_to_INT".to_string(), inner_type_name: "INT".to_string(), - auto_deref: true, - is_reference_to: false, + auto_deref: Some(AutoDerefType::Default), } ); } diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap index e3895d6f10..dd220acec7 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer-2.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "__foo_inline_pointer_", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap index 8acc34ac46..3ce97d3165 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointer_to_pointer.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap index be433f8b03..582c409f4e 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_inline_pointers.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: Some( diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap index 6bd5e157f6..b88ea5be2b 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type-2.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "__pointer_to_pointer", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: None, diff --git a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap index f8a2939b47..bbcd573ad6 100644 --- a/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap +++ b/src/index/tests/snapshots/rusty__index__tests__index_tests__pre_processing_generates_pointer_to_pointer_type.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: None, diff --git a/src/index/visitor.rs b/src/index/visitor.rs index f0ecd18a1e..04f146031e 100644 --- a/src/index/visitor.rs +++ b/src/index/visitor.rs @@ -3,9 +3,9 @@ use super::{HardwareBinding, PouIndexEntry, VariableIndexEntry, VariableType}; use crate::index::{ArgumentType, Index, MemberInfo}; use crate::typesystem::{self, *}; use plc_ast::ast::{ - self, ArgumentProperty, Assignment, AstFactory, AstNode, AstStatement, CompilationUnit, DataType, - DataTypeDeclaration, Implementation, Pou, PouType, RangeStatement, TypeNature, UserTypeDeclaration, - Variable, VariableBlock, VariableBlockType, + self, ArgumentProperty, Assignment, AstFactory, AstNode, AstStatement, AutoDerefType, CompilationUnit, + DataType, DataTypeDeclaration, Implementation, Pou, PouType, RangeStatement, TypeNature, + UserTypeDeclaration, Variable, VariableBlock, VariableBlockType, }; use plc_ast::literals::AstLiteral; use plc_diagnostics::diagnostics::Diagnostic; @@ -272,8 +272,7 @@ fn register_byref_pointer_type_for(index: &mut Index, inner_type_name: &str) -> information: DataTypeInformation::Pointer { name: type_name.clone(), inner_type_name: inner_type_name.to_string(), - auto_deref: true, - is_reference_to: false, + auto_deref: Some(AutoDerefType::Default), }, nature: TypeNature::Any, location: SourceLocation::internal(), @@ -401,13 +400,12 @@ fn visit_data_type(index: &mut Index, type_declaration: &UserTypeDeclaration) { DataType::ArrayType { name: Some(name), bounds, referenced_type, .. } => { visit_array(bounds, index, scope, referenced_type, name, type_declaration); } - DataType::PointerType { name: Some(name), referenced_type, auto_deref, is_reference_to } => { + DataType::PointerType { name: Some(name), referenced_type, auto_deref: kind } => { let inner_type_name = referenced_type.get_name().expect("named datatype"); let information = DataTypeInformation::Pointer { name: name.clone(), inner_type_name: inner_type_name.into(), - auto_deref: *auto_deref, - is_reference_to: *is_reference_to, + auto_deref: *kind, }; let init = index.get_mut_const_expressions().maybe_add_constant_expression( @@ -574,8 +572,7 @@ fn visit_variable_length_array( referenced_type: dummy_array_name, location: SourceLocation::undefined(), }), - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, location: SourceLocation::undefined(), scope: None, diff --git a/src/parser.rs b/src/parser.rs index f113e44549..c554853729 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -4,8 +4,8 @@ use std::ops::Range; use plc_ast::{ ast::{ - AccessModifier, ArgumentProperty, AstFactory, AstNode, AstStatement, CompilationUnit, DataType, - DataTypeDeclaration, DirectAccessType, GenericBinding, HardwareAccessType, Implementation, + AccessModifier, ArgumentProperty, AstFactory, AstNode, AstStatement, AutoDerefType, CompilationUnit, + DataType, DataTypeDeclaration, DirectAccessType, GenericBinding, HardwareAccessType, Implementation, LinkageType, PolymorphismMode, Pou, PouType, ReferenceAccess, ReferenceExpr, TypeNature, UserTypeDeclaration, Variable, VariableBlock, VariableBlockType, }, @@ -23,7 +23,10 @@ use plc_util::convention::qualified_name; use crate::{ expect_token, - lexer::{self, ParseSession, Token, Token::*}, + lexer::{ + self, ParseSession, + Token::{self, *}, + }, typesystem::DINT_TYPE, }; @@ -676,9 +679,9 @@ fn parse_data_type_definition( if expect_keyword_to(lexer).is_some() { lexer.advance(); } - parse_pointer_definition(lexer, name, start_pos, false) + parse_pointer_definition(lexer, name, start_pos, None) } else if lexer.try_consume(&KeywordRef) { - parse_pointer_definition(lexer, name, lexer.last_range.start, false) + parse_pointer_definition(lexer, name, lexer.last_range.start, None) } else if lexer.try_consume(&KeywordParensOpen) { //enum without datatype parse_enum_type_definition(lexer, name) @@ -701,17 +704,12 @@ fn parse_pointer_definition( lexer: &mut ParseSession, name: Option, start_pos: usize, - is_reference_to: bool, + auto_deref: Option, ) -> Option<(DataTypeDeclaration, Option)> { parse_data_type_definition(lexer, None).map(|(decl, initializer)| { ( DataTypeDeclaration::DataTypeDefinition { - data_type: DataType::PointerType { - name, - referenced_type: Box::new(decl), - auto_deref: is_reference_to, - is_reference_to, - }, + data_type: DataType::PointerType { name, referenced_type: Box::new(decl), auto_deref }, location: lexer.source_range_factory.create_range(start_pos..lexer.last_range.end), scope: lexer.scope.clone(), }, @@ -739,7 +737,11 @@ fn parse_type_reference_type_definition( }; let initial_value = - if lexer.try_consume(&KeywordAssignment) { Some(parse_expression(lexer)) } else { None }; + if lexer.try_consume(&KeywordAssignment) || lexer.try_consume(&KeywordReferenceAssignment) { + Some(parse_expression(lexer)) + } else { + None + }; let end = lexer.last_range.end; if name.is_some() || bounds.is_some() { @@ -1070,6 +1072,37 @@ fn parse_variable_list(lexer: &mut ParseSession) -> Vec { variables } +fn parse_aliasing(lexer: &mut ParseSession, names: &(String, Range)) -> Option { + let reference = parse_reference(lexer); + if !lexer.try_consume(&KeywordColon) { + lexer.accept_diagnostic(Diagnostic::missing_token( + format!("{KeywordColon:?}").as_str(), + lexer.location(), + )); + } + + let start = &lexer.location().get_span().to_range().unwrap_or(lexer.last_range.clone()).start; + let datatype = parse_pointer_definition(lexer, None, *start, Some(AutoDerefType::Alias)); + if !lexer.try_consume(&KeywordSemicolon) { + lexer.accept_diagnostic(Diagnostic::missing_token( + format!("{KeywordSemicolon:?}").as_str(), + lexer.location(), + )); + } + + if let Some((data_type, _)) = datatype { + return Some(Variable { + name: names.0.clone(), + data_type_declaration: data_type, + location: lexer.source_range_factory.create_range(names.1.clone()), + initializer: Some(reference), + address: None, + }); + } + + None +} + fn parse_variable_line(lexer: &mut ParseSession) -> Vec { // read in a comma separated list of variable names let mut var_names: Vec<(String, Range)> = vec![]; @@ -1092,16 +1125,22 @@ fn parse_variable_line(lexer: &mut ParseSession) -> Vec { } //See if there's an AT keyword - let address = if lexer.try_consume(&KeywordAt) { - //Look for a hardware address - if let HardwareAccess((direction, access_type)) = lexer.token { - parse_hardware_access(lexer, direction, access_type) - } else { - lexer.accept_diagnostic(Diagnostic::missing_token("Hardware Access", lexer.location())); - None + let mut address: Option = None; + if lexer.try_consume(&KeywordAt) { + match lexer.token { + HardwareAccess((direction, access_type)) => { + address = parse_hardware_access(lexer, direction, access_type) + } + + Identifier => return vec![parse_aliasing(lexer, &var_names[0]).unwrap()], + + _ => { + lexer.accept_diagnostic(Diagnostic::missing_token( + "hardware access or identifier", + lexer.location(), + )); + } } - } else { - None }; // colon has to come before the data type @@ -1116,7 +1155,7 @@ fn parse_variable_line(lexer: &mut ParseSession) -> Vec { let mut variables = vec![]; let parse_definition_opt = if lexer.try_consume(&KeywordReferenceTo) { - parse_pointer_definition(lexer, None, lexer.last_range.start, true) + parse_pointer_definition(lexer, None, lexer.last_range.start, Some(AutoDerefType::Reference)) } else { parse_full_data_type_definition(lexer, None) }; diff --git a/src/parser/expressions_parser.rs b/src/parser/expressions_parser.rs index c9760451ff..ac41e0223f 100644 --- a/src/parser/expressions_parser.rs +++ b/src/parser/expressions_parser.rs @@ -316,7 +316,7 @@ fn parse_atomic_leaf_expression(lexer: &mut ParseSession<'_>) -> Option } fn parse_identifier(lexer: &mut ParseSession<'_>) -> AstNode { - AstFactory::create_identifier(&lexer.slice_and_advance(), &lexer.last_location(), lexer.next_id()) + AstFactory::create_identifier(&lexer.slice_and_advance(), lexer.last_location(), lexer.next_id()) } fn parse_vla_range(lexer: &mut ParseSession) -> Option { @@ -481,7 +481,7 @@ fn parse_direct_access(lexer: &mut ParseSession, access: DirectAccessType) -> Op Identifier => { let location = lexer.location(); Some(AstFactory::create_member_reference( - AstFactory::create_identifier(lexer.slice_and_advance().as_str(), &location, lexer.next_id()), + AstFactory::create_identifier(lexer.slice_and_advance().as_str(), location, lexer.next_id()), None, lexer.next_id(), )) diff --git a/src/parser/tests.rs b/src/parser/tests.rs index f9879edf50..5d3b2f9800 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -23,7 +23,7 @@ mod variable_parser_tests; /// helper function to create references pub fn ref_to(name: &str) -> AstNode { AstFactory::create_member_reference( - AstFactory::create_identifier(name, &SourceLocation::undefined(), 0), + AstFactory::create_identifier(name, SourceLocation::undefined(), 0), None, 0, ) diff --git a/src/parser/tests/expressions_parser_tests.rs b/src/parser/tests/expressions_parser_tests.rs index 7eec8b4575..72f4edde74 100644 --- a/src/parser/tests/expressions_parser_tests.rs +++ b/src/parser/tests/expressions_parser_tests.rs @@ -734,7 +734,7 @@ fn literal_real_test() { fn cast(data_type: &str, value: AstNode) -> AstNode { AstFactory::create_cast_statement( AstFactory::create_member_reference( - AstFactory::create_identifier(data_type, &SourceLocation::undefined(), 0), + AstFactory::create_identifier(data_type, SourceLocation::undefined(), 0), None, 0, ), diff --git a/src/parser/tests/parse_errors/parse_error_statements_tests.rs b/src/parser/tests/parse_errors/parse_error_statements_tests.rs index 635dd03792..65d2419ec0 100644 --- a/src/parser/tests/parse_errors/parse_error_statements_tests.rs +++ b/src/parser/tests/parse_errors/parse_error_statements_tests.rs @@ -1128,8 +1128,7 @@ fn pointer_type_without_to_test() { referenced_type: "INT".to_string(), location: SourceLocation::undefined(), }), - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, location: SourceLocation::undefined(), initializer: None, @@ -1156,8 +1155,7 @@ fn pointer_type_with_wrong_keyword_to_test() { referenced_type: "tu".to_string(), location: SourceLocation::undefined(), }), - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, location: SourceLocation::undefined(), initializer: None, diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap index b7f3076003..670cab7d36 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration-2.snap @@ -10,8 +10,7 @@ Variable { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, }, } diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap index fcdb7bc49c..01eb109c7b 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__global_pointer_declaration.snap @@ -10,8 +10,7 @@ Variable { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, }, } diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap index 576dcbd116..03c86b8ad3 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__pointer_type_test.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: None, diff --git a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap index 332f301817..366d52a65b 100644 --- a/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap +++ b/src/parser/tests/snapshots/rusty__parser__tests__type_parser_tests__ref_type_test.snap @@ -10,8 +10,7 @@ UserTypeDeclaration { referenced_type: DataTypeReference { referenced_type: "INT", }, - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, initializer: None, scope: None, diff --git a/src/parser/tests/statement_parser_tests.rs b/src/parser/tests/statement_parser_tests.rs index c1b1c51d6e..81d2848f38 100644 --- a/src/parser/tests/statement_parser_tests.rs +++ b/src/parser/tests/statement_parser_tests.rs @@ -1,6 +1,6 @@ use crate::{ parser::tests::{empty_stmt, ref_to}, - test_utils::tests::{parse, parse_and_validate_buffered}, + test_utils::tests::parse, typesystem::DINT_TYPE, }; use insta::assert_snapshot; @@ -38,7 +38,7 @@ fn empty_statements_are_parsed_before_a_statement() { empty_stmt(), empty_stmt(), AstFactory::create_member_reference( - AstFactory::create_identifier("x", &SourceLocation::undefined(), 0), + AstFactory::create_identifier("x", SourceLocation::undefined(), 0), None, 0 ), @@ -59,7 +59,7 @@ fn empty_statements_are_ignored_after_a_statement() { let expected_ast = format!( "{:#?}", AstFactory::create_member_reference( - AstFactory::create_identifier("x", &SourceLocation::undefined(), 0), + AstFactory::create_identifier("x", SourceLocation::undefined(), 0), None, 0 ) @@ -322,8 +322,9 @@ fn reference_to_declaration() { referenced_type: DataTypeReference { referenced_type: "DINT", }, - auto_deref: true, - is_reference_to: true, + auto_deref: Some( + Reference, + ), }, }, }, @@ -338,3 +339,49 @@ fn reference_to_declaration() { } "###); } + +#[test] +fn aliasing_dint_variable() { + let (result, diagnostics) = parse( + " + FUNCTION main + VAR + a AT b : DINT; // equivalent to `a : REFERENCE TO DINT REF= b` + END_VAR + END_FUNCTION + ", + ); + + assert_eq!(diagnostics, vec![]); + insta::assert_debug_snapshot!(result.units[0].variable_blocks[0], @r###" + VariableBlock { + variables: [ + Variable { + name: "a", + data_type: DataTypeDefinition { + data_type: PointerType { + name: None, + referenced_type: DataTypeReference { + referenced_type: "DINT", + }, + auto_deref: Some( + Alias, + ), + }, + }, + initializer: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "b", + }, + ), + base: None, + }, + ), + }, + ], + variable_block_type: Local, + } + "###); +} diff --git a/src/resolver.rs b/src/resolver.rs index 2038bc223f..21ca9b9f92 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -10,7 +10,7 @@ use std::hash::Hash; use plc_ast::{ ast::{ - self, flatten_expression_list, Assignment, AstFactory, AstId, AstNode, AstStatement, + self, flatten_expression_list, Assignment, AstFactory, AstId, AstNode, AstStatement, AutoDerefType, BinaryExpression, CompilationUnit, DataType, DataTypeDeclaration, DirectAccessType, JumpStatement, Operator, Pou, ReferenceAccess, ReferenceExpr, TypeNature, UserTypeDeclaration, Variable, }, @@ -391,10 +391,8 @@ pub enum StatementAnnotation { constant: bool, /// denotes the variable type of this variable, hence whether it is an input, output, etc. argument_type: ArgumentType, - /// denotes whether this variable-reference should be automatically dereferenced when accessed - is_auto_deref: bool, - /// denotes whether this variable is declared as `REFERENCE TO` (e.g. `foo : REFERENCE TO DINT`) - is_reference_to: bool, + /// denotes wheter this variable has the auto-deref trait and if so what type + auto_deref: Option, }, /// a reference to a function Function { @@ -435,12 +433,12 @@ impl StatementAnnotation { } } - pub fn is_auto_deref(&self) -> bool { - matches!(self, StatementAnnotation::Variable { is_auto_deref: true, .. }) + pub fn is_alias(&self) -> bool { + matches!(self, StatementAnnotation::Variable { auto_deref: Some(AutoDerefType::Alias), .. }) } - pub fn is_reference_to(&self) -> bool { - matches!(self, StatementAnnotation::Variable { is_reference_to: true, .. }) + pub fn is_auto_deref(&self) -> bool { + matches!(self, StatementAnnotation::Variable { auto_deref: Some(_), .. }) } pub fn data_type(type_name: &str) -> Self { @@ -1024,19 +1022,64 @@ impl<'i> TypeAnnotator<'i> { fn type_hint_for_variable_initializer( &mut self, initializer: &AstNode, - ty: &typesystem::DataType, + variable_ty: &typesystem::DataType, ctx: &VisitorContext, ) { if let AstStatement::ParenExpression(expr) = &initializer.stmt { - self.type_hint_for_variable_initializer(expr, ty, ctx); + self.type_hint_for_variable_initializer(expr, variable_ty, ctx); self.inherit_annotations(initializer, expr); return; } - self.annotation_map.annotate_type_hint(initializer, StatementAnnotation::value(ty.get_name())); - self.update_expected_types(ty, initializer); + self.replace_reference_pointer_initializer(variable_ty, initializer, ctx); + + self.annotation_map.annotate_type_hint(initializer, StatementAnnotation::value(&variable_ty.name)); + self.update_expected_types(variable_ty, initializer); - self.type_hint_for_array_of_structs(ty, initializer, ctx); + self.type_hint_for_array_of_structs(variable_ty, initializer, ctx); + } + + /// Wraps the initializer of a reference- or alias-pointer in a `REF` function call. + /// + /// Initializers already wrapped in a `REF` (or similiar) function call are however excluded, as we do + /// not want something like `REF(REF(...))`. + fn replace_reference_pointer_initializer( + &mut self, + variable_ty: &typesystem::DataType, + initializer: &AstNode, + ctx: &VisitorContext, + ) { + let variable_is_auto_deref_pointer = { + variable_ty.get_type_information().is_alias() + || variable_ty.get_type_information().is_reference_to() + }; + + let initializer_is_not_wrapped_in_ref_call = { + !(initializer.is_call() + && self.annotation_map.get_type(initializer, self.index).is_some_and(|opt| opt.is_pointer())) + }; + + if variable_is_auto_deref_pointer && initializer_is_not_wrapped_in_ref_call { + debug_assert!(builtins::get_builtin("REF").is_some(), "REF must exist for this use-case"); + + let mut id_provider = ctx.id_provider.clone(); + let location = &initializer.location; + + let ref_ident = AstFactory::create_identifier("REF", location, id_provider.next_id()); + let fn_name = AstFactory::create_member_reference(ref_ident, None, id_provider.next_id()); + let fn_arg = initializer; + self.visit_statement(ctx, &fn_name); + self.visit_statement(ctx, fn_arg); + + let fn_call = AstFactory::create_call_statement( + fn_name, + Some(fn_arg.clone()), + id_provider.next_id(), + location, + ); + self.visit_statement(ctx, &fn_call); + self.annotate(initializer, StatementAnnotation::ReplacementAst { statement: fn_call }); + } } fn type_hint_for_array_of_structs( @@ -1553,7 +1596,7 @@ impl<'i> TypeAnnotator<'i> { } } (ReferenceAccess::Deref, _) => { - if let Some(DataTypeInformation::Pointer { inner_type_name, auto_deref: false, .. }) = base + if let Some(DataTypeInformation::Pointer { inner_type_name, auto_deref: None, .. }) = base .map(|base| self.annotation_map.get_type_or_void(base, self.index)) .map(|it| it.get_type_information()) { @@ -1638,7 +1681,7 @@ impl<'i> TypeAnnotator<'i> { else { unreachable!("expected a vla reference, but got {statement:#?}"); }; - if let DataTypeInformation::Pointer { inner_type_name, is_reference_to, .. } = &self + if let DataTypeInformation::Pointer { inner_type_name, auto_deref: kind, .. } = &self .index .get_effective_type_or_void_by_name( members.first().expect("internal VLA struct ALWAYS has this member").get_type_name(), @@ -1673,8 +1716,7 @@ impl<'i> TypeAnnotator<'i> { qualified_name: qualified_name.to_string(), constant: false, argument_type, - is_auto_deref: false, - is_reference_to: *is_reference_to, + auto_deref: *kind, }; self.annotation_map.annotate_type_hint(statement, hint_annotation) } @@ -1886,10 +1928,9 @@ pub(crate) fn add_pointer_type(index: &mut Index, inner_type_name: String) -> St initial_value: None, nature: TypeNature::Any, information: DataTypeInformation::Pointer { - auto_deref: false, - inner_type_name, name: new_type_name.clone(), - is_reference_to: false, + inner_type_name, + auto_deref: None, }, location: SourceLocation::internal(), }); @@ -1925,22 +1966,21 @@ fn to_variable_annotation( index: &Index, constant_override: bool, ) -> StatementAnnotation { - const AUTO_DEREF: bool = true; - const NO_DEREF: bool = false; let v_type = index.get_effective_type_or_void_by_name(v.get_type_name()); //see if this is an auto-deref variable - let (effective_type_name, is_auto_deref) = match (v_type.get_type_information(), v.is_return()) { + let (effective_type_name, kind) = match (v_type.get_type_information(), v.is_return()) { (_, true) if v_type.is_aggregate_type() => { // treat a return-aggregate variable like an auto-deref pointer since it got // passed by-ref - (v_type.get_name().to_string(), AUTO_DEREF) + let kind = v_type.get_type_information().get_auto_deref_type().unwrap_or(AutoDerefType::Default); + (v_type.get_name().to_string(), Some(kind)) } - (DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. }, _) => { + (DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(deref), .. }, _) => { // real auto-deref pointer - (inner_type_name.clone(), AUTO_DEREF) + (inner_type_name.clone(), Some(*deref)) } - _ => (v_type.get_name().to_string(), NO_DEREF), + _ => (v_type.get_name().to_string(), None), }; StatementAnnotation::Variable { @@ -1948,8 +1988,7 @@ fn to_variable_annotation( resulting_type: effective_type_name, constant: v.is_constant() || constant_override, argument_type: v.get_declaration_type(), - is_auto_deref, - is_reference_to: v_type.get_type_information().is_reference_to(), + auto_deref: kind, } } diff --git a/src/resolver/generics.rs b/src/resolver/generics.rs index 6d7861b7e4..509c321ab1 100644 --- a/src/resolver/generics.rs +++ b/src/resolver/generics.rs @@ -201,7 +201,7 @@ impl<'i> TypeAnnotator<'i> { .unwrap_or_else(|| member_name) .to_string() } - Some(DataTypeInformation::Pointer { name, inner_type_name, auto_deref: true, .. }) => { + Some(DataTypeInformation::Pointer { name, inner_type_name, auto_deref: Some(kind), .. }) => { // This is an auto deref pointer (VAR_IN_OUT or VAR_INPUT {ref}) that points to a // generic. We first resolve the generic type, then create a new pointer type of // the combination @@ -210,8 +210,7 @@ impl<'i> TypeAnnotator<'i> { let new_type_info = DataTypeInformation::Pointer { name: name.clone(), inner_type_name, - auto_deref: true, - is_reference_to: false, + auto_deref: Some(*kind), }; // Registers a new pointer type to the index diff --git a/src/resolver/tests.rs b/src/resolver/tests.rs index 15f0039de2..0813304d6b 100644 --- a/src/resolver/tests.rs +++ b/src/resolver/tests.rs @@ -1,4 +1,5 @@ mod const_resolver_tests; +mod lowering; mod resolve_control_statments; mod resolve_expressions_tests; mod resolve_generic_calls; diff --git a/src/resolver/tests/lowering.rs b/src/resolver/tests/lowering.rs new file mode 100644 index 0000000000..ca69f09804 --- /dev/null +++ b/src/resolver/tests/lowering.rs @@ -0,0 +1,240 @@ +//! Contains tests related to lowering, i.e. (for now) anything that uses the `ReplacementAst`. + +use insta::assert_debug_snapshot; +use plc_ast::provider::IdProvider; + +use crate::{ + resolver::AnnotationMap, + test_utils::tests::{annotate_with_ids, index_with_ids}, +}; + +#[test] +fn initializer_with_ref_call_annotated_as_pointer() { + let id_provider = IdProvider::default(); + let (unit, mut index) = index_with_ids( + " + FUNCTION main + VAR + foo : DINT; + bar : REFERENCE TO DINT := REF(foo); + END_VAR + END_FUNCTION + ", + id_provider.clone(), + ); + + let annotations = annotate_with_ids(&unit, &mut index, id_provider); + let initializer_bar = unit.units[0].variable_blocks[0].variables[1].initializer.as_ref().unwrap(); + let initializer_bar_annotation = annotations.get(initializer_bar).unwrap(); + + assert_debug_snapshot!((initializer_bar, initializer_bar_annotation), @r###" + ( + CallStatement { + operator: ReferenceExpr { + kind: Member( + Identifier { + name: "REF", + }, + ), + base: None, + }, + parameters: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ), + }, + Value { + resulting_type: "__POINTER_TO_DINT", + }, + ) + "###); +} + +#[test] +fn initializer_with_refassignment_annotated_with_replacementast() { + let id_provider = IdProvider::default(); + let (unit, mut index) = index_with_ids( + " + FUNCTION main + VAR + foo : DINT; + bar : REFERENCE TO DINT REF= foo; + END_VAR + END_FUNCTION + ", + id_provider.clone(), + ); + + let annotations = annotate_with_ids(&unit, &mut index, id_provider); + let initializer_bar = unit.units[0].variable_blocks[0].variables[1].initializer.as_ref().unwrap(); + let initializer_bar_annotation = annotations.get(initializer_bar).unwrap(); + + assert_debug_snapshot!((initializer_bar, initializer_bar_annotation), @r###" + ( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ReplacementAst { + statement: CallStatement { + operator: ReferenceExpr { + kind: Member( + Identifier { + name: "REF", + }, + ), + base: None, + }, + parameters: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ), + }, + }, + ) + "###); +} + +#[test] +fn initializer_of_alias_annotated_with_replacementast() { + let id_provider = IdProvider::default(); + let (unit, mut index) = index_with_ids( + " + FUNCTION main + VAR + foo : DINT; + bar AT foo : DINT; + END_VAR + END_FUNCTION + ", + id_provider.clone(), + ); + + let annotations = annotate_with_ids(&unit, &mut index, id_provider); + let initializer_bar = unit.units[0].variable_blocks[0].variables[1].initializer.as_ref().unwrap(); + let initializer_bar_annotation = annotations.get(initializer_bar).unwrap(); + + assert_debug_snapshot!((initializer_bar, initializer_bar_annotation), @r###" + ( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ReplacementAst { + statement: CallStatement { + operator: ReferenceExpr { + kind: Member( + Identifier { + name: "REF", + }, + ), + base: None, + }, + parameters: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ), + }, + }, + ) + "###); +} + +#[test] +fn initializer_of_alias_annotated_with_replacementast_array() { + let id_provider = IdProvider::default(); + let (unit, mut index) = index_with_ids( + " + FUNCTION main + VAR + foo : ARRAY[1..5] OF DINT; + bar AT foo[1] : DINT; + END_VAR + END_FUNCTION + ", + id_provider.clone(), + ); + + let annotations = annotate_with_ids(&unit, &mut index, id_provider); + let initializer_bar = unit.units[0].variable_blocks[0].variables[1].initializer.as_ref().unwrap(); + let initializer_bar_annotation = annotations.get(initializer_bar).unwrap(); + + assert_debug_snapshot!((initializer_bar, initializer_bar_annotation), @r###" + ( + ReferenceExpr { + kind: Index( + LiteralInteger { + value: 1, + }, + ), + base: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ), + }, + ReplacementAst { + statement: CallStatement { + operator: ReferenceExpr { + kind: Member( + Identifier { + name: "REF", + }, + ), + base: None, + }, + parameters: Some( + ReferenceExpr { + kind: Index( + LiteralInteger { + value: 1, + }, + ), + base: Some( + ReferenceExpr { + kind: Member( + Identifier { + name: "foo", + }, + ), + base: None, + }, + ), + }, + ), + }, + }, + ) + "###); +} diff --git a/src/resolver/tests/resolve_expressions_tests.rs b/src/resolver/tests/resolve_expressions_tests.rs index 44872aec2b..10c9a14479 100644 --- a/src/resolver/tests/resolve_expressions_tests.rs +++ b/src/resolver/tests/resolve_expressions_tests.rs @@ -162,8 +162,7 @@ fn cast_expressions_of_enum_with_resolves_types() { qualified_name: "MyEnum.a".to_string(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }) ); @@ -179,8 +178,7 @@ fn cast_expressions_of_enum_with_resolves_types() { qualified_name: "MyEnum.b".to_string(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }) ); } @@ -1313,9 +1311,8 @@ fn function_expression_resolves_to_the_function_itself_not_its_return_type() { qualified_name: "foo.foo".into(), resulting_type: "INT".into(), constant: false, - is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Return), - is_reference_to: false, + auto_deref: None, }), foo_annotation ); @@ -1575,9 +1572,8 @@ fn qualified_expressions_dont_fallback_to_globals() { qualified_name: "MyStruct.y".into(), resulting_type: "INT".into(), constant: false, - is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_reference_to: false, + auto_deref: None, }), annotations.get(&statements[1]) ); @@ -1817,9 +1813,8 @@ fn method_references_are_resolved() { qualified_name: "cls.foo.foo".into(), resulting_type: "INT".into(), constant: false, - is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Return), - is_reference_to: false, + auto_deref: None, }), annotation ); @@ -2453,8 +2448,7 @@ fn struct_member_explicit_initialization_test() { qualified_name: "myStruct.var1".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }), annotations.get(left) ); @@ -2468,8 +2462,7 @@ fn struct_member_explicit_initialization_test() { qualified_name: "myStruct.var2".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }), annotations.get(left) ); @@ -2949,9 +2942,8 @@ fn action_body_gets_resolved() { qualified_name: "prg.x".to_string(), resulting_type: "DINT".to_string(), constant: false, - is_auto_deref: false, argument_type: ArgumentType::ByVal(VariableType::Local), - is_reference_to: false, + auto_deref: None, }), a ); @@ -3393,10 +3385,9 @@ fn address_of_is_annotated_correctly() { if let Some(&StatementAnnotation::Value { resulting_type }) = annotations.get(s).as_ref() { assert_eq!( Some(&DataTypeInformation::Pointer { - is_reference_to: false, - auto_deref: false, inner_type_name: "INT".to_string(), name: "__POINTER_TO_INT".to_string(), + auto_deref: None, }), index.find_effective_type_info(resulting_type), ); @@ -3477,8 +3468,7 @@ fn call_explicit_parameter_name_is_resolved() { qualified_name: "fb.b".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }), annotations.get(b.as_ref()) ); @@ -3489,8 +3479,7 @@ fn call_explicit_parameter_name_is_resolved() { qualified_name: "fb.a".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }), annotations.get(a) ); @@ -3712,8 +3701,7 @@ fn function_block_initialization_test() { qualified_name: "TON.PT".into(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Input), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, } ) } else { @@ -3848,8 +3836,7 @@ fn resolve_return_variable_in_nested_call() { qualified_name: "main.main".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Return), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, } ) } @@ -5093,8 +5080,7 @@ fn annotate_variable_in_parent_class() { qualified_name: "cls1.LIGHT".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5109,8 +5095,7 @@ fn annotate_variable_in_parent_class() { qualified_name: "cls2.Light2".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5148,8 +5133,7 @@ fn annotate_variable_in_grandparent_class() { qualified_name: "cls0.LIGHT".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5194,8 +5178,7 @@ fn annotate_variable_in_field() { qualified_name: "cls0.LIGHT".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5252,8 +5235,7 @@ fn annotate_method_in_super() { qualified_name: "cls0.LIGHT".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5268,8 +5250,7 @@ fn annotate_method_in_super() { qualified_name: "cls1.LIGHT1".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5284,8 +5265,7 @@ fn annotate_method_in_super() { qualified_name: "cls0.LIGHT".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5300,8 +5280,7 @@ fn annotate_method_in_super() { qualified_name: "cls1.LIGHT1".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); @@ -5316,8 +5295,7 @@ fn annotate_method_in_super() { qualified_name: "cls2.LIGHT2".to_string(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local,), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, annotation.unwrap() ); diff --git a/src/resolver/tests/resolve_generic_calls.rs b/src/resolver/tests/resolve_generic_calls.rs index 706f8e525c..f517aa5157 100644 --- a/src/resolver/tests/resolve_generic_calls.rs +++ b/src/resolver/tests/resolve_generic_calls.rs @@ -716,7 +716,7 @@ fn auto_pointer_of_generic_resolved() { let member = index.find_member("LEFT_EXT__DINT", "IN").unwrap(); let dt = index.find_effective_type_info(&member.data_type_name).unwrap(); - if let DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. } = dt { + if let DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(_), .. } = dt { assert_eq!(inner_type_name, "DINT") } else { panic!("Expecting a pointer to dint, found {dt:?}") @@ -767,7 +767,7 @@ fn string_ref_as_generic_resolved() { let member = index.find_member("LEFT_EXT__STRING", "IN").unwrap(); let dt = index.find_effective_type_info(&member.data_type_name).unwrap(); - if let DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. } = dt { + if let DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(_), .. } = dt { assert_eq!(inner_type_name, STRING_TYPE) } else { panic!("Expecting auto deref pointer to string, found {dt:?}") diff --git a/src/resolver/tests/resolve_literals_tests.rs b/src/resolver/tests/resolve_literals_tests.rs index 42d39cd54d..30636c1c70 100644 --- a/src/resolver/tests/resolve_literals_tests.rs +++ b/src/resolver/tests/resolve_literals_tests.rs @@ -312,8 +312,7 @@ fn enum_literals_target_are_annotated() { qualified_name: "Color.Red".into(), constant: true, argument_type: ArgumentType::ByVal(crate::index::VariableType::Global), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }), annotations.get(target) ); diff --git a/src/tests/adr/annotated_ast_adr.rs b/src/tests/adr/annotated_ast_adr.rs index 6845bd2163..6bc6ffa1f0 100644 --- a/src/tests/adr/annotated_ast_adr.rs +++ b/src/tests/adr/annotated_ast_adr.rs @@ -49,8 +49,7 @@ fn references_to_variables_are_annotated() { qualified_name: "prg.a".into(), constant: false, argument_type: ArgumentType::ByVal(VariableType::Local), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, } ); @@ -62,8 +61,7 @@ fn references_to_variables_are_annotated() { qualified_name: "gX".into(), constant: true, argument_type: ArgumentType::ByVal(VariableType::Global), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, } ); } @@ -106,9 +104,8 @@ fn different_types_of_annotations() { qualified_name: "POINT.x".into(), // the qualified name of the target element resulting_type: "SINT".into(), // the variable's type constant: false, // whether this variable is a constant or not - is_auto_deref: false, // whether this pointerType should be automatically dereferenced - is_reference_to: false, // whether this pointerType was declared as `REFERENCE TO`, making it auto-deref by default argument_type: ArgumentType::ByVal(VariableType::Input), // the type of declaration + auto_deref: None, }) ); @@ -156,9 +153,8 @@ fn different_types_of_annotations() { qualified_name: "Main.in".into(), resulting_type: "INT".into(), constant: false, - is_auto_deref: false, - is_reference_to: false, argument_type: ArgumentType::ByVal(VariableType::Input), + auto_deref: None, }) ); @@ -169,9 +165,8 @@ fn different_types_of_annotations() { qualified_name: "Main.in".into(), resulting_type: "INT".into(), constant: false, - is_auto_deref: false, - is_reference_to: false, argument_type: ArgumentType::ByVal(VariableType::Input), + auto_deref: None, }) ); } diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index 29c9816894..38d3a8eb83 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -103,8 +103,7 @@ fn representation() { information: Pointer { name: "__ptr_to___arr_vla_1_dint", inner_type_name: "__arr_vla_1_dint", - auto_deref: false, - is_reference_to: false, + auto_deref: None, }, nature: Any, location: SourceLocation { diff --git a/src/typesystem.rs b/src/typesystem.rs index 3e19f5665d..b915271d7d 100644 --- a/src/typesystem.rs +++ b/src/typesystem.rs @@ -6,7 +6,7 @@ use std::{ }; use plc_ast::{ - ast::{AstNode, Operator, PouType, TypeNature}, + ast::{AstNode, AutoDerefType, Operator, PouType, TypeNature}, literals::{AstLiteral, StringValue}, }; use plc_source::source_location::SourceLocation; @@ -390,9 +390,7 @@ pub enum DataTypeInformation { Pointer { name: TypeId, inner_type_name: TypeId, - auto_deref: bool, - /// Denotes whether the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT` - is_reference_to: bool, + auto_deref: Option, }, Integer { name: TypeId, @@ -445,6 +443,13 @@ impl DataTypeInformation { } } + pub fn get_inner_name(&self) -> &str { + match self { + DataTypeInformation::Pointer { inner_type_name, .. } => inner_type_name, + _ => self.get_name(), + } + } + pub fn is_void(&self) -> bool { matches!(self, DataTypeInformation::Void) } @@ -563,7 +568,16 @@ impl DataTypeInformation { /// Returns true if the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT`. pub fn is_reference_to(&self) -> bool { - matches!(self, DataTypeInformation::Pointer { is_reference_to: true, .. }) + matches!(self, DataTypeInformation::Pointer { auto_deref: Some(AutoDerefType::Reference), .. }) + } + + /// Returns true if the variable was declared as `REFERENCE TO`, e.g. `foo : REFERENCE TO DINT`. + pub fn is_alias(&self) -> bool { + matches!(self, DataTypeInformation::Pointer { auto_deref: Some(AutoDerefType::Alias), .. }) + } + + pub fn is_auto_deref(&self) -> bool { + matches!(self, DataTypeInformation::Pointer { auto_deref: Some(_), .. }) } pub fn is_aggregate(&self) -> bool { @@ -575,6 +589,14 @@ impl DataTypeInformation { ) } + pub fn get_auto_deref_type(&self) -> Option { + if let DataTypeInformation::Pointer { auto_deref: kind, .. } = self { + return *kind; + } + + None + } + pub fn is_date_or_time_type(&self) -> bool { matches!(self.get_name(), DATE_TYPE | DATE_AND_TIME_TYPE | TIME_OF_DAY_TYPE | TIME_TYPE) } diff --git a/src/validation/array.rs b/src/validation/array.rs index f87e7a367c..596dc3ff0b 100644 --- a/src/validation/array.rs +++ b/src/validation/array.rs @@ -194,7 +194,7 @@ impl<'a> StatementWrapper<'a> { where T: AnnotationMap, { - match self { + let ty = match self { StatementWrapper::Statement(statement) => { let AstNode { stmt: AstStatement::Assignment(data), .. } = statement else { return None }; context.annotations.get_type(&data.left, context.index).map(|it| it.get_type_information()) @@ -204,6 +204,11 @@ impl<'a> StatementWrapper<'a> { .data_type_declaration .get_referenced_type() .and_then(|it| context.index.find_effective_type_info(&it)), + }?; + + match ty { + DataTypeInformation::Pointer { .. } => Some(context.index.find_elementary_pointer_type(ty)), + _ => Some(ty), } } } diff --git a/src/validation/statement.rs b/src/validation/statement.rs index 2115972180..8c2aa88009 100644 --- a/src/validation/statement.rs +++ b/src/validation/statement.rs @@ -100,6 +100,8 @@ pub fn visit_statement( visit_statement(validator, &data.right, context); validate_ref_assignment(context, validator, data, &statement.location); + validate_alias_assignment(validator, context, statement); + validate_array_assignment(validator, context, statement); } AstStatement::CallStatement(data) => { validate_call(validator, &data.operator, data.parameters.as_deref(), &context.set_is_call()); @@ -769,6 +771,46 @@ fn validate_call_by_ref(validator: &mut Validator, param: &VariableIndexEntry, a } } +pub fn validate_pointer_assignment( + context: &ValidationContext, + validator: &mut Validator, + type_lhs: &DataType, + type_rhs: &DataType, + assignment_location: &SourceLocation, +) where + T: AnnotationMap, +{ + let type_info_lhs = context.index.find_elementary_pointer_type(type_lhs.get_type_information()); + let type_info_rhs = context.index.find_elementary_pointer_type(type_rhs.get_type_information()); + + if type_info_lhs.is_array() && type_info_rhs.is_array() { + let len_lhs = type_info_lhs.get_array_length(context.index).unwrap_or_default(); + let len_rhs = type_info_rhs.get_array_length(context.index).unwrap_or_default(); + + let inner_ty_name_lhs = type_info_lhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); + let inner_ty_name_rhs = type_info_rhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); + let inner_ty_lhs = context.index.find_effective_type_by_name(inner_ty_name_lhs); + let inner_ty_rhs = context.index.find_effective_type_by_name(inner_ty_name_rhs); + + if len_lhs != len_rhs || inner_ty_lhs != inner_ty_rhs { + validator.push_diagnostic(Diagnostic::invalid_assignment( + &get_datatype_name_or_slice(validator.context, type_rhs), + &get_datatype_name_or_slice(validator.context, type_lhs), + assignment_location, + )); + } + } else if type_info_lhs != type_info_rhs { + let type_name_lhs = get_datatype_name_or_slice(validator.context, type_lhs); + let type_name_rhs = get_datatype_name_or_slice(validator.context, type_rhs); + + validator.push_diagnostic(Diagnostic::invalid_assignment( + &type_name_rhs, + &type_name_lhs, + assignment_location, + )); + } +} + /// Checks if `REF=` assignments are correct, specifically if the left-hand side is a reference declared /// as `REFERENCE TO` and the right hand side is a lvalue of the same type that is being referenced. fn validate_ref_assignment( @@ -777,11 +819,9 @@ fn validate_ref_assignment( assignment: &Assignment, assignment_location: &SourceLocation, ) { + let annotation_lhs = context.annotations.get(&assignment.left); let type_lhs = context.annotations.get_type_or_void(&assignment.left, context.index); let type_rhs = context.annotations.get_type_or_void(&assignment.right, context.index); - let type_info_lhs = context.index.find_elementary_pointer_type(type_lhs.get_type_information()); - let type_info_rhs = context.index.find_elementary_pointer_type(type_rhs.get_type_information()); - let annotation_lhs = context.annotations.get(&assignment.left); // Assert that the right-hand side is a reference if !assignment.right.is_reference() { @@ -793,7 +833,7 @@ fn validate_ref_assignment( } // Assert that the left-hand side is a valid pointer-reference - if !annotation_lhs.is_some_and(StatementAnnotation::is_reference_to) && !type_lhs.is_pointer() { + if !type_lhs.is_pointer() && !annotation_lhs.is_some_and(|opt| opt.is_auto_deref()) { validator.push_diagnostic( Diagnostic::new("Invalid assignment, expected a pointer reference") .with_location(&assignment.left.location) @@ -801,46 +841,26 @@ fn validate_ref_assignment( ) } - if type_info_lhs.is_array() && type_info_rhs.is_array() { - let mut messages = Vec::new(); - - let len_lhs = type_info_lhs.get_array_length(context.index).unwrap_or_default(); - let len_rhs = type_info_rhs.get_array_length(context.index).unwrap_or_default(); - - if len_lhs < len_rhs { - messages.push(format!("Invalid assignment, array lengths {len_lhs} and {len_rhs} differ")); - } - - let inner_ty_name_lhs = type_info_lhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); - let inner_ty_name_rhs = type_info_rhs.get_inner_array_type_name().unwrap_or(VOID_TYPE); - let inner_ty_lhs = context.index.find_effective_type_by_name(inner_ty_name_lhs); - let inner_ty_rhs = context.index.find_effective_type_by_name(inner_ty_name_rhs); - - if inner_ty_lhs != inner_ty_rhs { - messages.push(format!( - "Invalid assignment, array types {inner_ty_name_lhs} and {inner_ty_name_rhs} differ" - )); - } + validate_pointer_assignment(context, validator, type_lhs, type_rhs, assignment_location); +} - for message in messages { +/// Returns a diagnostic if an alias declared variables address is re-assigned in the POU body. +fn validate_alias_assignment( + validator: &mut Validator, + context: &ValidationContext, + ref_assignment: &AstNode, +) { + if let AstStatement::RefAssignment(Assignment { left, .. }) = ref_assignment.get_stmt() { + if context.annotations.get(left).is_some_and(|opt| opt.is_alias()) { validator.push_diagnostic( - Diagnostic::new(message).with_location(assignment_location).with_error_code("E098"), + Diagnostic::new(format!( + "{} is an immutable alias variable, can not change the address", + validator.context.slice(&left.location) + )) + .with_location(&ref_assignment.location) + .with_error_code("E100"), ) } - - return; - } - - if type_info_lhs != type_info_rhs { - validator.push_diagnostic( - Diagnostic::new(format!( - "Invalid assignment, types {} and {} differ", - get_datatype_name_or_slice(validator.context, type_lhs), - get_datatype_name_or_slice(validator.context, type_rhs), - )) - .with_location(assignment_location) - .with_error_code("E098"), - ); } } @@ -909,7 +929,7 @@ fn validate_assignment( if let (Some(right_type), Some(left_type)) = (right_type, left_type) { // implicit call parameter assignments are annotated to auto_deref pointers for ´ByRef` parameters // we need the inner type - let left_type = if let DataTypeInformation::Pointer { inner_type_name, auto_deref: true, .. } = + let left_type = if let DataTypeInformation::Pointer { inner_type_name, auto_deref: Some(_), .. } = left_type.get_type_information() { context.index.get_effective_type_or_void_by_name(inner_type_name) @@ -938,11 +958,7 @@ fn validate_assignment( .with_location(location), ); } else { - validator.push_diagnostic(Diagnostic::invalid_assignment( - &get_datatype_name_or_slice(validator.context, right_type), - &get_datatype_name_or_slice(validator.context, left_type), - location.clone(), - )); + validate_pointer_assignment(context, validator, left_type, right_type, location); } } else { validate_assignment_type_sizes(validator, left_type, right, context) @@ -1137,7 +1153,7 @@ fn is_invalid_pointer_assignment( return !typesystem::is_same_type_class(left_type, right_type, index); } //check if Datatype can hold a Pointer (u64) - else if right_type.is_pointer() + else if (right_type.is_pointer() && !right_type.is_auto_deref()) && !left_type.is_pointer() && left_type.get_size_in_bits(index) < POINTER_SIZE { @@ -1595,7 +1611,7 @@ fn validate_argument_count( } } -mod helper { +pub(crate) mod helper { use std::ops::Range; use plc_ast::ast::{AstNode, DirectAccessType}; @@ -1633,7 +1649,7 @@ mod helper { pub fn get_datatype_name_or_slice(context: &GlobalContext, dt: &DataType) -> String { if dt.is_internal() { - return dt.get_type_information().get_name().to_string(); + return dt.get_type_information().get_inner_name().to_string(); } context.slice(&dt.location) diff --git a/src/validation/tests/assignment_validation_tests.rs b/src/validation/tests/assignment_validation_tests.rs index 219dc6872d..ddf4ce82f6 100644 --- a/src/validation/tests/assignment_validation_tests.rs +++ b/src/validation/tests/assignment_validation_tests.rs @@ -1,6 +1,6 @@ -use insta::assert_snapshot; +use insta::{assert_debug_snapshot, assert_snapshot}; -use crate::test_utils::tests::parse_and_validate_buffered; +use crate::test_utils::tests::{parse_and_validate, parse_and_validate_buffered}; #[test] fn constant_assignment_validation() { @@ -1261,11 +1261,11 @@ fn ref_assignments() { 17 │ localINT REF= localDINT; │ ^^^^^^^^ Invalid assignment, expected a pointer reference - error[E098]: Invalid assignment, types INT and DINT differ + error[E037]: Invalid assignment: cannot assign 'DINT' to 'INT' ┌─ :17:13 │ 17 │ localINT REF= localDINT; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types INT and DINT differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'DINT' to 'INT' error[E098]: Invalid assignment, expected a reference ┌─ :18:38 @@ -1279,17 +1279,17 @@ fn ref_assignments() { 19 │ localReferenceTo REF= 1; │ ^ Invalid assignment, expected a reference - error[E098]: Invalid assignment, types DINT and INT differ + error[E037]: Invalid assignment: cannot assign 'INT' to 'DINT' ┌─ :21:13 │ 21 │ localReferenceTo REF= localINT; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and INT differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'INT' to 'DINT' - error[E098]: Invalid assignment, types DINT and STRING differ + error[E037]: Invalid assignment: cannot assign 'STRING' to 'DINT' ┌─ :22:13 │ 22 │ localReferenceTo REF= localSTRING; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'STRING' to 'DINT' error[E098]: Invalid assignment, expected a reference ┌─ :23:38 @@ -1297,11 +1297,11 @@ fn ref_assignments() { 23 │ localReferenceTo REF= 'howdy'; │ ^^^^^^^ Invalid assignment, expected a reference - error[E098]: Invalid assignment, types DINT and STRING differ + error[E037]: Invalid assignment: cannot assign 'STRING' to 'DINT' ┌─ :23:13 │ 23 │ localReferenceTo REF= 'howdy'; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'STRING' to 'DINT' "###); } @@ -1355,23 +1355,17 @@ fn ref_assignment_with_global_local_variables_and_aliased_types() { 18 │ invalidB : REFERENCE TO fooGlobal; │ ^^^^^^^^^^^^^^^^^^^^^^ REFERENCE TO variables can not reference other variables - error[E099]: Initializations of REFERENCE TO variables are disallowed - ┌─ :19:49 - │ - 19 │ invalidC : REFERENCE TO DINT := 5; - │ ^ Initializations of REFERENCE TO variables are disallowed - - error[E098]: Invalid assignment, types DINT and INT differ + error[E037]: Invalid assignment: cannot assign 'INT' to 'DINT' ┌─ :28:13 │ 28 │ referenceToFooFirstOfHisName REF= intLocal; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and INT differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'INT' to 'DINT' - error[E098]: Invalid assignment, types DINT and STRING differ + error[E037]: Invalid assignment: cannot assign 'STRING' to 'DINT' ┌─ :29:13 │ 29 │ referenceToFooFirstOfHisName REF= stringLocal; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types DINT and STRING differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'STRING' to 'DINT' "###); } @@ -1394,17 +1388,11 @@ fn ref_assignment_with_reference_to_array_variable() { ); assert_snapshot!(diagnostics, @r###" - error[E098]: Invalid assignment, array lengths 5 and 6 differ - ┌─ :10:13 - │ - 10 │ arrReferenceDINT REF= arrSTRING; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, array lengths 5 and 6 differ - - error[E098]: Invalid assignment, array types DINT and STRING differ + error[E037]: Invalid assignment: cannot assign 'ARRAY[1..6] OF STRING' to 'REFERENCE TO ARRAY[1..5] OF DINT' ┌─ :10:13 │ 10 │ arrReferenceDINT REF= arrSTRING; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, array types DINT and STRING differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'ARRAY[1..6] OF STRING' to 'REFERENCE TO ARRAY[1..5] OF DINT' "###); } @@ -1429,17 +1417,17 @@ fn ref_assignment_with_reference_to_string_variable() { ); assert_snapshot!(diagnostics, @r###" - error[E098]: Invalid assignment, types STRING and CHAR differ + error[E037]: Invalid assignment: cannot assign 'CHAR' to 'STRING' ┌─ :10:13 │ 10 │ referenceToString REF= localCHAR; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types STRING and CHAR differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'CHAR' to 'STRING' - error[E098]: Invalid assignment, types STRING and WSTRING differ + error[E037]: Invalid assignment: cannot assign 'WSTRING' to 'STRING' ┌─ :12:13 │ 12 │ referenceToString REF= localWSTRING; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment, types STRING and WSTRING differ + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'WSTRING' to 'STRING' "###); } @@ -1491,3 +1479,103 @@ fn invalid_reference_to_declaration() { "###); } + +#[test] +fn alias_variable_type_check() { + let diagnostics = parse_and_validate( + r" + FUNCTION foo + VAR + dintVar : DINT; + sintVar : SINT; + stringVar : STRING; + arrayDintVar : ARRAY[1..5] OF DINT; + + dintVarRefA AT dintVar : DINT; // Valid + dintVarRefB AT sintVar : DINT; // Invalid + dintVarRefC AT stringVar : DINT; // Invalid + dintVarRefD AT arrayDintVar : DINT; // Invalid + + sintVarRefA AT dintVar : SINT; // Invalid + sintVarRefB AT sintVar : SINT; // Valid + sintVarRefC AT stringVar : SINT; // Invalid + sintVarRefD AT arrayDintVar : SINT; // Invalid + + stringVarRefA AT dintVar : STRING; // Invalid + stringVarRefB AT sintVar : STRING; // Invalid + stringVarRefC AT stringVar : STRING; // Valid + stringVarRefD AT arrayDintVar : STRING; // Invalid + + arrayDintVarRefA AT dintVar : ARRAY[1..5] OF DINT; // Invalid + arrayDintVarRefB AT sintVar : ARRAY[1..5] OF DINT; // Invalid + arrayDintVarRefC AT stringVar : ARRAY[1..5] OF DINT; // Invalid + arrayDintVarRefD AT arrayDintVar : ARRAY[1..5] OF DINT; // Valid + END_VAR + END_FUNCTION + ", + ); + + // Note: This assertion must fail once init functions are implemented and can then also be deleted + assert!(diagnostics.iter().any(|diagnostics| diagnostics.get_error_code() == "E033")); + + // TODO: Use parse_and_validate_buffered once above assertion is deleted + let diagnostics_messages_without_const_error = diagnostics + .iter() + .filter(|diagnostic| diagnostic.get_error_code() != "E033") + .map(|diagnostic| diagnostic.get_message()) + .collect::>(); + + assert_eq!(diagnostics_messages_without_const_error.len(), 12); + assert_debug_snapshot!(diagnostics_messages_without_const_error, @r###" + [ + "Invalid assignment: cannot assign 'SINT' to 'DINT'", + "Invalid assignment: cannot assign 'STRING' to 'DINT'", + "Invalid assignment: cannot assign '__foo_arrayDintVar' to 'DINT'", + "Invalid assignment: cannot assign 'DINT' to 'SINT'", + "Invalid assignment: cannot assign 'STRING' to 'SINT'", + "Invalid assignment: cannot assign '__foo_arrayDintVar' to 'SINT'", + "Invalid assignment: cannot assign 'DINT' to 'STRING'", + "Invalid assignment: cannot assign 'SINT' to 'STRING'", + "Invalid assignment: cannot assign '__foo_arrayDintVar' to 'STRING'", + "Invalid assignment: cannot assign 'DINT' to 'ARRAY[1..5] OF DINT'", + "Invalid assignment: cannot assign 'SINT' to 'ARRAY[1..5] OF DINT'", + "Invalid assignment: cannot assign 'STRING' to 'ARRAY[1..5] OF DINT'", + ] + "###); +} + +#[test] +fn reassignment_of_alias_variables_is_disallowed() { + let diagnostics = parse_and_validate( + r" + FUNCTION main + VAR + foo AT bar : DINT; + bar : DINT; + baz : DINT; + END_VAR + + foo := bar; // Valid, the dereferenced value of `foo` is being changed + foo := baz; // Valid, same reason as above + foo REF= bar; // Invalid, the address of `foo` is being changed + END_FUNCTION + ", + ); + + // Note: This assertion must fail once init functions are implemented and can then also be deleted + assert!(diagnostics.iter().any(|diagnostics| diagnostics.get_error_code() == "E033")); + + // TODO: Use parse_and_validate_buffered once above assertion is deleted + let diagnostics_messages_without_const_error = diagnostics + .iter() + .filter(|diagnostic| diagnostic.get_error_code() != "E033") + .map(|diagnostic| diagnostic.get_message()) + .collect::>(); + + assert_eq!(diagnostics_messages_without_const_error.len(), 1); + assert_debug_snapshot!(diagnostics_messages_without_const_error, @r###" + [ + "foo is an immutable alias variable, can not change the address", + ] + "###); +} diff --git a/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__pointer_assignment_validation.snap b/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__pointer_assignment_validation.snap index 3318e16d80..812104a4a6 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__pointer_assignment_validation.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__pointer_assignment_validation.snap @@ -26,11 +26,11 @@ error[E037]: Invalid assignment: cannot assign 'REF_TO INT' to 'WORD' 29 │ v_word := v_ptr_int; // INVALID │ ^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'REF_TO INT' to 'WORD' -warning[E090]: Pointers REF_TO INT and __POINTER_TO_REAL have different types +warning[E090]: Pointers REF_TO INT and REAL have different types ┌─ :31:5 │ 31 │ v_ptr_int := REF(v_real); // INVALID -> TODO: should be valid - │ ^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO INT and __POINTER_TO_REAL have different types + │ ^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO INT and REAL have different types warning[E067]: Implicit downcast from 'REAL' to 'INT'. ┌─ :32:19 @@ -62,11 +62,11 @@ warning[E067]: Implicit downcast from 'WORD' to 'INT'. 40 │ v_ptr_int^ := v_word; // valid │ ^^^^^^ Implicit downcast from 'WORD' to 'INT'. -warning[E090]: Pointers REF_TO INT and __POINTER_TO_STRING have different types +warning[E090]: Pointers REF_TO INT and STRING have different types ┌─ :41:5 │ 41 │ v_ptr_int := REF(v_string); // INVALID - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO INT and __POINTER_TO_STRING have different types + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO INT and STRING have different types error[E037]: Invalid assignment: cannot assign 'STRING' to 'INT' ┌─ :42:5 diff --git a/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__struct_assignment_validation.snap b/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__struct_assignment_validation.snap index 8e77f342fe..1eeb0996e8 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__struct_assignment_validation.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__assignment_validation_tests__struct_assignment_validation.snap @@ -32,20 +32,20 @@ error[E037]: Invalid assignment: cannot assign 'STRUCT2' to 'STRUCT1' 56 │ myFB(var_inout_struct1 := v_struct2); // INVALID │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid assignment: cannot assign 'STRUCT2' to 'STRUCT1' -warning[E090]: Pointers REF_TO STRUCT1 and __POINTER_TO_REAL have different types +warning[E090]: Pointers REF_TO STRUCT1 and REAL have different types ┌─ :66:5 │ 66 │ v_ref_to_struct1 := REF(v_real); // INVALID - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and __POINTER_TO_REAL have different types + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and REAL have different types -warning[E090]: Pointers REF_TO STRUCT1 and __POINTER_TO_STRING have different types +warning[E090]: Pointers REF_TO STRUCT1 and STRING have different types ┌─ :67:5 │ 67 │ v_ref_to_struct1 := REF(v_string); // INVALID - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and __POINTER_TO_STRING have different types + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and STRING have different types -warning[E090]: Pointers REF_TO STRUCT1 and __POINTER_TO_CHAR have different types +warning[E090]: Pointers REF_TO STRUCT1 and CHAR have different types ┌─ :68:5 │ 68 │ v_ref_to_struct1 := REF(v_char); // INVALID - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and __POINTER_TO_CHAR have different types + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT1 and CHAR have different types diff --git a/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__reference_to_reference_assignments_in_function_arguments.snap b/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__reference_to_reference_assignments_in_function_arguments.snap index 46c02e259f..35513a3c8e 100644 --- a/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__reference_to_reference_assignments_in_function_arguments.snap +++ b/src/validation/tests/snapshots/rusty__validation__tests__statement_validation_tests__reference_to_reference_assignments_in_function_arguments.snap @@ -2,20 +2,20 @@ source: src/validation/tests/statement_validation_tests.rs expression: "&diagnostics" --- -warning[E090]: Pointers REF_TO STRUCT_params and __POINTER_TO_INT have different types +warning[E090]: Pointers REF_TO STRUCT_params and INT have different types ┌─ :47:13 │ 47 │ input1 := REF(global4), - │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and __POINTER_TO_INT have different types + │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and INT have different types -warning[E090]: Pointers REF_TO STRUCT_params and __POINTER_TO_REAL have different types +warning[E090]: Pointers REF_TO STRUCT_params and REAL have different types ┌─ :48:13 │ 48 │ input2 := REF(global5), - │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and __POINTER_TO_REAL have different types + │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and REAL have different types -warning[E090]: Pointers REF_TO STRUCT_params and __POINTER_TO_STRING have different types +warning[E090]: Pointers REF_TO STRUCT_params and STRING have different types ┌─ :49:13 │ 49 │ input3 := REF(global6), - │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and __POINTER_TO_STRING have different types + │ ^^^^^^^^^^^^^^^^^^^^^^ Pointers REF_TO STRUCT_params and STRING have different types diff --git a/src/validation/variable.rs b/src/validation/variable.rs index ed07481734..174454483a 100644 --- a/src/validation/variable.rs +++ b/src/validation/variable.rs @@ -3,7 +3,7 @@ use plc_diagnostics::diagnostics::Diagnostic; use super::{ array::validate_array_assignment, - statement::{validate_enum_variant_assignment, visit_statement}, + statement::{validate_enum_variant_assignment, validate_pointer_assignment, visit_statement}, types::{data_type_is_fb_or_class_instance, visit_data_type_declaration}, ValidationContext, Validator, Validators, }; @@ -210,7 +210,7 @@ fn validate_variable( } } -/// Returns a diagnostic if a `REFERENCE TO` variable is incorrectly declared (or initialized). +/// Returns a diagnostic if a `REFERENCE TO` variable is incorrectly declared. fn validate_reference_to_declaration( validator: &mut Validator, context: &ValidationContext, @@ -221,7 +221,8 @@ fn validate_reference_to_declaration( return; }; - if !variable_ty.get_type_information().is_reference_to() { + if !variable_ty.get_type_information().is_reference_to() && !variable_ty.get_type_information().is_alias() + { return; } @@ -229,17 +230,6 @@ fn validate_reference_to_declaration( unreachable!("`REFERENCE TO` is defined as a pointer, hence this must exist") }; - // Assert that no initializers are present in the `REFERENCE TO` declaration - if let Some(ref initializer) = variable.initializer { - if variable_ty.get_type_information().is_reference_to() { - validator.push_diagnostic( - Diagnostic::new("Initializations of REFERENCE TO variables are disallowed") - .with_location(&initializer.location) - .with_error_code("E099"), - ); - } - } - // Assert that the referenced type is no variable reference let qualifier = context.qualifier.unwrap_or_default(); let inner_ty_is_local_var = context.index.find_member(qualifier, inner_ty_name).is_some(); @@ -252,6 +242,13 @@ fn validate_reference_to_declaration( .with_error_code("E099"), ); } + + if let Some(ref initializer) = variable.initializer { + let type_lhs = context.index.find_type(inner_ty_name).unwrap(); + let type_rhs = context.annotations.get_type(initializer, context.index).unwrap(); + + validate_pointer_assignment(context, validator, type_lhs, type_rhs, &initializer.location); + } } #[cfg(test)] diff --git a/tests/integration/cfc/resolver_tests.rs b/tests/integration/cfc/resolver_tests.rs index dd11728f65..76165b9798 100644 --- a/tests/integration/cfc/resolver_tests.rs +++ b/tests/integration/cfc/resolver_tests.rs @@ -98,8 +98,7 @@ fn function_block_calls_are_annotated_correctly() { argument_type: ByVal( Local, ), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, } "###); } diff --git a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap index 5fdbebac50..ab63eb8fa6 100644 --- a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap +++ b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-3.snap @@ -10,7 +10,6 @@ Some( argument_type: ByVal( Local, ), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, ) diff --git a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap index 2d8cbaeaf2..1c4ab20701 100644 --- a/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap +++ b/tests/integration/cfc/snapshots/tests__integration__cfc__resolver_tests__action_variables_annotated-4.snap @@ -10,7 +10,6 @@ Some( argument_type: ByVal( Local, ), - is_auto_deref: false, - is_reference_to: false, + auto_deref: None, }, ) diff --git a/tests/lit/single/pointer/alias_array.ignore b/tests/lit/single/pointer/alias_array.ignore new file mode 100644 index 0000000000..7cd997cb82 --- /dev/null +++ b/tests/lit/single/pointer/alias_array.ignore @@ -0,0 +1,14 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main: DINT + VAR + refArr AT arr : ARRAY[1..3] OF DINT; + arr : ARRAY[1..3] OF DINT; + END_VAR + + arr[1] := 3; + arr[2] := 2; + arr[3] := 1; + + // CHECK: 1, 2, 3 + printf('%d, %d, %d$N', refArr[3], refArr[2], refArr[1]); +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/alias_autoderef.ignore b/tests/lit/single/pointer/alias_autoderef.ignore new file mode 100644 index 0000000000..eb9be37b0c --- /dev/null +++ b/tests/lit/single/pointer/alias_autoderef.ignore @@ -0,0 +1,13 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +FUNCTION main: DINT + VAR + foo AT bar : DINT; + bar : DINT; + END_VAR + + bar := 1; + + // CHECK: 2 + bar := bar + foo; // bar + bar => 1 + 1 + printf('%d$N', foo); +END_FUNCTION \ No newline at end of file diff --git a/tests/lit/single/pointer/alias_struct.ignore b/tests/lit/single/pointer/alias_struct.ignore new file mode 100644 index 0000000000..c0c5f41512 --- /dev/null +++ b/tests/lit/single/pointer/alias_struct.ignore @@ -0,0 +1,22 @@ +// RUN: (%COMPILE %s && %RUN) | %CHECK %s +TYPE Transaction : STRUCT + id : DINT; + amount : DINT; + message : STRING; +END_STRUCT END_TYPE + +FUNCTION main : DINT + VAR + txn : Transaction := (id := 1, amount := 5, message := 'whats up'); + refTxn AT txn : Transaction; + END_VAR + + // CHECK: 1 + printf('%d$N', refTxn.id); + + // CHECK: 5 + printf('%d$N', refTxn.amount); + + // CHECK: whats up + printf('%s$N', REF(refTxn.message)); +END_FUNCTION \ No newline at end of file From 1406d3803dd66e6ad8b6aa28a5ebd16cab9fdff6 Mon Sep 17 00:00:00 2001 From: Volkan Date: Fri, 26 Jul 2024 09:38:08 +0200 Subject: [PATCH 30/40] fix: Match Option value when parsing alias variables (#1266) Fixes an issue where omitting a data-type in an alias variable would cause a panic in the parser. For example ``` FUNCTION main VAR s AT str; // omitted data-type END_VAR END_FUNCTION ``` --- src/parser.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index c554853729..eae1b9f577 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1132,7 +1132,12 @@ fn parse_variable_line(lexer: &mut ParseSession) -> Vec { address = parse_hardware_access(lexer, direction, access_type) } - Identifier => return vec![parse_aliasing(lexer, &var_names[0]).unwrap()], + Identifier => { + return match parse_aliasing(lexer, &var_names[0]) { + Some(aliased_variable) => vec![aliased_variable], + None => vec![], + }; + } _ => { lexer.accept_diagnostic(Diagnostic::missing_token( From 50dc47735a3194bfb834aac547cf6eb97bf46310 Mon Sep 17 00:00:00 2001 From: Volkan Date: Mon, 29 Jul 2024 10:41:10 +0200 Subject: [PATCH 31/40] chore: Update README (#1261) --- README.md | 52 +++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 151b2893c5..f209f5bc75 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,34 @@ -# RuSTy -[![Linux Build](https://github.com/PLC-lang/rusty/actions/workflows/linux.yml/badge.svg)](https://github.com/PLC-lang/ruSTy/actions) -[![Windows Build](https://github.com/PLC-lang/rusty/actions/workflows/windows.yml/badge.svg)](https://github.com/PLC-lang/rusty/actions/workflows/windows.yml) -[![Documentation](https://github.com/PLC-lang/rusty/actions/workflows/doc.yml/badge.svg)](https://plc-lang.github.io/rusty) -[![codecov](https://codecov.io/gh/PLC-lang/rusty/branch/master/graph/badge.svg?token=7ZZ5XZYE9V)](https://codecov.io/gh/PLC-lang/rusty) -[![Metrics](https://github.com/PLC-lang/rusty/actions/workflows/metrics.yml/badge.svg)](https://plc-lang.github.io/metrics) +
+ +

RuSTy

+

A structured text compiler written in Rust, utilizing the LLVM framework for native code compilation.

-[![Lines of Code](https://tokei.rs/b1/github/PLC-lang/rusty)](https://github.com/XAMPPRocky/tokei) + + + + + -[Structured text](https://en.wikipedia.org/wiki/Structured_text) compiler written in Rust +

+ Examples | + Documentation | + Contributing +

-## About RuSTy +
-RuSTy is a structured text (ST) compiler written in Rust. RuSTy utilizes the -LLVM framework to compile eventually to native code. -## Getting started - -The easiest way to compile this project is to use the provided `Dockerfile`. The project offers a `.devcontainer` when using [VSCode](https://code.visualstudio.com/docs/remote/containers). The Dockerfile offers a linux-image which contains everything you need to run `cargo build` / `cargo test` in the project's root directory. - -If you want to build the project without docker, start [here](https://plc-lang.github.io/rusty/build_and_install.html). - -### Documentation - -The compiler's documentation can be found here: [documentation](https://plc-lang.github.io/rusty/). - -### Contributing - -If you want to contribute to the project you should look for some [beginner-friendly issues](https://github.com/PLC-lang/rusty/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and reach out to project's maintainers. - -## Why RuSTy +## Why RuSTy? Structured Text is a popular language in the domain of automation. A standardized specification of the language ([IEC 61131](https://en.wikipedia.org/wiki/IEC_61131)) was published in the 90s. It was updated several times in the meantime, while its initial spirit - being built for cyclic, robust and deterministic automation applications - still applies. Several automation platform suppliers built proprietary compilers and runtime libraries, native to the vendor's hard- and software platform. -RuSTy is aiming towards a _fast_, _modern_ and _open-source_ industry-grade ST compiler for a wide range of platforms, sticking close to the standard. +RuSTy is aiming towards a **fast**, **modern** and **open-source** industry-grade ST compiler for a wide range of platforms, sticking close to the standard. -## Dependencies +## Getting started + +The easiest way to compile this project is to use the provided `Dockerfile`. The project offers a `.devcontainer` when using [VSCode](https://code.visualstudio.com/docs/remote/containers). The Dockerfile offers a linux-image which contains everything you need to run `cargo build` / `cargo test` in the project's root directory. -We use the [_logos_](https://crates.io/crates/logos/) -crate library to perform lexical analysis before a handwritten recursive decent parser creates the AST. -Generating LLVM IR is accomplished with the help of [_inkwell_](https://github.com/TheDan64/inkwell), a Rust-wrapper around the native LLVM C-API. +If you want to build the project without docker, start [here](https://plc-lang.github.io/rusty/build_and_install.html). \ No newline at end of file From 1ad2fc90aa9cab442888b5be62e739efe4c3e115 Mon Sep 17 00:00:00 2001 From: Lewis Revill Date: Tue, 2 Apr 2024 15:49:51 +0100 Subject: [PATCH 32/40] feat: Generate a custom GOT array and save/load its layout This commit contains changes that are required to generate a global variable which will be used to store an array of addresses of other global variables in the program. The location of the globals within this array should be stable after a recompilation to support online change, so we support loading a pre-existing layout to ensure that for all globals that we see in both the current program and the pre-existing layout, their positions remain the same. Otherwise, any new globals will be placed in any empty spaces left by old globals, or appended on to the end of the array. The layout will then be saved back the the file used for saving and loading. Currently, to use this feature the flag `--got-layout-file=` must be provided, which should specify the name of either a TOML or JSON file to use to save, and optionally load if the file already exists, the GOT layout. In future we will integrate this with a generic online change flag, whereby it will not be necessary to ask for a GOT layout file when we already know that we need it for online change. --- compiler/plc_driver/src/cli.rs | 16 ++++ compiler/plc_driver/src/lib.rs | 10 ++- compiler/plc_driver/src/pipelines.rs | 1 + src/codegen.rs | 18 +++- src/codegen/generators/variable_generator.rs | 88 +++++++++++++++++++- 5 files changed, 123 insertions(+), 10 deletions(-) diff --git a/compiler/plc_driver/src/cli.rs b/compiler/plc_driver/src/cli.rs index 20ab63fae9..00914be101 100644 --- a/compiler/plc_driver/src/cli.rs +++ b/compiler/plc_driver/src/cli.rs @@ -108,6 +108,18 @@ pub struct CompileParameters { ) ] pub hardware_config: Option, + #[clap( + name = "got-layout-file", + long, + global = true, + help = "Obtain information about the current custom GOT layout from the given file if it exists. + Save information about the generated custom GOT layout to the given file. + Format is detected by extension. + Supported formats : json, toml", + parse(try_from_str = validate_config) + ) ] + pub got_layout_file: Option, + #[clap( name = "optimization", long, @@ -387,6 +399,10 @@ impl CompileParameters { self.hardware_config.as_deref().and_then(get_config_format) } + pub fn got_layout_format(&self) -> Option { + self.got_layout_file.as_deref().and_then(get_config_format) + } + /// Returns the location where the build artifacts should be stored / output pub fn get_build_location(&self) -> Option { match &self.commands { diff --git a/compiler/plc_driver/src/lib.rs b/compiler/plc_driver/src/lib.rs index 142a901863..9564b9e449 100644 --- a/compiler/plc_driver/src/lib.rs +++ b/compiler/plc_driver/src/lib.rs @@ -19,8 +19,8 @@ use std::{ use cli::{CompileParameters, ParameterError, SubCommands}; use pipelines::AnnotatedProject; use plc::{ - codegen::CodegenContext, linker::LinkerType, output::FormatOption, DebugLevel, ErrorFormat, - OptimizationLevel, Target, Threads, + codegen::CodegenContext, linker::LinkerType, output::FormatOption, ConfigFormat, DebugLevel, + ErrorFormat, OptimizationLevel, Target, Threads, }; use plc_diagnostics::{diagnostician::Diagnostician, diagnostics::Diagnostic}; @@ -50,6 +50,8 @@ pub struct CompileOptions { /// The name of the resulting compiled file pub output: String, pub output_format: FormatOption, + pub got_layout_file: Option, + pub got_layout_format: Option, pub optimization: OptimizationLevel, pub error_format: ErrorFormat, pub debug_level: DebugLevel, @@ -63,6 +65,8 @@ impl Default for CompileOptions { build_location: None, output: String::new(), output_format: Default::default(), + got_layout_file: None, + got_layout_format: None, optimization: OptimizationLevel::None, error_format: ErrorFormat::None, debug_level: DebugLevel::None, @@ -172,6 +176,8 @@ pub fn get_compilation_context + AsRef + Debug>( build_location: compile_parameters.get_build_location(), output: project.get_output_name(), output_format, + got_layout_file: compile_parameters.got_layout_file.clone(), + got_layout_format: compile_parameters.got_layout_format(), optimization: compile_parameters.optimization, error_format: compile_parameters.error_format, debug_level: compile_parameters.debug_level(), diff --git a/compiler/plc_driver/src/pipelines.rs b/compiler/plc_driver/src/pipelines.rs index 67d8991311..cf4b5e6609 100644 --- a/compiler/plc_driver/src/pipelines.rs +++ b/compiler/plc_driver/src/pipelines.rs @@ -274,6 +274,7 @@ impl AnnotatedProject { context, compile_options.root.as_deref(), &unit.file_name, + compile_options.got_layout_file.clone().zip(compile_options.got_layout_format), compile_options.optimization, compile_options.debug_level, ); diff --git a/src/codegen.rs b/src/codegen.rs index b141c368ef..dd98c3b7ac 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -19,7 +19,7 @@ use self::{ use crate::{ output::FormatOption, resolver::{AstAnnotations, Dependency, StringLiterals}, - DebugLevel, OptimizationLevel, Target, + ConfigFormat, DebugLevel, OptimizationLevel, Target, }; use super::index::*; @@ -71,6 +71,8 @@ pub struct CodeGen<'ink> { /// the debugging module creates debug information at appropriate locations pub debug: DebugBuilderEnum<'ink>, + pub got_layout_file: Option<(String, ConfigFormat)>, + pub module_location: String, } @@ -88,13 +90,14 @@ impl<'ink> CodeGen<'ink> { context: &'ink CodegenContext, root: Option<&Path>, module_location: &str, + got_layout_file: Option<(String, ConfigFormat)>, optimization_level: OptimizationLevel, debug_level: DebugLevel, ) -> CodeGen<'ink> { let module = context.create_module(module_location); module.set_source_file_name(module_location); let debug = debug::DebugBuilderEnum::new(context, &module, root, optimization_level, debug_level); - CodeGen { module, debug, module_location: module_location.to_string() } + CodeGen { module, debug, got_layout_file, module_location: module_location.to_string() } } pub fn generate_llvm_index( @@ -117,8 +120,15 @@ impl<'ink> CodeGen<'ink> { )?; index.merge(llvm_type_index); - let mut variable_generator = - VariableGenerator::new(&self.module, &llvm, global_index, annotations, &index, &mut self.debug); + let mut variable_generator = VariableGenerator::new( + &self.module, + &llvm, + global_index, + annotations, + &index, + &mut self.debug, + self.got_layout_file.clone(), + ); //Generate global variables let llvm_gv_index = diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 08b99db2fb..9bd3928c7a 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -5,11 +5,15 @@ use crate::{ codegen::{debug::Debug, llvm_index::LlvmTypedIndex, llvm_typesystem::cast_if_needed}, index::{get_initializer_name, Index, PouIndexEntry, VariableIndexEntry}, resolver::{AnnotationMap, AstAnnotations, Dependency}, + ConfigFormat, }; - -use inkwell::{module::Module, values::GlobalValue}; +use indexmap::IndexSet; +use inkwell::{module::Module, types::BasicTypeEnum, values::GlobalValue}; use plc_ast::ast::LinkageType; use plc_diagnostics::diagnostics::Diagnostic; +use std::collections::HashMap; +use std::fs::{read_to_string, write}; +use std::path::Path; use super::{ data_type_generator::get_default_for, @@ -20,6 +24,40 @@ use super::{ use crate::codegen::debug::DebugBuilderEnum; use crate::index::FxIndexSet; +pub fn read_got_layout(location: &str, format: ConfigFormat) -> Result, Diagnostic> { + if !Path::new(location).is_file() { + // Assume if the file doesn't exist that there is no existing GOT layout yet. write_got_layout will handle + // creating our file when we want to. + return Ok(HashMap::new()); + } + + let s = + read_to_string(location).map_err(|_| Diagnostic::new("GOT layout could not be read from file"))?; + match format { + ConfigFormat::JSON => serde_json::from_str(&s) + .map_err(|_| Diagnostic::new("Could not deserialize GOT layout from JSON")), + ConfigFormat::TOML => { + toml::de::from_str(&s).map_err(|_| Diagnostic::new("Could not deserialize GOT layout from TOML")) + } + } +} + +pub fn write_got_layout( + got_entries: HashMap, + location: &str, + format: ConfigFormat, +) -> Result<(), Diagnostic> { + let s = match format { + ConfigFormat::JSON => serde_json::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to JSON"))?, + ConfigFormat::TOML => toml::ser::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to TOML"))?, + }; + + write(location, s).map_err(|_| Diagnostic::new("GOT layout could not be written to file"))?; + Ok(()) +} + pub struct VariableGenerator<'ctx, 'b> { module: &'b Module<'ctx>, llvm: &'b Llvm<'ctx>, @@ -27,6 +65,7 @@ pub struct VariableGenerator<'ctx, 'b> { annotations: &'b AstAnnotations, types_index: &'b LlvmTypedIndex<'ctx>, debug: &'b mut DebugBuilderEnum<'ctx>, + got_layout_file: Option<(String, ConfigFormat)>, } impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { @@ -37,8 +76,9 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { annotations: &'b AstAnnotations, types_index: &'b LlvmTypedIndex<'ctx>, debug: &'b mut DebugBuilderEnum<'ctx>, + got_layout_file: Option<(String, ConfigFormat)>, ) -> Self { - VariableGenerator { module, llvm, global_index, annotations, types_index, debug } + VariableGenerator { module, llvm, global_index, annotations, types_index, debug, got_layout_file } } pub fn generate_global_variables( @@ -76,7 +116,7 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { } }); - for (name, variable) in globals { + for (name, variable) in &globals { let linkage = if !variable.is_in_unit(location) { LinkageType::External } else { variable.get_linkage() }; let global_variable = self.generate_global_variable(variable, linkage).map_err(|err| { @@ -100,6 +140,46 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { ); } + if let Some((location, format)) = &self.got_layout_file { + let got_entries = read_got_layout(location.as_str(), *format)?; + let mut new_globals = Vec::new(); + let mut new_got_entries = HashMap::new(); + let mut new_got = HashMap::new(); + + for (name, _) in &globals { + if let Some(idx) = got_entries.get(&name.to_string()) { + new_got_entries.insert(name.to_string(), *idx); + new_got.insert(*idx, name.to_string()); + } else { + new_globals.push(name.to_string()); + } + } + + // Put any globals that weren't there last time in any free space in the GOT. + let mut idx: u64 = 0; + for name in &new_globals { + while new_got.contains_key(&idx) { + idx += 1; + } + new_got_entries.insert(name.to_string(), idx); + new_got.insert(idx, name.to_string()); + } + + // Now we can write new_got_entries back out to a file. + write_got_layout(new_got_entries, location.as_str(), *format)?; + + // Construct our GOT as a new global array. We initialise this array in the loader code. + let got_size = new_got.keys().max().map_or(0, |m| *m + 1); + let _got = self.llvm.create_global_variable( + self.module, + "__custom_got", + BasicTypeEnum::ArrayType(Llvm::get_array_type( + BasicTypeEnum::PointerType(self.llvm.context.i8_type().ptr_type(0.into())), + got_size.try_into().expect("the computed custom GOT size is too large"), + )), + ); + } + Ok(index) } From ac36e70fce3faca7daf5e25d3baa6292b5c9a3e9 Mon Sep 17 00:00:00 2001 From: Lewis Revill Date: Wed, 12 Jun 2024 16:44:48 +0100 Subject: [PATCH 33/40] feat: Access references to globals through a custom GOT This commit introduces the association of GOT indices to the LLVM index, which then allows us to utilise that when generating references to variables to check if a given variable has an entry in the GOT. If so, we obtain its index, and generate the necessary LLVM IR to access the address contained within the GOT rather than accessing the variable directly. --- .../generators/expression_generator.rs | 48 +++++++++++++++++-- src/codegen/generators/variable_generator.rs | 2 + src/codegen/llvm_index.rs | 21 ++++++++ 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index 09039ab0b3..dad867af41 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -287,6 +287,42 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.generate_expression_value(const_expression) } + /// Generate an access to the appropriate GOT entry to achieve an access to the given base + /// lvalue. + pub fn generate_got_access( + &self, + context: &AstNode, + llvm_type: &BasicTypeEnum<'ink>, + ) -> Result>, Diagnostic> { + match self.annotations.get(context) { + Some(StatementAnnotation::Variable { qualified_name, .. }) => { + // We will generate a GEP, which has as its base address the magic constant which + // will eventually be replaced by the location of the GOT. + let base = self + .llvm + .context + .i64_type() + .const_int(0xdeadbeef00000000, false) + .const_to_pointer(llvm_type + .ptr_type(AddressSpace::default()) + .ptr_type(AddressSpace::default())); + + self.llvm_index + .find_got_index(qualified_name) + .map(|idx| { + let ptr = self.llvm.load_array_element( + base, + &[self.llvm.context.i32_type().const_int(idx, false)], + "", + )?; + Ok(self.llvm.load_pointer(&ptr, "").into_pointer_value()) + }) + .transpose() + } + _ => Ok(None), + } + } + /// generates a binary expression (e.g. a + b, x AND y, etc.) and returns the resulting `BasicValueEnum` /// - `left` the AstStatement left of the operator /// - `right` the AstStatement right of the operator @@ -1376,13 +1412,17 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } + let ctx_type = + self.annotations.get_type_or_void(context, self.index).get_type_information(); + // no context ... so just something like 'x' match self.annotations.get(context) { Some(StatementAnnotation::Variable { qualified_name, .. }) - | Some(StatementAnnotation::Program { qualified_name, .. }) => self - .llvm_index - .find_loaded_associated_variable_value(qualified_name) - .ok_or_else(|| Diagnostic::unresolved_reference(name, offset.clone())), + | Some(StatementAnnotation::Program { qualified_name, .. }) => + self.generate_got_access(context, &self.llvm_index.get_associated_type(ctx_type.get_name())?)?.map_or(self + .llvm_index + .find_loaded_associated_variable_value(qualified_name) + .ok_or_else(|| Diagnostic::unresolved_reference(name, offset.clone())), Ok), _ => Err(Diagnostic::unresolved_reference(name, offset.clone())), } } diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 9bd3928c7a..760cb41f8f 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -149,6 +149,7 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { for (name, _) in &globals { if let Some(idx) = got_entries.get(&name.to_string()) { new_got_entries.insert(name.to_string(), *idx); + index.associate_got_index(name, *idx); new_got.insert(*idx, name.to_string()); } else { new_globals.push(name.to_string()); @@ -162,6 +163,7 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { idx += 1; } new_got_entries.insert(name.to_string(), idx); + index.associate_got_index(name, idx); new_got.insert(idx, name.to_string()); } diff --git a/src/codegen/llvm_index.rs b/src/codegen/llvm_index.rs index b30d428c23..86604411a0 100644 --- a/src/codegen/llvm_index.rs +++ b/src/codegen/llvm_index.rs @@ -14,6 +14,7 @@ pub struct LlvmTypedIndex<'ink> { type_associations: FxHashMap>, pou_type_associations: FxHashMap>, global_values: FxHashMap>, + got_indices: FxHashMap, initial_value_associations: FxHashMap>, loaded_variable_associations: FxHashMap>, implementations: FxHashMap>, @@ -29,6 +30,7 @@ impl<'ink> LlvmTypedIndex<'ink> { type_associations: FxHashMap::default(), pou_type_associations: FxHashMap::default(), global_values: FxHashMap::default(), + got_indices: FxHashMap::default(), initial_value_associations: FxHashMap::default(), loaded_variable_associations: FxHashMap::default(), implementations: FxHashMap::default(), @@ -51,6 +53,9 @@ impl<'ink> LlvmTypedIndex<'ink> { for (name, value) in other.global_values.drain() { self.global_values.insert(name, value); } + for (name, index) in other.got_indices.drain() { + self.got_indices.insert(name, index); + } for (name, assocication) in other.initial_value_associations.drain() { self.initial_value_associations.insert(name, assocication); } @@ -110,6 +115,13 @@ impl<'ink> LlvmTypedIndex<'ink> { .or_else(|| self.parent_index.and_then(|it| it.find_global_value(name))) } + pub fn find_got_index(&self, name: &str) -> Option { + self.got_indices + .get(&name.to_lowercase()) + .copied() + .or_else(|| self.parent_index.and_then(|it| it.find_got_index(name))) + } + pub fn find_associated_type(&self, type_name: &str) -> Option> { self.type_associations .get(&type_name.to_lowercase()) @@ -153,6 +165,15 @@ impl<'ink> LlvmTypedIndex<'ink> { Ok(()) } + pub fn associate_got_index( + &mut self, + variable_name: &str, + index: u64, + ) -> Result<(), Diagnostic> { + self.got_indices.insert(variable_name.to_lowercase(), index); + Ok(()) + } + pub fn associate_implementation( &mut self, callable_name: &str, From 61eb9b57f8103f551c1a7f0db8fbc51acfeb5594 Mon Sep 17 00:00:00 2001 From: Lewis Revill Date: Wed, 19 Jun 2024 14:12:38 +0100 Subject: [PATCH 34/40] feat: Generate calls via the GOT This change involves moving the generation of the GOT from variable_generator.rs to codegen.rs, in order to also cover not only global variables but also functions and 'programs' too. Once these have been given an associated index in the GOT we can use that to replace normal direct function calls with indirect calls to a function pointer stored in the GOT. We don't do this for calls with external linkage since these won't be subject to online change. --- src/codegen.rs | 104 +++++++++++++++++- .../generators/expression_generator.rs | 72 +++++++++--- src/codegen/generators/variable_generator.rs | 86 +-------------- 3 files changed, 161 insertions(+), 101 deletions(-) diff --git a/src/codegen.rs b/src/codegen.rs index dd98c3b7ac..3bbf11a5f6 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -1,6 +1,8 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use std::{ cell::RefCell, + collections::HashMap, + fs, ops::Deref, path::{Path, PathBuf}, }; @@ -34,6 +36,7 @@ use inkwell::{ module::Module, passes::PassBuilderOptions, targets::{CodeModel, FileType, InitializationConfig, RelocMode}, + types::BasicTypeEnum, }; use plc_ast::ast::{CompilationUnit, LinkageType}; use plc_diagnostics::diagnostics::Diagnostic; @@ -84,6 +87,40 @@ pub struct GeneratedModule<'ink> { type MainFunction = unsafe extern "C" fn(*mut T) -> U; type MainEmptyFunction = unsafe extern "C" fn() -> U; +pub fn read_got_layout(location: &str, format: ConfigFormat) -> Result, Diagnostic> { + if !Path::new(location).is_file() { + // Assume if the file doesn't exist that there is no existing GOT layout yet. write_got_layout will handle + // creating our file when we want to. + return Ok(HashMap::new()); + } + + let s = + fs::read_to_string(location).map_err(|_| Diagnostic::new("GOT layout could not be read from file"))?; + match format { + ConfigFormat::JSON => serde_json::from_str(&s) + .map_err(|_| Diagnostic::new("Could not deserialize GOT layout from JSON")), + ConfigFormat::TOML => { + toml::de::from_str(&s).map_err(|_| Diagnostic::new("Could not deserialize GOT layout from TOML")) + } + } +} + +pub fn write_got_layout( + got_entries: HashMap, + location: &str, + format: ConfigFormat, +) -> Result<(), Diagnostic> { + let s = match format { + ConfigFormat::JSON => serde_json::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to JSON"))?, + ConfigFormat::TOML => toml::ser::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to TOML"))?, + }; + + fs::write(location, s).map_err(|_| Diagnostic::new("GOT layout could not be written to file"))?; + Ok(()) +} + impl<'ink> CodeGen<'ink> { /// constructs a new code-generator that generates CompilationUnits into a module with the given module_name pub fn new( @@ -127,7 +164,6 @@ impl<'ink> CodeGen<'ink> { annotations, &index, &mut self.debug, - self.got_layout_file.clone(), ); //Generate global variables @@ -135,6 +171,72 @@ impl<'ink> CodeGen<'ink> { variable_generator.generate_global_variables(dependencies, &self.module_location)?; index.merge(llvm_gv_index); + // Build our GOT layout here. We need to find all the names for globals, programs, and + // functions and assign them indices in the GOT, taking into account prior indices. + let program_globals = global_index + .get_program_instances() + .into_iter() + .fold(Vec::new(), |mut acc, p| { + acc.push(p.get_name()); + acc.push(p.get_qualified_name()); + acc + }); + let functions = global_index.get_pous().values() + .filter_map(|p| match p { + PouIndexEntry::Function { name, linkage: LinkageType::Internal, is_generated: false, .. } + | PouIndexEntry::FunctionBlock { name, linkage: LinkageType::Internal, .. } => Some(name.as_ref()), + _ => None, + }); + let all_names = global_index + .get_globals() + .values() + .map(|g| g.get_qualified_name()) + .chain(program_globals) + .chain(functions) + .map(|n| n.to_lowercase()); + + if let Some((location, format)) = &self.got_layout_file { + let got_entries = read_got_layout(location.as_str(), *format)?; + let mut new_symbols = Vec::new(); + let mut new_got_entries = HashMap::new(); + let mut new_got = HashMap::new(); + + for name in all_names { + if let Some(idx) = got_entries.get(&name.to_string()) { + new_got_entries.insert(name.to_string(), *idx); + index.associate_got_index(&name, *idx)?; + new_got.insert(*idx, name.to_string()); + } else { + new_symbols.push(name.to_string()); + } + } + + // Put any names that weren't there last time in any free space in the GOT. + let mut idx: u64 = 0; + for name in &new_symbols { + while new_got.contains_key(&idx) { + idx += 1; + } + new_got_entries.insert(name.to_string(), idx); + index.associate_got_index(name, idx)?; + new_got.insert(idx, name.to_string()); + } + + // Now we can write new_got_entries back out to a file. + write_got_layout(new_got_entries, location.as_str(), *format)?; + + // Construct our GOT as a new global array. We initialise this array in the loader code. + let got_size = new_got.keys().max().map_or(0, |m| *m + 1); + let _got = llvm.create_global_variable( + &self.module, + "__custom_got", + BasicTypeEnum::ArrayType(Llvm::get_array_type( + BasicTypeEnum::PointerType(llvm.context.i8_type().ptr_type(0.into())), + got_size.try_into().expect("the computed custom GOT size is too large"), + )), + ); + } + //Generate opaque functions for implementations and associate them with their types let llvm = Llvm::new(context, context.create_builder()); let llvm_impl_index = pou_generator::generate_implementation_stubs( diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index dad867af41..d95b95587c 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -298,14 +298,10 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { Some(StatementAnnotation::Variable { qualified_name, .. }) => { // We will generate a GEP, which has as its base address the magic constant which // will eventually be replaced by the location of the GOT. - let base = self - .llvm - .context - .i64_type() - .const_int(0xdeadbeef00000000, false) - .const_to_pointer(llvm_type - .ptr_type(AddressSpace::default()) - .ptr_type(AddressSpace::default())); + let base = + self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( + llvm_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), + ); self.llvm_index .find_got_index(qualified_name) @@ -323,6 +319,37 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } + /// Generate an access to the appropriate GOT entry to achieve a call to the given function. + pub fn generate_got_call( + &self, + qualified_name: &str, + function_type: &FunctionType<'ink>, + args: &[BasicMetadataValueEnum<'ink>], + ) -> Result>, Diagnostic> { + // We will generate a GEP, which has as its base address the magic constant which + // will eventually be replaced by the location of the GOT. + let base = + self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( + llvm_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), + ); + + self.llvm_index + .find_got_index(qualified_name) + .map(|idx| { + let mut ptr = self.llvm.load_array_element( + base, + &[self.llvm.context.i32_type().const_int(idx, false)], + "", + )?; + ptr = self.llvm.load_pointer(&ptr, "").into_pointer_value(); + let callable = CallableValue::try_from(ptr) + .map_err(|_| Diagnostic::new("Pointer was not a function pointer"))?; + + Ok(self.llvm.builder.build_call(callable, args, "call")) + }) + .transpose() + } + /// generates a binary expression (e.g. a + b, x AND y, etc.) and returns the resulting `BasicValueEnum` /// - `left` the AstStatement left of the operator /// - `right` the AstStatement right of the operator @@ -520,9 +547,20 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { None }; + // Check for the function within the GOT. If it's there, we need to generate an indirect + // call to its location within the GOT, which should contain a function pointer. + // First get the function type so our function pointer can have the correct type. + let qualified_name = self + .annotations + .get_qualified_name(operator) + .expect("Shouldn't have got this far without a name for the function"); + let function_type = function.get_type(); + let call = self + .generate_got_call(qualified_name, &function_type, &arguments_list)? + .unwrap_or_else(|| self.llvm.builder.build_call(function, &arguments_list, "call")); + // if the target is a function, declare the struct locally // assign all parameters into the struct values - let call = &self.llvm.builder.build_call(function, &arguments_list, "call"); // so grab either: // - the out-pointer if we generated one in by_ref_func_out @@ -1412,17 +1450,19 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } - let ctx_type = - self.annotations.get_type_or_void(context, self.index).get_type_information(); + let ctx_type = self.annotations.get_type_or_void(context, self.index).get_type_information(); // no context ... so just something like 'x' match self.annotations.get(context) { Some(StatementAnnotation::Variable { qualified_name, .. }) - | Some(StatementAnnotation::Program { qualified_name, .. }) => - self.generate_got_access(context, &self.llvm_index.get_associated_type(ctx_type.get_name())?)?.map_or(self - .llvm_index - .find_loaded_associated_variable_value(qualified_name) - .ok_or_else(|| Diagnostic::unresolved_reference(name, offset.clone())), Ok), + | Some(StatementAnnotation::Program { qualified_name, .. }) => self + .generate_got_access(context, &self.llvm_index.get_associated_type(ctx_type.get_name())?)? + .map_or( + self.llvm_index + .find_loaded_associated_variable_value(qualified_name) + .ok_or_else(|| Diagnostic::unresolved_reference(name, offset.clone())), + Ok, + ), _ => Err(Diagnostic::unresolved_reference(name, offset.clone())), } } diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 760cb41f8f..71b4c59d9e 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -5,15 +5,11 @@ use crate::{ codegen::{debug::Debug, llvm_index::LlvmTypedIndex, llvm_typesystem::cast_if_needed}, index::{get_initializer_name, Index, PouIndexEntry, VariableIndexEntry}, resolver::{AnnotationMap, AstAnnotations, Dependency}, - ConfigFormat, }; use indexmap::IndexSet; -use inkwell::{module::Module, types::BasicTypeEnum, values::GlobalValue}; +use inkwell::{module::Module, values::GlobalValue}; use plc_ast::ast::LinkageType; use plc_diagnostics::diagnostics::Diagnostic; -use std::collections::HashMap; -use std::fs::{read_to_string, write}; -use std::path::Path; use super::{ data_type_generator::get_default_for, @@ -24,40 +20,6 @@ use super::{ use crate::codegen::debug::DebugBuilderEnum; use crate::index::FxIndexSet; -pub fn read_got_layout(location: &str, format: ConfigFormat) -> Result, Diagnostic> { - if !Path::new(location).is_file() { - // Assume if the file doesn't exist that there is no existing GOT layout yet. write_got_layout will handle - // creating our file when we want to. - return Ok(HashMap::new()); - } - - let s = - read_to_string(location).map_err(|_| Diagnostic::new("GOT layout could not be read from file"))?; - match format { - ConfigFormat::JSON => serde_json::from_str(&s) - .map_err(|_| Diagnostic::new("Could not deserialize GOT layout from JSON")), - ConfigFormat::TOML => { - toml::de::from_str(&s).map_err(|_| Diagnostic::new("Could not deserialize GOT layout from TOML")) - } - } -} - -pub fn write_got_layout( - got_entries: HashMap, - location: &str, - format: ConfigFormat, -) -> Result<(), Diagnostic> { - let s = match format { - ConfigFormat::JSON => serde_json::to_string(&got_entries) - .map_err(|_| Diagnostic::new("Could not serialize GOT layout to JSON"))?, - ConfigFormat::TOML => toml::ser::to_string(&got_entries) - .map_err(|_| Diagnostic::new("Could not serialize GOT layout to TOML"))?, - }; - - write(location, s).map_err(|_| Diagnostic::new("GOT layout could not be written to file"))?; - Ok(()) -} - pub struct VariableGenerator<'ctx, 'b> { module: &'b Module<'ctx>, llvm: &'b Llvm<'ctx>, @@ -65,7 +27,6 @@ pub struct VariableGenerator<'ctx, 'b> { annotations: &'b AstAnnotations, types_index: &'b LlvmTypedIndex<'ctx>, debug: &'b mut DebugBuilderEnum<'ctx>, - got_layout_file: Option<(String, ConfigFormat)>, } impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { @@ -76,9 +37,8 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { annotations: &'b AstAnnotations, types_index: &'b LlvmTypedIndex<'ctx>, debug: &'b mut DebugBuilderEnum<'ctx>, - got_layout_file: Option<(String, ConfigFormat)>, ) -> Self { - VariableGenerator { module, llvm, global_index, annotations, types_index, debug, got_layout_file } + VariableGenerator { module, llvm, global_index, annotations, types_index, debug } } pub fn generate_global_variables( @@ -140,48 +100,6 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { ); } - if let Some((location, format)) = &self.got_layout_file { - let got_entries = read_got_layout(location.as_str(), *format)?; - let mut new_globals = Vec::new(); - let mut new_got_entries = HashMap::new(); - let mut new_got = HashMap::new(); - - for (name, _) in &globals { - if let Some(idx) = got_entries.get(&name.to_string()) { - new_got_entries.insert(name.to_string(), *idx); - index.associate_got_index(name, *idx); - new_got.insert(*idx, name.to_string()); - } else { - new_globals.push(name.to_string()); - } - } - - // Put any globals that weren't there last time in any free space in the GOT. - let mut idx: u64 = 0; - for name in &new_globals { - while new_got.contains_key(&idx) { - idx += 1; - } - new_got_entries.insert(name.to_string(), idx); - index.associate_got_index(name, idx); - new_got.insert(idx, name.to_string()); - } - - // Now we can write new_got_entries back out to a file. - write_got_layout(new_got_entries, location.as_str(), *format)?; - - // Construct our GOT as a new global array. We initialise this array in the loader code. - let got_size = new_got.keys().max().map_or(0, |m| *m + 1); - let _got = self.llvm.create_global_variable( - self.module, - "__custom_got", - BasicTypeEnum::ArrayType(Llvm::get_array_type( - BasicTypeEnum::PointerType(self.llvm.context.i8_type().ptr_type(0.into())), - got_size.try_into().expect("the computed custom GOT size is too large"), - )), - ); - } - Ok(index) } From c771b2a6edba34750a95932b7f38fb876f1c5711 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 21 Jun 2024 13:20:27 +0200 Subject: [PATCH 35/40] section_mangler: Add test for parsing qualified name in section name --- compiler/section_mangler/src/parser.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index 74f3e5baa2..128326a8ac 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -228,4 +228,11 @@ mod tests { fn parse_function_invalid_no_arguments() { let _ = SectionMangler::from("$RUSTY$fn-no_arguments:u16u8"); } + + #[test] + fn parse_qualified_var_name() { + let mangled = SectionMangler::from("$RUSTY$var-Color.red:e4i32"); + + assert_eq!(mangled.name(), "Color.red"); + } } From acdf708219c1932f4ae5cf305cb09c0b2a1a34d3 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 21 Jun 2024 13:21:31 +0200 Subject: [PATCH 36/40] variable_generator: Use qualified name when mangling variable sections --- src/codegen/generators/variable_generator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 71b4c59d9e..25c96c4298 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -172,7 +172,7 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { } let section = section_mangler::SectionMangler::variable( - global_variable.get_name(), + global_variable.get_qualified_name(), section_names::mangle_type( self.global_index, self.global_index.get_effective_type_by_name(global_variable.get_type_name())?, From 89b1822c84c25722060c90ae9867a1d546599236 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 20 Jun 2024 16:58:10 +0200 Subject: [PATCH 37/40] rusty: Work around race conditions when compiling multiple modules This commit also adds workarounds to make the integration of the generated code with our online change runtime work well. wip: almost done with Mutex hashmap NOTE: Reuse got_indices member from LlvmIndex instead wip: it works? src/test_utils: wip: Make these function compile after latest changes section_mangler: Fix emitted format wip codegen custom GOT as a non-external array wip: running onlinechangexmpl almost works! crashes on signal1() more hacks cleanup cleanup --- Cargo.lock | 1 + compiler/plc_driver/Cargo.toml | 1 + compiler/plc_driver/src/cli.rs | 4 +- compiler/plc_driver/src/pipelines.rs | 86 +++++++++++- compiler/section_mangler/src/lib.rs | 39 +++--- compiler/section_mangler/src/parser.rs | 91 ++++++++++++- src/codegen.rs | 125 +++++++----------- .../generators/expression_generator.rs | 13 +- src/codegen/generators/pou_generator.rs | 3 +- src/codegen/generators/variable_generator.rs | 13 +- src/codegen/llvm_index.rs | 18 ++- src/test_utils.rs | 16 ++- 12 files changed, 289 insertions(+), 121 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d6370cf6c..e206b259bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2537,6 +2537,7 @@ dependencies = [ "serde", "serde_json", "tempfile", + "toml", ] [[package]] diff --git a/compiler/plc_driver/Cargo.toml b/compiler/plc_driver/Cargo.toml index 743087961a..8eccbdd01a 100644 --- a/compiler/plc_driver/Cargo.toml +++ b/compiler/plc_driver/Cargo.toml @@ -16,6 +16,7 @@ plc_index = { path = "../plc_index" } serde = { version = "1.0", features = ["derive"] } serde_json = "1" +toml = "0.5" clap = { version = "3.0", features = ["derive"] } rayon = "1.6.1" tempfile = "3" diff --git a/compiler/plc_driver/src/cli.rs b/compiler/plc_driver/src/cli.rs index 00914be101..46f0dc2bae 100644 --- a/compiler/plc_driver/src/cli.rs +++ b/compiler/plc_driver/src/cli.rs @@ -328,7 +328,9 @@ pub fn get_config_format(name: &str) -> Option { impl CompileParameters { pub fn parse + AsRef>(args: &[T]) -> Result { - CompileParameters::try_parse_from(args).and_then(|result| { + CompileParameters::try_parse_from(args).and_then(|mut result| { + result.got_layout_file = Some(String::from("tmp.json")); + if result.sysroot.len() > result.target.len() { let mut cmd = CompileParameters::command(); Err(cmd.error( diff --git a/compiler/plc_driver/src/pipelines.rs b/compiler/plc_driver/src/pipelines.rs index cf4b5e6609..72d86b0ff8 100644 --- a/compiler/plc_driver/src/pipelines.rs +++ b/compiler/plc_driver/src/pipelines.rs @@ -1,8 +1,10 @@ use std::{ + collections::HashMap, env, fs::{self, File}, io::Write, path::{Path, PathBuf}, + sync::Mutex, }; use crate::{CompileOptions, LinkOptions}; @@ -33,6 +35,42 @@ use project::{ use rayon::prelude::*; use source_code::{source_location::SourceLocation, SourceContainer}; +use serde_json; +use toml; + +pub fn read_got_layout(location: &str, format: ConfigFormat) -> Result, Diagnostic> { + if !Path::new(location).is_file() { + // Assume if the file doesn't exist that there is no existing GOT layout yet. write_got_layout will handle + // creating our file when we want to. + return Ok(HashMap::new()); + } + + let s = fs::read_to_string(location) + .map_err(|_| Diagnostic::new("GOT layout could not be read from file"))?; + match format { + ConfigFormat::JSON => serde_json::from_str(&s) + .map_err(|_| Diagnostic::new("Could not deserialize GOT layout from JSON")), + ConfigFormat::TOML => { + toml::de::from_str(&s).map_err(|_| Diagnostic::new("Could not deserialize GOT layout from TOML")) + } + } +} + +fn write_got_layout( + got_entries: HashMap, + location: &str, + format: ConfigFormat, +) -> Result<(), Diagnostic> { + let s = match format { + ConfigFormat::JSON => serde_json::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to JSON"))?, + ConfigFormat::TOML => toml::ser::to_string(&got_entries) + .map_err(|_| Diagnostic::new("Could not serialize GOT layout to TOML"))?, + }; + + fs::write(location, s).map_err(|_| Diagnostic::new("GOT layout could not be written to file")) +} + ///Represents a parsed project ///For this struct to be built, the project would have been parsed correctly and an AST would have ///been generated @@ -234,8 +272,15 @@ impl AnnotatedProject { .iter() .map(|(unit, dependencies, literals)| { let context = CodegenContext::create(); - self.generate_module(&context, compile_options, unit, dependencies, literals) - .map(|it| it.persist_to_string()) + self.generate_module( + &context, + compile_options, + unit, + dependencies, + literals, + todo!("GOT layout for codegen_to_string?"), + ) + .map(|it| it.persist_to_string()) }) .collect() } @@ -249,7 +294,14 @@ impl AnnotatedProject { .units .iter() .map(|(unit, dependencies, literals)| { - self.generate_module(context, compile_options, unit, dependencies, literals) + self.generate_module( + context, + compile_options, + unit, + dependencies, + literals, + todo!("give GOT layout for single modules?"), + ) }) .reduce(|a, b| { let a = a?; @@ -269,6 +321,7 @@ impl AnnotatedProject { unit: &CompilationUnit, dependencies: &FxIndexSet, literals: &StringLiterals, + got_layout: &Mutex>>, ) -> Result, Diagnostic> { let mut code_generator = plc::codegen::CodeGen::new( context, @@ -286,8 +339,9 @@ impl AnnotatedProject { literals, dependencies, &self.index, + got_layout, )?; - code_generator.generate(context, unit, &self.annotations, &self.index, &llvm_index) + code_generator.generate(context, unit, &self.annotations, &self.index, llvm_index) } pub fn codegen_single_module<'ctx>( @@ -332,6 +386,15 @@ impl AnnotatedProject { }); ensure_compile_dirs(targets, &compile_directory)?; let targets = if targets.is_empty() { &[Target::System] } else { targets }; + + let got_layout = compile_options + .got_layout_file + .as_ref() + .map(|path| read_got_layout(path, ConfigFormat::JSON)) + .transpose()?; + + let got_layout = Mutex::new(got_layout); + let res = targets .par_iter() .map(|target| { @@ -365,8 +428,15 @@ impl AnnotatedProject { }; let context = CodegenContext::create(); //Create a build location for the generated object files - let module = - self.generate_module(&context, compile_options, unit, dependencies, literals)?; + let module = self.generate_module( + &context, + compile_options, + unit, + dependencies, + literals, + &got_layout, + )?; + module .persist( Some(&compile_directory), @@ -385,6 +455,10 @@ impl AnnotatedProject { }) .collect::, Diagnostic>>()?; + compile_options.got_layout_file.as_ref().map(|path| { + write_got_layout(got_layout.into_inner().unwrap().unwrap(), path, ConfigFormat::JSON) + }); + Ok(res) } diff --git a/compiler/section_mangler/src/lib.rs b/compiler/section_mangler/src/lib.rs index d7b6b565ce..759c5cdbf6 100644 --- a/compiler/section_mangler/src/lib.rs +++ b/compiler/section_mangler/src/lib.rs @@ -68,6 +68,27 @@ pub struct VariableMangler { ty: Type, } +pub const RUSTY_PREFIX: &str = "$RUSTY$"; + +// TODO: How to encode variadics? +fn mangle_function(FunctionMangler { name, parameters, return_type }: FunctionMangler) -> String { + /* FIXME: Is that correct? */ + let return_type = return_type.unwrap_or(Type::Void); + + let mangled = match parameters.as_slice() { + [] => format!("{return_type}[]"), + parameters => { + parameters.iter().fold(return_type.to_string(), |mangled, arg| format!("{mangled}[{arg}]")) + } + }; + + format!("{name}:{mangled}") +} + +fn mangle_variable(VariableMangler { name, ty }: VariableMangler) -> String { + format!("{name}:{ty}") +} + impl SectionMangler { pub fn function>(name: S) -> SectionMangler { SectionMangler::Function(FunctionMangler { name: name.into(), parameters: vec![], return_type: None }) @@ -111,7 +132,7 @@ impl SectionMangler { SectionMangler::Variable(v) => ("var", mangle_variable(v)), }; - format!("{prefix}-{content}") + format!("{RUSTY_PREFIX}{prefix}-{content}") } } @@ -249,19 +270,3 @@ impl fmt::Display for Type { } } } - -pub const PREFIX: &str = "$RUSTY$"; - -// TODO: How to encode variadics? -fn mangle_function(FunctionMangler { name, parameters, return_type }: FunctionMangler) -> String { - let mangled = parameters - .into_iter() - /* FIXME: Is that correct? */ - .fold(return_type.unwrap_or(Type::Void).to_string(), |mangled, arg| format!("{mangled}[{arg}]")); - - format!("{PREFIX}{name}:{mangled}") -} - -fn mangle_variable(VariableMangler { name, ty }: VariableMangler) -> String { - format!("{PREFIX}{name}:{ty}") -} diff --git a/compiler/section_mangler/src/parser.rs b/compiler/section_mangler/src/parser.rs index 128326a8ac..7379ca0303 100644 --- a/compiler/section_mangler/src/parser.rs +++ b/compiler/section_mangler/src/parser.rs @@ -1,4 +1,4 @@ -use crate::{FunctionArgument, SectionMangler, Type}; +use crate::{FunctionArgument, SectionMangler, StringEncoding, Type}; use std::str; @@ -21,7 +21,7 @@ fn parse_prefix(input: &str) -> ParseResult { let fn_prefix = tag("fn").map(|_| Prefix::Fn); let var_prefix = tag("var").map(|_| Prefix::Var); - let (input, _) = tag(crate::PREFIX)(input)?; + let (input, _) = tag(crate::RUSTY_PREFIX)(input)?; let (input, prefix) = alt((fn_prefix, var_prefix))(input)?; Ok((input, prefix)) @@ -75,8 +75,29 @@ fn type_enum(input: &str) -> ParseResult { .parse(input) } +fn string_encoding(input: &str) -> ParseResult { + let utf8 = tag("8u").map(|_| StringEncoding::Utf8); + let utf16 = tag("16u").map(|_| StringEncoding::Utf16); + + alt((utf8, utf16))(input) +} + +fn type_string(input: &str) -> ParseResult { + char('s') + .and(string_encoding) + .and(number::) + .map(|((_, encoding), size)| Type::String { size, encoding }) + .parse(input) +} + +fn type_array(input: &str) -> ParseResult { + char('a').and(parse_type).map(|(_, inner_ty)| Type::Array { inner: Box::new(inner_ty) }).parse(input) +} + fn parse_type(input: &str) -> ParseResult { - alt((type_void, type_integer, type_float, type_pointer, type_struct, type_enum))(input) + alt((type_void, type_integer, type_float, type_pointer, type_struct, type_enum, type_string, type_array))( + input, + ) } fn parse_var_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMangler> { @@ -188,6 +209,7 @@ mod tests { // this needs to be handled by the toplevel parse function assert!(type_struct("r0u8u8").is_ok()); assert!(type_struct("r1u8u8").is_ok()); + assert!(type_struct("r5s8u1025s8u2049s8u3u64s8u3").is_ok()); // invalid number of elements assert!(type_struct("r15u8").is_err()); @@ -235,4 +257,67 @@ mod tests { assert_eq!(mangled.name(), "Color.red"); } + + #[test] + fn parse_complex1() { + let mangled = SectionMangler::from("$RUSTY$var-__File__init:r5s8u1025s8u2049s8u3u64s8u3"); + + assert_eq!(mangled.name(), "__File__init"); + } + + #[test] + fn parse_complex2() { + let inputs = [ + "$RUSTY$var-__CosineSignal__init:r4f64i32f64f64", + "$RUSTY$var-__File__init:r5s8u1025s8u2049s8u3u64s8u3", + "$RUSTY$var-__SineSignal__init:r4f64i32f64f64", + "$RUSTY$var-__mainProg_state.Init:e3i32", + "$RUSTY$var-__mainProg_state.Running:e3i32", + "$RUSTY$var-__mainProg_state.Stopped:e3i32", + "$RUSTY$var-__SR__init:r3u8u8u8", + "$RUSTY$var-__RS__init:r3u8u8u8", + "$RUSTY$var-__CTU__init:r6u8u8i16u8i16u8", + "$RUSTY$var-__CTU_INT__init:r6u8u8i16u8i16u8", + "$RUSTY$var-__CTU_DINT__init:r6u8u8i32u8i32u8", + "$RUSTY$var-__CTU_UDINT__init:r6u8u8u32u8u32u8", + "$RUSTY$var-__CTU_LINT__init:r6u8u8i64u8i64u8", + "$RUSTY$var-__CTU_ULINT__init:r6u8u8u64u8u64u8", + "$RUSTY$var-__CTD__init:r6u8u8i16u8i16u8", + "$RUSTY$var-__CTD_INT__init:r6u8u8i16u8i16u8", + "$RUSTY$var-__CTD_DINT__init:r6u8u8i32u8i32u8", + "$RUSTY$var-__CTD_UDINT__init:r6u8u8u32u8u32u8", + "$RUSTY$var-__CTD_LINT__init:r6u8u8i64u8i64u8", + "$RUSTY$var-__CTD_ULINT__init:r6u8u8u64u8u64u8", + "$RUSTY$var-__CTUD__init:r10u8u8u8u8i16u8u8i16u8u8", + "$RUSTY$var-__CTUD_INT__init:r10u8u8u8u8i16u8u8i16u8u8", + "$RUSTY$var-__CTUD_DINT__init:r10u8u8u8u8i32u8u8i32u8u8", + "$RUSTY$var-__CTUD_UDINT__init:r10u8u8u8u8u32u8u8u32u8u8", + "$RUSTY$var-__CTUD_LINT__init:r10u8u8u8u8i64u8u8i64u8u8", + "$RUSTY$var-__CTUD_ULINT__init:r10u8u8u8u8u64u8u8u64u8u8", + "$RUSTY$var-__R_TRIG__init:r3u8u8u8", + "$RUSTY$var-__F_TRIG__init:r3u8u8u8", + "$RUSTY$var-__TP__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TP_TIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TP_LTIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TON__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TON_TIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TON_LTIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TOF__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TOF_TIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$var-__TOF_LTIME__init:r7u8i64u8i64u8u8au8", + "$RUSTY$fn-CosineSignal:v[f64][i32][f64]", + "$RUSTY$fn-File:v[s8u1025][s8u2049][s8u3]", + "$RUSTY$fn-File.Open:v", + "$RUSTY$fn-File.Write:v", + "$RUSTY$fn-File.Close:v", + "$RUSTY$fn-File.Clear:v", + "$RUSTY$fn-SineSignal:v[f64][i32][f64]", + "$RUSTY$fn-mainProg:v", + "$RUSTY$var-mainProg:r7i32r4f64i32f64f64r4f64i32f64f64e3i32r5s8u1025s8u2049s8u3u64s8u3r5s8u1025s8u2049s8u3u64s8u3r5s8u1025s8u2049s8u3u64s8u3" + ]; + + inputs.into_iter().for_each(|input| { + let _ = SectionMangler::from(dbg!(input)); + }); + } } diff --git a/src/codegen.rs b/src/codegen.rs index 3bbf11a5f6..8bf1eb116f 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -2,9 +2,9 @@ use std::{ cell::RefCell, collections::HashMap, - fs, ops::Deref, path::{Path, PathBuf}, + sync::Mutex, }; /// module to generate llvm intermediate representation for a CompilationUnit @@ -31,6 +31,8 @@ use inkwell::{ execution_engine::{ExecutionEngine, JitFunction}, memory_buffer::MemoryBuffer, types::BasicType, + values::BasicValue, + AddressSpace, }; use inkwell::{ module::Module, @@ -87,40 +89,6 @@ pub struct GeneratedModule<'ink> { type MainFunction = unsafe extern "C" fn(*mut T) -> U; type MainEmptyFunction = unsafe extern "C" fn() -> U; -pub fn read_got_layout(location: &str, format: ConfigFormat) -> Result, Diagnostic> { - if !Path::new(location).is_file() { - // Assume if the file doesn't exist that there is no existing GOT layout yet. write_got_layout will handle - // creating our file when we want to. - return Ok(HashMap::new()); - } - - let s = - fs::read_to_string(location).map_err(|_| Diagnostic::new("GOT layout could not be read from file"))?; - match format { - ConfigFormat::JSON => serde_json::from_str(&s) - .map_err(|_| Diagnostic::new("Could not deserialize GOT layout from JSON")), - ConfigFormat::TOML => { - toml::de::from_str(&s).map_err(|_| Diagnostic::new("Could not deserialize GOT layout from TOML")) - } - } -} - -pub fn write_got_layout( - got_entries: HashMap, - location: &str, - format: ConfigFormat, -) -> Result<(), Diagnostic> { - let s = match format { - ConfigFormat::JSON => serde_json::to_string(&got_entries) - .map_err(|_| Diagnostic::new("Could not serialize GOT layout to JSON"))?, - ConfigFormat::TOML => toml::ser::to_string(&got_entries) - .map_err(|_| Diagnostic::new("Could not serialize GOT layout to TOML"))?, - }; - - fs::write(location, s).map_err(|_| Diagnostic::new("GOT layout could not be written to file"))?; - Ok(()) -} - impl<'ink> CodeGen<'ink> { /// constructs a new code-generator that generates CompilationUnits into a module with the given module_name pub fn new( @@ -144,6 +112,7 @@ impl<'ink> CodeGen<'ink> { literals: &StringLiterals, dependencies: &FxIndexSet, global_index: &Index, + got_layout: &Mutex>>, ) -> Result, Diagnostic> { let llvm = Llvm::new(context, context.create_builder()); let mut index = LlvmTypedIndex::default(); @@ -157,14 +126,8 @@ impl<'ink> CodeGen<'ink> { )?; index.merge(llvm_type_index); - let mut variable_generator = VariableGenerator::new( - &self.module, - &llvm, - global_index, - annotations, - &index, - &mut self.debug, - ); + let mut variable_generator = + VariableGenerator::new(&self.module, &llvm, global_index, annotations, &index, &mut self.debug); //Generate global variables let llvm_gv_index = @@ -173,30 +136,37 @@ impl<'ink> CodeGen<'ink> { // Build our GOT layout here. We need to find all the names for globals, programs, and // functions and assign them indices in the GOT, taking into account prior indices. - let program_globals = global_index - .get_program_instances() - .into_iter() - .fold(Vec::new(), |mut acc, p| { - acc.push(p.get_name()); - acc.push(p.get_qualified_name()); + let program_globals = + global_index.get_program_instances().into_iter().fold(Vec::new(), |mut acc, p| { + acc.push(p.get_name().to_owned()); + acc.push(p.get_qualified_name().to_owned()); + acc.push(format!("{}_instance", p.get_name())); acc }); - let functions = global_index.get_pous().values() - .filter_map(|p| match p { - PouIndexEntry::Function { name, linkage: LinkageType::Internal, is_generated: false, .. } - | PouIndexEntry::FunctionBlock { name, linkage: LinkageType::Internal, .. } => Some(name.as_ref()), - _ => None, - }); - let all_names = global_index + + let functions = global_index.get_pous().values().filter_map(|p| match p { + PouIndexEntry::Function { name, linkage: LinkageType::Internal, is_generated: false, .. } + | PouIndexEntry::FunctionBlock { name, linkage: LinkageType::Internal, .. } => { + Some(String::from(name)) + } + _ => None, + }); + let all_names = global_index .get_globals() .values() - .map(|g| g.get_qualified_name()) + .map(VariableIndexEntry::get_qualified_name) + .map(String::from) .chain(program_globals) .chain(functions) - .map(|n| n.to_lowercase()); + .map(|s| s.to_lowercase()) + .map(|s| (crate::index::get_initializer_name(&s), s)) + .fold(Vec::new(), |mut acc, (s, s1)| { + acc.push(s); + acc.push(s1); + acc + }); - if let Some((location, format)) = &self.got_layout_file { - let got_entries = read_got_layout(location.as_str(), *format)?; + if let Some(got_entries) = &mut *got_layout.lock().unwrap() { let mut new_symbols = Vec::new(); let mut new_got_entries = HashMap::new(); let mut new_got = HashMap::new(); @@ -222,19 +192,26 @@ impl<'ink> CodeGen<'ink> { new_got.insert(idx, name.to_string()); } - // Now we can write new_got_entries back out to a file. - write_got_layout(new_got_entries, location.as_str(), *format)?; - // Construct our GOT as a new global array. We initialise this array in the loader code. - let got_size = new_got.keys().max().map_or(0, |m| *m + 1); - let _got = llvm.create_global_variable( - &self.module, - "__custom_got", - BasicTypeEnum::ArrayType(Llvm::get_array_type( - BasicTypeEnum::PointerType(llvm.context.i8_type().ptr_type(0.into())), - got_size.try_into().expect("the computed custom GOT size is too large"), - )), - ); + let got_size: u32 = new_got + .keys() + .max() + .map_or(0, |m| *m + 1) + .try_into() + .expect("the computed custom GOT size is too large"); + + let ptr_ty = llvm.context.i8_type().ptr_type(AddressSpace::default()); + let empty_got = ptr_ty + .const_array(vec![ptr_ty.const_null(); got_size as usize].as_slice()) + .as_basic_value_enum(); + let custom_got_ty = + BasicTypeEnum::ArrayType(Llvm::get_array_type(BasicTypeEnum::PointerType(ptr_ty), got_size)); + + let custom_got = llvm.create_global_variable(&self.module, "__custom_got", custom_got_ty); + custom_got.set_linkage(inkwell::module::Linkage::WeakODR); + custom_got.set_initial_value(Some(empty_got), custom_got_ty); + + *got_entries = new_got_entries; } //Generate opaque functions for implementations and associate them with their types @@ -305,11 +282,11 @@ impl<'ink> CodeGen<'ink> { unit: &CompilationUnit, annotations: &AstAnnotations, global_index: &Index, - llvm_index: &LlvmTypedIndex, + llvm_index: LlvmTypedIndex, ) -> Result, Diagnostic> { //generate all pous let llvm = Llvm::new(context, context.create_builder()); - let pou_generator = PouGenerator::new(llvm, global_index, annotations, llvm_index); + let pou_generator = PouGenerator::new(llvm, global_index, annotations, &llvm_index); //Generate the POU stubs in the first go to make sure they can be referenced. for implementation in &unit.implementations { diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index d95b95587c..6e88c4e83b 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -2,10 +2,10 @@ use inkwell::{ builder::Builder, - types::{BasicType, BasicTypeEnum}, + types::{BasicType, BasicTypeEnum, FunctionType}, values::{ - ArrayValue, BasicMetadataValueEnum, BasicValue, BasicValueEnum, FloatValue, IntValue, PointerValue, - StructValue, VectorValue, + ArrayValue, BasicMetadataValueEnum, BasicValue, BasicValueEnum, CallSiteValue, CallableValue, + FloatValue, IntValue, PointerValue, StructValue, VectorValue, }, AddressSpace, FloatPredicate, IntPredicate, }; @@ -328,10 +328,9 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { ) -> Result>, Diagnostic> { // We will generate a GEP, which has as its base address the magic constant which // will eventually be replaced by the location of the GOT. - let base = - self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( - llvm_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), - ); + let base = self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( + function_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), + ); self.llvm_index .find_got_index(qualified_name) diff --git a/src/codegen/generators/pou_generator.rs b/src/codegen/generators/pou_generator.rs index a9c2d01caf..cada91f3b1 100644 --- a/src/codegen/generators/pou_generator.rs +++ b/src/codegen/generators/pou_generator.rs @@ -133,6 +133,7 @@ pub fn generate_global_constants_for_pou_members<'ink>( .make_constant() .set_initial_value(Some(value), variable_type); local_llvm_index.associate_global(&name, global_value)?; + local_llvm_index.insert_new_got_index(&name)?; } } } @@ -154,7 +155,7 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { } fn mangle_function(&self, implementation: &ImplementationIndexEntry) -> Result { - let ctx = SectionMangler::function(implementation.get_call_name()); + let ctx = SectionMangler::function(implementation.get_call_name().to_lowercase()); let params = self.index.get_declared_parameters(implementation.get_call_name()); diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index 25c96c4298..f963689de8 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -6,10 +6,10 @@ use crate::{ index::{get_initializer_name, Index, PouIndexEntry, VariableIndexEntry}, resolver::{AnnotationMap, AstAnnotations, Dependency}, }; -use indexmap::IndexSet; use inkwell::{module::Module, values::GlobalValue}; use plc_ast::ast::LinkageType; use plc_diagnostics::diagnostics::Diagnostic; +use section_mangler::SectionMangler; use super::{ data_type_generator::get_default_for, @@ -171,8 +171,15 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { } } - let section = section_mangler::SectionMangler::variable( - global_variable.get_qualified_name(), + let global_name = if global_variable.get_name().ends_with("instance") { + global_variable.get_name() + } else { + global_variable.get_qualified_name() + }; + let global_name = global_name.to_lowercase(); + + let section = SectionMangler::variable( + global_name, section_names::mangle_type( self.global_index, self.global_index.get_effective_type_by_name(global_variable.get_type_name())?, diff --git a/src/codegen/llvm_index.rs b/src/codegen/llvm_index.rs index 86604411a0..4c1490a96e 100644 --- a/src/codegen/llvm_index.rs +++ b/src/codegen/llvm_index.rs @@ -14,6 +14,7 @@ pub struct LlvmTypedIndex<'ink> { type_associations: FxHashMap>, pou_type_associations: FxHashMap>, global_values: FxHashMap>, + // TODO: Should this be an Option? got_indices: FxHashMap, initial_value_associations: FxHashMap>, loaded_variable_associations: FxHashMap>, @@ -162,18 +163,25 @@ impl<'ink> LlvmTypedIndex<'ink> { self.global_values.insert(variable_name.to_lowercase(), global_variable); self.initial_value_associations .insert(variable_name.to_lowercase(), global_variable.as_pointer_value().into()); + + // FIXME: Do we want to call .insert_new_got_index() here? + Ok(()) } - pub fn associate_got_index( - &mut self, - variable_name: &str, - index: u64, - ) -> Result<(), Diagnostic> { + pub fn associate_got_index(&mut self, variable_name: &str, index: u64) -> Result<(), Diagnostic> { self.got_indices.insert(variable_name.to_lowercase(), index); Ok(()) } + pub fn insert_new_got_index(&mut self, variable_name: &str) -> Result<(), Diagnostic> { + let idx = self.got_indices.values().max().copied().unwrap_or(0); + + self.got_indices.insert(variable_name.to_lowercase(), idx); + + Ok(()) + } + pub fn associate_implementation( &mut self, callable_name: &str, diff --git a/src/test_utils.rs b/src/test_utils.rs index f7631b06c5..6b153a4c4e 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -1,7 +1,7 @@ #[cfg(test)] pub mod tests { - use std::{path::PathBuf, str::FromStr}; + use std::{path::PathBuf, str::FromStr, sync::Mutex}; use plc_ast::{ ast::{pre_process, CompilationUnit, LinkageType}, @@ -161,19 +161,23 @@ pub mod tests { &context, path.as_deref(), "main", + None, crate::OptimizationLevel::None, debug_level, ); let annotations = AstAnnotations::new(annotations, id_provider.next_id()); + + let got_layout = Mutex::new(None); + let llvm_index = code_generator - .generate_llvm_index(&context, &annotations, &literals, &dependencies, &index) + .generate_llvm_index(&context, &annotations, &literals, &dependencies, &index, &got_layout) .map_err(|err| { reporter.handle(&[err]); reporter.buffer().unwrap() })?; code_generator - .generate(&context, &unit, &annotations, &index, &llvm_index) + .generate(&context, &unit, &annotations, &index, llvm_index) .map(|module| module.persist_to_string()) .map_err(|err| { reporter.handle(&[err]); @@ -232,18 +236,22 @@ pub mod tests { context, path.as_deref(), &unit.file_name, + None, crate::OptimizationLevel::None, debug_level, ); + let got_layout = Mutex::new(None); + let llvm_index = code_generator.generate_llvm_index( context, &annotations, &literals, &dependencies, &index, + &got_layout, )?; - code_generator.generate(context, &unit, &annotations, &index, &llvm_index) + code_generator.generate(context, &unit, &annotations, &index, llvm_index) }) .collect::, Diagnostic>>() } From fe43485d27dbe32ea8176329fb144ca4c5ef0906 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 30 Apr 2024 16:09:25 +0200 Subject: [PATCH 38/40] rusty: Add --online-change CLI flag --- compiler/plc_driver/src/cli.rs | 6 ++++++ compiler/plc_driver/src/lib.rs | 11 +++++++++-- compiler/plc_driver/src/pipelines.rs | 1 + src/codegen.rs | 17 ++++++++++++++--- src/codegen/generators/pou_generator.rs | 14 ++++++++++---- src/lib.rs | 6 ++++++ src/test_utils.rs | 2 ++ 7 files changed, 48 insertions(+), 9 deletions(-) diff --git a/compiler/plc_driver/src/cli.rs b/compiler/plc_driver/src/cli.rs index 46f0dc2bae..960b88fb87 100644 --- a/compiler/plc_driver/src/cli.rs +++ b/compiler/plc_driver/src/cli.rs @@ -213,6 +213,12 @@ pub struct CompileParameters { #[clap(name = "check", long, help = "Check only, do not generate any output", global = true)] pub check_only: bool, + #[clap( + long, + help = "Emit a binary with specific compilation information, suitable for online changes when ran under a conforming runtime" + )] + pub online_change: bool, + #[clap(subcommand)] pub commands: Option, } diff --git a/compiler/plc_driver/src/lib.rs b/compiler/plc_driver/src/lib.rs index 9564b9e449..67460c6052 100644 --- a/compiler/plc_driver/src/lib.rs +++ b/compiler/plc_driver/src/lib.rs @@ -19,8 +19,8 @@ use std::{ use cli::{CompileParameters, ParameterError, SubCommands}; use pipelines::AnnotatedProject; use plc::{ - codegen::CodegenContext, linker::LinkerType, output::FormatOption, ConfigFormat, DebugLevel, - ErrorFormat, OptimizationLevel, Target, Threads, + codegen::CodegenContext, linker::LinkerType, output::FormatOption, ConfigFormat, DebugLevel, ErrorFormat, + OnlineChange, OptimizationLevel, Target, Threads, }; use plc_diagnostics::{diagnostician::Diagnostician, diagnostics::Diagnostic}; @@ -56,6 +56,7 @@ pub struct CompileOptions { pub error_format: ErrorFormat, pub debug_level: DebugLevel, pub single_module: bool, + pub online_change: OnlineChange, } impl Default for CompileOptions { @@ -71,6 +72,7 @@ impl Default for CompileOptions { error_format: ErrorFormat::None, debug_level: DebugLevel::None, single_module: false, + online_change: OnlineChange::Disabled, } } } @@ -182,6 +184,11 @@ pub fn get_compilation_context + AsRef + Debug>( error_format: compile_parameters.error_format, debug_level: compile_parameters.debug_level(), single_module: compile_parameters.single_module, + online_change: if compile_parameters.online_change { + OnlineChange::Enabled + } else { + OnlineChange::Disabled + }, }; let libraries = diff --git a/compiler/plc_driver/src/pipelines.rs b/compiler/plc_driver/src/pipelines.rs index 72d86b0ff8..80dd6c7766 100644 --- a/compiler/plc_driver/src/pipelines.rs +++ b/compiler/plc_driver/src/pipelines.rs @@ -330,6 +330,7 @@ impl AnnotatedProject { compile_options.got_layout_file.clone().zip(compile_options.got_layout_format), compile_options.optimization, compile_options.debug_level, + compile_options.online_change, ); //Create a types codegen, this contains all the type declarations //Associate the index type with LLVM types diff --git a/src/codegen.rs b/src/codegen.rs index 8bf1eb116f..5000bad2fe 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -21,7 +21,7 @@ use self::{ use crate::{ output::FormatOption, resolver::{AstAnnotations, Dependency, StringLiterals}, - ConfigFormat, DebugLevel, OptimizationLevel, Target, + ConfigFormat, DebugLevel, OnlineChange, OptimizationLevel, Target, }; use super::index::*; @@ -75,6 +75,8 @@ pub struct CodeGen<'ink> { pub module: Module<'ink>, /// the debugging module creates debug information at appropriate locations pub debug: DebugBuilderEnum<'ink>, + /// Whether we are generating a hot-reloadable binary or not + pub online_change: OnlineChange, pub got_layout_file: Option<(String, ConfigFormat)>, @@ -98,11 +100,18 @@ impl<'ink> CodeGen<'ink> { got_layout_file: Option<(String, ConfigFormat)>, optimization_level: OptimizationLevel, debug_level: DebugLevel, + online_change: OnlineChange, ) -> CodeGen<'ink> { let module = context.create_module(module_location); module.set_source_file_name(module_location); let debug = debug::DebugBuilderEnum::new(context, &module, root, optimization_level, debug_level); - CodeGen { module, debug, got_layout_file, module_location: module_location.to_string() } + CodeGen { + module, + debug, + got_layout_file, + module_location: module_location.to_string(), + online_change, + } } pub fn generate_llvm_index( @@ -224,6 +233,7 @@ impl<'ink> CodeGen<'ink> { annotations, &index, &mut self.debug, + self.online_change, )?; let llvm = Llvm::new(context, context.create_builder()); index.merge(llvm_impl_index); @@ -286,7 +296,8 @@ impl<'ink> CodeGen<'ink> { ) -> Result, Diagnostic> { //generate all pous let llvm = Llvm::new(context, context.create_builder()); - let pou_generator = PouGenerator::new(llvm, global_index, annotations, &llvm_index); + let pou_generator = + PouGenerator::new(llvm, global_index, annotations, &llvm_index, self.online_change); //Generate the POU stubs in the first go to make sure they can be referenced. for implementation in &unit.implementations { diff --git a/src/codegen/generators/pou_generator.rs b/src/codegen/generators/pou_generator.rs index cada91f3b1..d254c56763 100644 --- a/src/codegen/generators/pou_generator.rs +++ b/src/codegen/generators/pou_generator.rs @@ -16,6 +16,7 @@ use crate::{ index::{self, ImplementationType}, resolver::{AstAnnotations, Dependency}, typesystem::{DataType, DataTypeInformation, VarArgs, DINT_TYPE}, + OnlineChange, }; /// The pou_generator contains functions to generate the code for POUs (PROGRAM, FUNCTION, FUNCTION_BLOCK) @@ -49,6 +50,7 @@ pub struct PouGenerator<'ink, 'cg> { index: &'cg Index, annotations: &'cg AstAnnotations, llvm_index: &'cg LlvmTypedIndex<'ink>, + online_change: OnlineChange, } /// Creates opaque implementations for all callable items in the index @@ -61,9 +63,10 @@ pub fn generate_implementation_stubs<'ink>( annotations: &AstAnnotations, types_index: &LlvmTypedIndex<'ink>, debug: &mut DebugBuilderEnum<'ink>, + online_change: OnlineChange, ) -> Result, Diagnostic> { let mut llvm_index = LlvmTypedIndex::default(); - let pou_generator = PouGenerator::new(llvm, index, annotations, types_index); + let pou_generator = PouGenerator::new(llvm, index, annotations, types_index, online_change); let implementations = dependencies .into_iter() .filter_map(|it| { @@ -150,8 +153,9 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { index: &'cg Index, annotations: &'cg AstAnnotations, llvm_index: &'cg LlvmTypedIndex<'ink>, + online_change: OnlineChange, ) -> PouGenerator<'ink, 'cg> { - PouGenerator { llvm, index, annotations, llvm_index } + PouGenerator { llvm, index, annotations, llvm_index, online_change } } fn mangle_function(&self, implementation: &ImplementationIndexEntry) -> Result { @@ -286,8 +290,10 @@ 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)?; - curr_f.set_section(Some(§ion_name)); + if self.online_change == OnlineChange::Enabled { + let section_name = self.mangle_function(implementation)?; + curr_f.set_section(Some(§ion_name)); + } let pou_name = implementation.get_call_name(); if let Some(pou) = self.index.find_pou(pou_name) { diff --git a/src/lib.rs b/src/lib.rs index 1092512aae..715c1639b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -176,6 +176,12 @@ pub enum DebugLevel { Full(usize), } +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum OnlineChange { + Enabled, + Disabled, +} + impl From for inkwell::OptimizationLevel { fn from(val: OptimizationLevel) -> Self { match val { diff --git a/src/test_utils.rs b/src/test_utils.rs index 6b153a4c4e..9f871ebcce 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -164,6 +164,7 @@ pub mod tests { None, crate::OptimizationLevel::None, debug_level, + crate::OnlineChange::Disabled, ); let annotations = AstAnnotations::new(annotations, id_provider.next_id()); @@ -239,6 +240,7 @@ pub mod tests { None, crate::OptimizationLevel::None, debug_level, + crate::OnlineChange::Disabled, ); let got_layout = Mutex::new(None); From d4adaee7d456e41321aab2326af5fca466a63898 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 30 Jul 2024 17:27:55 +0200 Subject: [PATCH 39/40] rusty: Update test snapshots --- ...al_files__external_file_function_call.snap | 6 ++-- ...ernal_files__external_file_global_var.snap | 6 ++-- ...n_different_locations_with_debug_info.snap | 6 ++-- ...files__multiple_files_with_debug_info.snap | 6 ++-- ...iles__multiple_source_files_generated.snap | 6 ++-- ...ate_return_value_variable_in_function.snap | 2 +- ...rray_size_correctly_set_in_dwarf_info.snap | 2 +- ...g__assignment_statement_have_location.snap | 2 +- ...ging__case_conditions_location_marked.snap | 2 +- ...bugging__exit_statement_have_location.snap | 2 +- ...l_is_not_added_as_external_subroutine.snap | 6 ++-- ...gging__for_conditions_location_marked.snap | 2 +- ...bugging__function_calls_have_location.snap | 2 +- ...on_calls_in_expressions_have_location.snap | 2 +- ...ugging__if_conditions_location_marked.snap | 2 +- ...g__implementation_added_as_subroutine.snap | 6 ++-- ...g__nested_function_calls_get_location.snap | 2 +- ...callable_expressions_have_no_location.snap | 2 +- ...on_function_pous_have_struct_as_param.snap | 4 +-- ...ng__repeat_conditions_location_marked.snap | 2 +- ...gging__return_statement_have_location.snap | 2 +- ...temp_variables_in_pous_added_as_local.snap | 6 ++-- ...out_inout_in_function_added_as_params.snap | 2 +- ...ing__while_conditions_location_marked.snap | 2 +- ...initializer_gets_declared_initializer.snap | 2 +- ..._initializer_gets_default_initializer.snap | 2 +- ...lues_in_global_variables_out_of_order.snap | 4 +-- ..._class_struct_initialized_in_function.snap | 6 ++-- ...ues_for_not_initialized_function_vars.snap | 2 +- ...global_variables_in_inline_assignment.snap | 4 +-- ..._block_struct_initialized_in_function.snap | 6 ++-- ..._function_return_value_is_initialized.snap | 8 ++--- ..._is_initialized_with_type_initializer.snap | 4 +-- ...alue_with_initializers_is_initialized.snap | 8 ++--- ...e_without_initializers_is_initialized.snap | 8 ++--- ...tial_constant_values_in_pou_variables.snap | 2 +- ..._initial_values_in_function_block_pou.snap | 4 +-- ...lizers__initial_values_in_program_pou.snap | 2 +- ...lizers__initialized_array_in_function.snap | 2 +- ...s__initialized_array_type_in_function.snap | 2 +- ...for_struct_initialization_in_function.snap | 2 +- ..._for_struct_initialization_in_program.snap | 2 +- ...nt_functions_are_referenced_correctly.snap | 4 +-- ...imilar_names_are_referenced_correctly.snap | 8 ++--- ...izers__array_of_struct_initialization.snap | 2 +- ...th_inline_initializer_are_initialized.snap | 2 +- ...lizers__initial_values_in_fb_variable.snap | 4 +-- ...array_of_structs_are_zero_initialized.snap | 2 +- src/codegen/tests/parameters_tests.rs | 28 ++++++++--------- ...enerates_in_separate_global_variables.snap | 2 +- ...sts__accessing_nested_array_in_struct.snap | 2 +- ...e_gen_tests__accessing_nested_structs.snap | 2 +- ...e_gen_tests__action_called_in_program.snap | 4 +-- ...sts__array_of_cast_int_type_generated.snap | 2 +- ..._int_non_zero_negative_type_generated.snap | 2 +- ..._array_of_int_non_zero_type_generated.snap | 2 +- ...en_tests__array_of_int_type_generated.snap | 2 +- ...ode_gen_tests__array_of_int_type_used.snap | 2 +- ...ype_with_non_zero_negative_start_used.snap | 2 +- ..._of_int_type_with_non_zero_start_used.snap | 2 +- ...d_variable_declaration_is_initialized.snap | 2 +- ...mber_of_another_struct_is_initialized.snap | 2 +- ...onstant_expressions_in_case_selectors.snap | 2 +- ...th_enum_expressions_in_case_selectors.snap | 2 +- ...__case_with_multiple_labels_statement.snap | 2 +- ...gen_tests__case_with_ranges_statement.snap | 2 +- ...s__casted_literals_bool_code_gen_test.snap | 2 +- ..._tests__casted_literals_code_gen_test.snap | 2 +- ...ts__casted_literals_hex_code_gen_test.snap | 2 +- ...asted_literals_hex_ints_code_gen_test.snap | 2 +- ...__casted_literals_lreal_code_gen_test.snap | 2 +- ...s__casted_literals_real_code_gen_test.snap | 2 +- ...ests__class_member_access_from_method.snap | 4 +-- ...__code_gen_tests__class_method_in_pou.snap | 6 ++-- ...sts__code_gen_tests__complex_pointers.snap | 2 +- ...ion_in_function_blocks_are_propagated.snap | 2 +- ...anged_type_declaration_are_propagated.snap | 4 +-- ...gation_of_struct_fields_on_assignment.snap | 2 +- ..._contants_in_case_statements_resolved.snap | 2 +- ..._date_and_time_addition_in_var_output.snap | 2 +- ..._and_time_global_constants_initialize.snap | 2 +- ...sts__code_gen_tests__date_comparisons.snap | 2 +- ...ues_for_not_initialized_function_vars.snap | 2 +- ..._gen_tests__different_case_references.snap | 2 +- ...tion_with_name_generates_int_function.snap | 2 +- ...lobal_variable_list_generates_nothing.snap | 2 +- ...ram_with_name_generates_void_function.snap | 2 +- ...pty_statements_dont_generate_anything.snap | 2 +- ...num_members_can_be_used_in_asignments.snap | 2 +- ...ests__enums_custom_type_are_generated.snap | 2 +- ...__external_function_called_in_program.snap | 4 +-- ...global_variable_generates_as_external.snap | 2 +- ...ternal_program_global_var_is_external.snap | 2 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 6 ++-- ...ode_gen_tests__for_statement_continue.snap | 2 +- ...ts__code_gen_tests__for_statement_int.snap | 2 +- ...s__code_gen_tests__for_statement_lint.snap | 2 +- ...s__code_gen_tests__for_statement_sint.snap | 2 +- ...en_tests__for_statement_with_continue.snap | 2 +- ...de_gen_tests__for_statement_with_exit.snap | 2 +- ..._statement_with_references_steps_test.snap | 2 +- ..._tests__for_statement_with_steps_test.snap | 2 +- ...sts__for_statement_without_steps_test.snap | 2 +- ...n_tests__function_block_instance_call.snap | 4 +-- ...unction_block_qualified_instance_call.snap | 6 ++-- ...on_call_with_same_name_as_return_type.snap | 4 +-- ...gen_tests__function_called_in_program.snap | 4 +-- ..._tests__function_called_when_shadowed.snap | 4 +-- ...on_with_local_temp_var_initialization.snap | 4 +-- ...ith_local_var_initialization_and_call.snap | 4 +-- ...ion_with_parameters_called_in_program.snap | 4 +-- ...with_two_parameters_called_in_program.snap | 4 +-- ...lobal_variable_reference_is_generated.snap | 2 +- ...n_tests__if_elsif_else_generator_test.snap | 2 +- ...ts__code_gen_tests__if_generator_test.snap | 2 +- ...ts__if_with_expression_generator_test.snap | 2 +- ...rray_size_from_local_scoped_constants.snap | 2 +- ...code_gen_tests__method_codegen_return.snap | 4 +-- ...__code_gen_tests__method_codegen_void.snap | 4 +-- ...do_not_result_in_an_under_or_overflow.snap | 2 +- ...code_gen_tests__multidim_array_access.snap | 2 +- ...gen_tests__multidim_array_declaration.snap | 2 +- ...__code_gen_tests__nested_array_access.snap | 2 +- ...e_gen_tests__nested_array_cube_writes.snap | 2 +- ...sted_array_cube_writes_negative_start.snap | 2 +- ...e_gen_tests__nested_array_declaration.snap | 2 +- ...ts__nested_function_called_in_program.snap | 6 ++-- ...n_tests__order_var_and_var_temp_block.snap | 2 +- ...__code_gen_tests__pass_inout_to_inout.snap | 6 ++-- ...s__pointer_and_array_access_to_in_out.snap | 2 +- ...s__code_gen_tests__pointers_generated.snap | 2 +- ..._gen_tests__program_called_in_program.snap | 4 +-- ...gen_tests__program_with_and_statement.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._program_with_casted_chars_assignment.snap | 2 +- ...s__code_gen_tests__program_with_chars.snap | 2 +- ...n_tests__program_with_date_assignment.snap | 2 +- ..._assignment_whit_short_datatype_names.snap | 2 +- ...arison_assignment_generates_correctly.snap | 2 +- ...am_with_local_temp_var_initialization.snap | 4 +-- ...ts__program_with_long_date_assignment.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._gen_tests__program_with_or_statement.snap | 2 +- ...en_tests__program_with_real_additions.snap | 2 +- ...n_tests__program_with_real_assignment.snap | 2 +- ...ts__program_with_real_cast_assignment.snap | 2 +- ...gram_with_signed_combined_expressions.snap | 2 +- ..._program_with_special_chars_in_string.snap | 2 +- ...tests__program_with_string_assignment.snap | 2 +- ...n_tests__program_with_time_assignment.snap | 2 +- ...__program_with_time_of_day_assignment.snap | 2 +- ...explicit_parameters_called_in_program.snap | 4 +-- ...with_two_parameters_called_in_program.snap | 4 +-- ...gram_with_var_inout_called_in_program.snap | 4 +-- ...rogram_with_var_out_called_in_program.snap | 4 +-- ..._with_var_out_called_mixed_in_program.snap | 4 +-- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...es_generates_void_function_and_struct.snap | 2 +- ...gen_tests__program_with_xor_statement.snap | 2 +- ...fied_action_from_fb_called_in_program.snap | 6 ++-- ...fied_foreign_action_called_in_program.snap | 6 ++-- ...lified_local_action_called_in_program.snap | 4 +-- ...ests__real_function_called_in_program.snap | 4 +-- ...e_gen_tests__reference_qualified_name.snap | 6 ++-- ...nce_assignments_in_function_arguments.snap | 4 +-- ...sts__code_gen_tests__repeat_statement.snap | 2 +- ...en_tests__returning_early_in_function.snap | 2 +- ...ts__returning_early_in_function_block.snap | 2 +- ...e_gen_tests__simple_case_i8_statement.snap | 2 +- ...code_gen_tests__simple_case_statement.snap | 2 +- ...binary_expression_with_different_size.snap | 2 +- ...ts__structs_members_can_be_referenced.snap | 2 +- ..._gen_tests__sub_range_check_functions.snap | 10 +++---- ...nge_type_calls_check_function_missing.snap | 4 +-- ...ype_calls_check_function_on_assigment.snap | 4 +-- ...ariables_have_nano_seconds_resolution.snap | 2 +- ...enerates_in_separate_global_variables.snap | 2 +- ..._tests__typed_enums_are_used_properly.snap | 2 +- ...ng_cast_statement_as_const_expression.snap | 2 +- ..._using_const_expression_in_range_type.snap | 4 +-- ...s__using_global_consts_in_expressions.snap | 2 +- ..._variable_with_same_name_as_data_type.snap | 4 +-- ...de_gen_tests__while_loop_with_if_exit.snap | 2 +- ...ests__code_gen_tests__while_statement.snap | 2 +- ...ests__while_with_expression_statement.snap | 2 +- ...s__aliased_number_type_comparing_test.snap | 2 +- ...sed_ranged_number_type_comparing_test.snap | 2 +- ...uctions_tests__compare_datetime_types.snap | 2 +- ...uction_functions_with_different_types.snap | 4 +-- ...are_instructions_with_different_types.snap | 4 +-- ...s_tests__pointer_compare_instructions.snap | 2 +- ...er_function_call_compare_instructions.snap | 4 +-- ...ts__ranged_number_type_comparing_test.snap | 2 +- ...uctions_tests__string_comparison_test.snap | 4 +-- ...ests__string_equal_with_constant_test.snap | 4 +-- ...g_greater_or_equal_with_constant_test.snap | 6 ++-- ...ts__string_greater_with_constant_test.snap | 4 +-- ...tests__string_less_with_constant_test.snap | 4 +-- ...__string_not_equal_with_constant_test.snap | 4 +-- ...g_smaller_or_equal_with_constant_test.snap | 6 ++-- ...tests__assigning_const_array_variable.snap | 2 +- ...ests__assigning_const_string_variable.snap | 2 +- ...ests__assigning_const_struct_variable.snap | 2 +- ...rectaccess_test__bitaccess_assignment.snap | 2 +- ...ectaccess_test__byteaccess_assignment.snap | 2 +- ...ctaccess_test__chained_bit_assignment.snap | 2 +- ...ctaccess_test__dwordaccess_assignment.snap | 2 +- ...ctaccess_test__lwordaccess_assignment.snap | 2 +- ..._test__qualified_reference_assignment.snap | 2 +- ...ectaccess_test__wordaccess_assignment.snap | 2 +- ...n_tests__access_string_via_byte_array.snap | 2 +- ...ssion_tests__allowed_assignable_types.snap | 2 +- ...__expression_tests__builtin_add_float.snap | 2 +- ...s__expression_tests__builtin_add_ints.snap | 2 +- ...__expression_tests__builtin_add_mixed.snap | 2 +- ...__expression_tests__builtin_div_float.snap | 2 +- ...s__expression_tests__builtin_div_ints.snap | 2 +- ...__expression_tests__builtin_div_mixed.snap | 2 +- ...sion_tests__builtin_function_call_adr.snap | 2 +- ...ts__builtin_function_call_lower_bound.snap | 4 +-- ...ion_tests__builtin_function_call_move.snap | 2 +- ...sion_tests__builtin_function_call_mux.snap | 2 +- ...function_call_mux_with_aggregate_type.snap | 2 +- ...sion_tests__builtin_function_call_ref.snap | 2 +- ...sion_tests__builtin_function_call_sel.snap | 2 +- ...iltin_function_call_sel_as_expression.snap | 2 +- ...n_tests__builtin_function_call_sizeof.snap | 2 +- ...ts__builtin_function_call_upper_bound.snap | 4 +-- ...uiltin_function_call_upper_bound_expr.snap | 4 +-- ...__expression_tests__builtin_mul_float.snap | 2 +- ...s__expression_tests__builtin_mul_ints.snap | 2 +- ...__expression_tests__builtin_mul_mixed.snap | 2 +- ...__expression_tests__builtin_sub_float.snap | 2 +- ...s__expression_tests__builtin_sub_ints.snap | 2 +- ...__expression_tests__builtin_sub_mixed.snap | 2 +- ...s__calling_strings_in_function_return.snap | 4 +-- ...ion_tests__cast_between_pointer_types.snap | 2 +- ...pression_tests__cast_lword_to_pointer.snap | 2 +- ...pression_tests__cast_pointer_to_lword.snap | 2 +- ...ion_tests__compare_date_time_literals.snap | 2 +- ...tests__hardware_access_assign_codegen.snap | 2 +- ...ession_tests__hardware_access_codegen.snap | 2 +- ...gen__tests__expression_tests__max_int.snap | 4 +-- ...ression_tests__nested_call_statements.snap | 4 +-- ...expression_tests__pointer_arithmetics.snap | 2 +- ...ts__pointer_arithmetics_function_call.snap | 4 +-- ...on_tests__pointers_in_function_return.snap | 2 +- ...ion_tests__strings_in_function_return.snap | 2 +- ...ion_tests__structs_in_function_return.snap | 2 +- ...s__expression_tests__type_mix_in_call.snap | 4 +-- ..._tests__unary_expressions_can_be_real.snap | 2 +- ...necessary_casts_between_pointer_types.snap | 2 +- ...ests__argument_fed_by_ref_then_by_val.snap | 6 ++-- ...t_argument_literals_for_function_call.snap | 4 +-- ...argument_references_for_function_call.snap | 10 +++---- ...ized_string_varargs_called_in_program.snap | 4 +-- ..._with_sized_varargs_called_in_program.snap | 4 +-- ...nction_with_varargs_called_in_program.snap | 4 +-- ...literal_string_argument_passed_by_ref.snap | 4 +-- ...ction_tests__member_variables_in_body.snap | 2 +- ..._output_should_be_passed_as_a_pointer.snap | 2 +- ...tests__passing_a_string_to_a_function.snap | 4 +-- ...g_a_string_to_a_function_as_reference.snap | 4 +-- ...arguments_to_functions_by_ref_and_val.snap | 4 +-- ...tests__return_variable_in_nested_call.snap | 4 +-- ...n__tests__function_tests__simple_call.snap | 4 +-- ...on_tests__var_output_in_function_call.snap | 4 +-- ...t__any_real_function_called_with_ints.snap | 6 ++-- ...eneric_call_gets_cast_to_biggest_type.snap | 4 +-- ...unction_call_generates_real_type_call.snap | 6 ++-- ...nerics_test__generic_output_parameter.snap | 4 +-- ...pe_defined_in_external_file_in_module.snap | 2 +- ...ed_in_external_file_no_deps_in_module.snap | 2 +- ...nitialized_in_external_file_in_module.snap | 2 +- ...n_tests__enum_referenced_in_fb_nested.snap | 10 +++---- ...ts__function_defined_in_external_file.snap | 18 +++++------ ...sts__global_value_from_different_file.snap | 2 +- ...ct_with_custom_init_in_different_file.snap | 2 +- ...ccepts_empty_statement_as_input_param.snap | 4 +-- ...cepts_empty_statement_as_output_param.snap | 4 +-- ...ccepts_empty_statement_as_input_param.snap | 4 +-- ...cepts_empty_statement_as_output_param.snap | 4 +-- ...sts__function_all_parameters_assigned.snap | 4 +-- ...function_default_value_parameter_type.snap | 4 +-- ...ests__function_empty_inout_assignment.snap | 4 +-- ...ests__function_empty_input_assignment.snap | 4 +-- ...sts__function_empty_output_assignment.snap | 4 +-- ...empty_output_default_value_assignment.snap | 4 +-- ...ts__function_missing_inout_assignment.snap | 4 +-- ...ts__function_missing_input_assignment.snap | 4 +-- ...issing_input_default_value_assignment.snap | 4 +-- ...s__function_missing_output_assignment.snap | 4 +-- ...ssing_output_default_value_assignment.snap | 4 +-- ...unction_block_pointer_are_assigned_to.snap | 4 +-- ...ccepts_empty_statement_as_input_param.snap | 4 +-- ...cepts_empty_statement_as_output_param.snap | 4 +-- ...gram_all_parameters_assigned_explicit.snap | 4 +-- ...gram_all_parameters_assigned_implicit.snap | 4 +-- ...tests__program_empty_inout_assignment.snap | 4 +-- ...sts__program_missing_input_assignment.snap | 4 +-- ...ts__program_missing_output_assignment.snap | 4 +-- ...var_in_out_params_can_be_out_of_order.snap | 6 ++-- ...taccess_generated_as_rsh_and_trunc_i1.snap | 2 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 2 +- ...access_generated_as_rsh_and_trunc_i32.snap | 2 +- ...gen_test__floating_point_type_casting.snap | 2 +- ...n_result_assignment_on_aliased_string.snap | 4 +-- ..._function_result_assignment_on_string.snap | 4 +-- ...t_codegen_test__nested_bitwise_access.snap | 2 +- ...n_test__variable_based_bitwise_access.snap | 2 +- ...access_generated_as_rsh_and_trunc_i16.snap | 2 +- ..._casted_string_assignment_uses_memcpy.snap | 2 +- ...g_generic_string_should_return_by_ref.snap | 4 +-- ...ts__function_returns_a_literal_string.snap | 4 +-- ...es_string_paramter_and_returns_string.snap | 4 +-- ...rings_should_be_collected_as_literals.snap | 2 +- ...__string_tests__program_string_output.snap | 4 +-- ...program_with_casted_string_assignment.snap | 2 +- ...__program_with_string_type_assignment.snap | 2 +- ...ing_tests__string_function_parameters.snap | 4 +-- ...stant_var_string_should_be_memcpyable.snap | 4 +-- ...ar_string_should_be_memcpyable_nonref.snap | 4 +-- ...ariable_length_strings_can_be_created.snap | 2 +- ...trings_using_constants_can_be_created.snap | 2 +- ...ests__variable_string_assignment_test.snap | 2 +- ...string_tests__vartmp_string_init_test.snap | 2 +- ...ed_datatypes_respect_conversion_rules.snap | 2 +- ...r_than_int_promote_the_second_operand.snap | 2 +- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...all_sint_expressions_fallback_to_dint.snap | 2 +- ...at_and_double_mix_converted_to_double.snap | 2 +- ...m_test__float_assigned_to_int_is_cast.snap | 2 +- ...t__float_assinged_to_double_to_double.snap | 2 +- ...m_test__int_assigned_to_float_is_cast.snap | 2 +- ...an_byte_promoted_on_compare_statement.snap | 2 +- ...bigger_than_float_converted_to_double.snap | 2 +- ..._or_equal_to_float_converted_to_float.snap | 2 +- ...ariadic_functions_without_declaration.snap | 4 +-- ...hile_32bit_and_higher_keep_their_type.snap | 4 +-- ...es_smaller_than_dint_promoted_to_dint.snap | 2 +- ...e_calls_with_differently_sized_arrays.snap | 4 +-- ...al_variable_passed_to_function_as_vla.snap | 4 +-- ...ruct_is_generated_for_call_statements.snap | 4 +-- ...sts__vla_tests__multi_dimensional_vla.snap | 4 +-- ...en__tests__vla_tests__vla_read_access.snap | 4 +-- src/tests/adr/arrays_adr.rs | 4 +-- src/tests/adr/enum_adr.rs | 2 +- src/tests/adr/pou_adr.rs | 30 +++++++++---------- src/tests/adr/strings_adr.rs | 4 +-- src/tests/adr/structs_adr.rs | 6 ++-- src/tests/adr/vla_adr.rs | 8 ++--- ...__integration__cfc__ir__actions_debug.snap | 6 ++-- ...egration__cfc__ir__conditional_return.snap | 2 +- ...on__cfc__ir__conditional_return_debug.snap | 2 +- ...r__conditional_return_evaluating_true.snap | 4 +-- ...tional_return_evaluating_true_negated.snap | 4 +-- ...sts__integration__cfc__ir__jump_debug.snap | 2 +- ...on__cfc__ir__jump_to_label_with_false.snap | 2 +- ...ion__cfc__ir__jump_to_label_with_true.snap | 2 +- ...tegration__cfc__ir__sink_source_debug.snap | 2 +- ...ble_source_to_variable_and_block_sink.snap | 6 ++-- ...line_compile__ir_generation_full_pass.snap | 2 +- 369 files changed, 592 insertions(+), 592 deletions(-) diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap index 4574b77102..468b3c6ec0 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap @@ -5,7 +5,7 @@ expression: "results.join(\"\\n\")" ; ModuleID = 'main.st' source_filename = "main.st" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -14,9 +14,9 @@ entry: ret i16 %main_ret } -declare i16 @external() section "fn-$RUSTY$external:i16" +declare i16 @external() ; ModuleID = 'external.st' source_filename = "external.st" -declare i16 @external() section "fn-$RUSTY$external:i16" +declare i16 @external() 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 cc8effcdc0..8b2e5d9c13 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 @@ -8,7 +8,7 @@ source_filename = "main.st" @x = external global i16, section "var-$RUSTY$x:i16" @y = external global i16, section "var-$RUSTY$y:i16" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -19,7 +19,7 @@ entry: ret i16 %main_ret } -declare i16 @external() section "fn-$RUSTY$external:i16" +declare i16 @external() ; ModuleID = 'external.st' source_filename = "external.st" @@ -27,4 +27,4 @@ source_filename = "external.st" @x = external global i16, section "var-$RUSTY$x:i16" @y = external global i16, section "var-$RUSTY$y:i16" -declare i16 @external() section "fn-$RUSTY$external:i16" +declare i16 @external() 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 4deafcb831..970c44a292 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 @@ -9,7 +9,7 @@ source_filename = "app/file1.st" @mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define i16 @main() section "fn-$RUSTY$main:i16" !dbg !10 { +define i16 @main() !dbg !10 { entry: %main = alloca i16, align 2, !dbg !14 call void @llvm.dbg.declare(metadata i16* %main, metadata !15, metadata !DIExpression()), !dbg !17 @@ -19,7 +19,7 @@ entry: ret i16 %main_ret, !dbg !14 } -declare !dbg !18 void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" +declare !dbg !18 void @mainProg(%mainProg*) ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 @@ -56,7 +56,7 @@ source_filename = "lib/file2.st" @mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" !dbg !10 { +define void @mainProg(%mainProg* %0) !dbg !10 { entry: call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 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 a8623288bf..d2ed9d7822 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 @@ -9,7 +9,7 @@ source_filename = "file1.st" @mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define i16 @main() section "fn-$RUSTY$main:i16" !dbg !10 { +define i16 @main() !dbg !10 { entry: %main = alloca i16, align 2, !dbg !14 call void @llvm.dbg.declare(metadata i16* %main, metadata !15, metadata !DIExpression()), !dbg !17 @@ -19,7 +19,7 @@ entry: ret i16 %main_ret, !dbg !14 } -declare !dbg !18 void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" +declare !dbg !18 void @mainProg(%mainProg*) ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 @@ -56,7 +56,7 @@ source_filename = "file2.st" @mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0", !dbg !0 -define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" !dbg !10 { +define void @mainProg(%mainProg* %0) !dbg !10 { entry: call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 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 e2f0569d08..ae46444677 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 @@ -9,7 +9,7 @@ source_filename = "external_file1.st" @mainProg_instance = external global %mainProg, section "var-$RUSTY$mainProg_instance:r0" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -18,7 +18,7 @@ entry: ret i16 %main_ret } -declare void @mainProg(%mainProg*) section "fn-$RUSTY$mainProg:v" +declare void @mainProg(%mainProg*) ; ModuleID = 'external_file2.st' source_filename = "external_file2.st" @@ -27,7 +27,7 @@ source_filename = "external_file2.st" @mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r0" -define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { +define void @mainProg(%mainProg* %0) { entry: ret void } diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 3ce6a9f94b..72f8978b90 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @myFunc([81 x i8]* %0) section "fn-$RUSTY$myFunc:s8u81" !dbg !4 { +define void @myFunc([81 x i8]* %0) !dbg !4 { entry: %myFunc = alloca [81 x i8]*, align 8, !dbg !8 store [81 x i8]* %0, [81 x i8]** %myFunc, align 8, !dbg !8 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index 1c24e9fc49..08dc58ef4d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @foo() section "fn-$RUSTY$foo:i32" !dbg !4 { +define i32 @foo() !dbg !4 { entry: %foo = alloca i32, align 4, !dbg !8 %a = alloca [64 x i32], align 4, !dbg !8 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap index 31e1606764..35e8234ed8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap index eaba11dbb2..aea0f1918f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap index 77f390e60e..52e0c1551d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 4cc815874e..2b7e175358 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 @@ -11,11 +11,11 @@ source_filename = "main" @myPrg_instance = external global %myPrg, section "var-$RUSTY$myPrg_instance:r0", !dbg !0 @__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r0", !dbg !5 -declare i32 @myFunc() section "fn-$RUSTY$myFunc:i32" +declare i32 @myFunc() -declare void @myPrg(%myPrg*) section "fn-$RUSTY$myPrg:v" +declare void @myPrg(%myPrg*) -declare void @myFb(%myFb*) section "fn-$RUSTY$myFb:v" +declare void @myFb(%myFb*) !llvm.module.flags = !{!8, !9} !llvm.dbg.cu = !{!10} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index 6e12617d29..a08ca7cd7f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap index 3ca5c86ad4..50c8c86f48 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap index ecd3a71e1d..7105c2de76 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap index a9cd134c7d..5ce0ac8ad7 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 4031d2368c..2f0b734b23 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 @@ -11,7 +11,7 @@ source_filename = "main" @myPrg_instance = global %myPrg zeroinitializer, section "var-$RUSTY$myPrg_instance:r0", !dbg !0 @__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r0", !dbg !5 -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !12 { +define i32 @myFunc() !dbg !12 { entry: %myFunc = alloca i32, align 4, !dbg !15 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !16, metadata !DIExpression()), !dbg !18 @@ -20,13 +20,13 @@ entry: ret i32 %myFunc_ret, !dbg !15 } -define void @myPrg(%myPrg* %0) section "fn-$RUSTY$myPrg:v" !dbg !19 { +define void @myPrg(%myPrg* %0) !dbg !19 { entry: call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !20, metadata !DIExpression()), !dbg !21 ret void, !dbg !21 } -define void @myFb(%myFb* %0) section "fn-$RUSTY$myFb:v" !dbg !22 { +define void @myFb(%myFb* %0) !dbg !22 { entry: call void @llvm.dbg.declare(metadata %myFb* %0, metadata !23, metadata !DIExpression()), !dbg !24 ret void, !dbg !24 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap index acecf314cd..9b05f266ac 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc(i32 %0) section "fn-$RUSTY$myFunc:i32[i32]" !dbg !4 { +define i32 @myFunc(i32 %0) !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !9 %x = alloca i32, align 4, !dbg !9 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap index 7c33e7e21b..4ababa15b8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 d1f406fd7b..15c0582ef3 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 @@ -11,7 +11,7 @@ source_filename = "main" @myProg_instance = global %myProg zeroinitializer, section "var-$RUSTY$myProg_instance:r1i32", !dbg !0 @__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1i32", !dbg !7 -define void @myProg(%myProg* %0) section "fn-$RUSTY$myProg:v[i32]" !dbg !16 { +define void @myProg(%myProg* %0) !dbg !16 { entry: call void @llvm.dbg.declare(metadata %myProg* %0, metadata !20, metadata !DIExpression()), !dbg !21 %x = getelementptr inbounds %myProg, %myProg* %0, i32 0, i32 0, !dbg !21 @@ -21,7 +21,7 @@ entry: ret void, !dbg !21 } -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v[i32]" !dbg !22 { +define void @fb(%fb* %0) !dbg !22 { entry: call void @llvm.dbg.declare(metadata %fb* %0, metadata !23, metadata !DIExpression()), !dbg !24 %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0, !dbg !24 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap index bd34efaee8..ca5ab5a72b 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap index d8bd529d70..4f45e87ad8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 41c3cd88b7..f552154a80 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 @@ -11,7 +11,7 @@ source_filename = "main" @myPrg_instance = global %myPrg zeroinitializer, section "var-$RUSTY$myPrg_instance:r3i32i32i32", !dbg !0 @__myFb__init = unnamed_addr constant %myFb zeroinitializer, section "var-$RUSTY$__myFb__init:r3i32i32i32", !dbg !9 -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !20 { +define i32 @myFunc() !dbg !20 { entry: %myFunc = alloca i32, align 4, !dbg !24 %a = alloca i32, align 4, !dbg !24 @@ -29,7 +29,7 @@ entry: ret i32 %myFunc_ret, !dbg !24 } -define void @myPrg(%myPrg* %0) section "fn-$RUSTY$myPrg:v" !dbg !33 { +define void @myPrg(%myPrg* %0) !dbg !33 { entry: call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !34, metadata !DIExpression()), !dbg !35 %a = alloca i32, align 4, !dbg !35 @@ -44,7 +44,7 @@ entry: ret void, !dbg !35 } -define void @myFb(%myFb* %0) section "fn-$RUSTY$myFb:v" !dbg !42 { +define void @myFb(%myFb* %0) !dbg !42 { entry: call void @llvm.dbg.declare(metadata %myFb* %0, metadata !43, metadata !DIExpression()), !dbg !44 %a = alloca i32, align 4, !dbg !44 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap index ae19840b1f..0028034171 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc(i16* %0) section "fn-$RUSTY$myFunc:i32[pi16]" !dbg !4 { +define i32 @myFunc(i16* %0) !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !10 %x = alloca i16*, align 8, !dbg !10 diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap index be5cce04c5..b9a226bfed 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @myFunc() section "fn-$RUSTY$myFunc:i32" !dbg !4 { +define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4, !dbg !8 call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 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 3b4650feec..f35c9ebe71 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 @@ -9,7 +9,7 @@ source_filename = "main" @__commands__init = unnamed_addr constant %commands { i8 1, i8 0 }, section "var-$RUSTY$__commands__init:r2u8u8" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %cmd1 = alloca %commands, align 8 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 2eea070ead..e372683bef 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 @@ -10,7 +10,7 @@ source_filename = "main" @__commands__init = unnamed_addr constant %commands zeroinitializer, section "var-$RUSTY$__commands__init:r2u8u8" @__main.myStr1__init = unnamed_addr constant [81 x i8] zeroinitializer -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %cmd1 = alloca %commands, align 8 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 72ff91eb83..c88cda381c 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 @@ -12,13 +12,13 @@ source_filename = "main" @__MyFB__init = unnamed_addr constant %MyFB { i16 77 }, section "var-$RUSTY$__MyFB__init:r1i16" @prg_instance = global %prg { %MyFB { i16 77 } }, section "var-$RUSTY$prg_instance:r1r1i16" -define void @MyFB(%MyFB* %0) section "fn-$RUSTY$MyFB:v" { +define void @MyFB(%MyFB* %0) { entry: %x = getelementptr inbounds %MyFB, %MyFB* %0, i32 0, i32 0 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 064fe30b88..d3da07df61 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 @@ -11,13 +11,13 @@ source_filename = "main" @__fb__init = unnamed_addr constant %fb { i16 9 }, section "var-$RUSTY$__fb__init:r1i16" @main_instance = global %main { %fb { i16 9 } }, section "var-$RUSTY$main_instance:r1r1i16" -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { +define void @fb(%fb* %0) { entry: %a = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define i32 @func(%fb* %0) section "fn-$RUSTY$func:i32[r1i16]" { +define i32 @func(%fb* %0) { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 @@ -32,7 +32,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(%fb* %fb0) diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap index 049192b1e9..1546b53eec 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @func() section "fn-$RUSTY$func:i16" { +define i16 @func() { entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 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 e9c5abaf62..ed95250db4 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 @@ -11,7 +11,7 @@ source_filename = "main" @__foo_position.y = unnamed_addr constant i32 2, section "var-$RUSTY$y:e2i32" @__bar_position.y = unnamed_addr constant i32 4, section "var-$RUSTY$y:e2i32" -define i32 @foo() section "fn-$RUSTY$foo:i32" { +define i32 @foo() { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 @@ -21,7 +21,7 @@ entry: ret i32 %foo_ret } -define i32 @bar() section "fn-$RUSTY$bar:i32" { +define i32 @bar() { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 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 1194529443..703a5a2377 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 @@ -11,12 +11,12 @@ source_filename = "main" @__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r0" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r0" -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { +define void @fb(%fb* %0) { entry: ret void } -define i32 @func(%fb* %0) section "fn-$RUSTY$func:i32[r0]" { +define i32 @func(%fb* %0) { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 @@ -31,7 +31,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(%fb* %fb0) 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 e51987ffe3..0a80ffdf1f 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 @@ -9,7 +9,7 @@ source_filename = "main" @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i16" -define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { +define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 store i16 0, i16* %foo_int, align 2 @@ -17,7 +17,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { +define void @foo_arr([10 x float]* %0) { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_struct(%MyStruct* %0) section "fn-$RUSTY$foo_struct:r2i32i16" { +define void @foo_struct(%MyStruct* %0) { entry: %foo_struct = alloca %MyStruct*, align 8 store %MyStruct* %0, %MyStruct** %foo_struct, align 8 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 28bcfce8cb..d762d69670 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32ai32" @__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-$RUSTY$__myArray__init:ai32" -define void @target([4 x i32]* %0) section "fn-$RUSTY$target:ai32" { +define void @target([4 x i32]* %0) { entry: %target = alloca [4 x i32]*, align 8 store [4 x i32]* %0, [4 x i32]** %target, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 e0f38a2099..8604632a43 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 @@ -11,7 +11,7 @@ source_filename = "main" @__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-$RUSTY$__MyArr__init:af32" @__MyStrct__init = unnamed_addr constant %MyStrct { i32 1, i32 2, i32 3 }, section "var-$RUSTY$__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { +define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 store i16 7, i16* %foo_int, align 2 @@ -19,7 +19,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -29,7 +29,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { +define void @foo_arr([10 x float]* %0) { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -39,7 +39,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-$RUSTY$foo_strct:r3i32i32i32" { +define void @foo_strct(%MyStrct* %0) { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 10285ac17a..ee53e43f3c 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 @@ -9,7 +9,7 @@ source_filename = "main" @__MyStrct__init = unnamed_addr constant %MyStrct zeroinitializer, section "var-$RUSTY$__MyStrct__init:r3i32i32i32" -define i16 @foo_int() section "fn-$RUSTY$foo_int:i16" { +define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 store i16 0, i16* %foo_int, align 2 @@ -17,7 +17,7 @@ entry: ret i16 %foo_int_ret } -define void @foo_str([11 x i8]* %0) section "fn-$RUSTY$foo_str:s8u11" { +define void @foo_str([11 x i8]* %0) { entry: %foo_str = alloca [11 x i8]*, align 8 store [11 x i8]* %0, [11 x i8]** %foo_str, align 8 @@ -27,7 +27,7 @@ entry: ret void } -define void @foo_arr([10 x float]* %0) section "fn-$RUSTY$foo_arr:af32" { +define void @foo_arr([10 x float]* %0) { entry: %foo_arr = alloca [10 x float]*, align 8 store [10 x float]* %0, [10 x float]** %foo_arr, align 8 @@ -37,7 +37,7 @@ entry: ret void } -define void @foo_strct(%MyStrct* %0) section "fn-$RUSTY$foo_strct:r3i32i32i32" { +define void @foo_strct(%MyStrct* %0) { entry: %foo_strct = alloca %MyStrct*, align 8 store %MyStrct* %0, %MyStrct** %foo_strct, align 8 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 13df4890ba..9129293b42 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 @@ -12,7 +12,7 @@ source_filename = "main" @LEN = unnamed_addr constant i16 20, section "var-$RUSTY$LEN:i16" @prg_instance = global %prg { i16 24, i16 89 }, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v[i16][i16]" { +define void @prg(%prg* %0) { entry: %my_len = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %my_size = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 1e8c0d7672..d741d87486 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 @@ -11,7 +11,7 @@ source_filename = "main" @__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$__FB__init:r6i16i16u8u8f32f32" @main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } }, section "var-$RUSTY$main_instance:r1r6i16i16u8u8f32f32" -define void @FB(%FB* %0) section "fn-$RUSTY$FB:v" { +define void @FB(%FB* %0) { entry: %x = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 %xx = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 @@ -22,7 +22,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void 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 321b004892..b4e80589f7 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 @@ -9,7 +9,7 @@ source_filename = "main" @Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 }, section "var-$RUSTY$Main_instance:r6i16i16u8u8f32f32" -define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { +define void @Main(%Main* %0) { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %xx = getelementptr inbounds %Main, %Main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap index 3e0e2de57e..49ce99fa3c 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap @@ -7,7 +7,7 @@ source_filename = "main" @__func.arr_var__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] -define i16 @func() section "fn-$RUSTY$func:i16" { +define i16 @func() { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 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 86a8ac7660..9cd05be182 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 @@ -7,7 +7,7 @@ source_filename = "main" @__arr__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4], section "var-$RUSTY$__arr__init:ai32" -define i16 @func() section "fn-$RUSTY$func:i16" { +define i16 @func() { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 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 8580832c54..23bc274f8e 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 @@ -9,7 +9,7 @@ source_filename = "main" @____func_a__init = unnamed_addr constant %__func_a zeroinitializer, section "var-$RUSTY$____func_a__init:r1i16" -define i16 @func() section "fn-$RUSTY$func:i16" { +define i16 @func() { entry: %func = alloca i16, align 2 %a = alloca %__func_a, align 8 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 56554b9271..e97a3755f4 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1r1i16" @____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer, section "var-$RUSTY$____prog_a__init:r1i16" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %a = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 0b39ed7cff..ae73435077 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 @@ -10,7 +10,7 @@ source_filename = "main" @__foo_position.y = unnamed_addr constant i32 2, section "var-$RUSTY$y:e2i32" @__bar_position.y = unnamed_addr constant i32 4, section "var-$RUSTY$y:e2i32" -define i32 @foo() section "fn-$RUSTY$foo:i32" { +define i32 @foo() { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %foo_ret } -define i32 @bar() section "fn-$RUSTY$bar:i32" { +define i32 @bar() { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 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 909a6194e5..89eea60e46 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 @@ -14,7 +14,7 @@ source_filename = "main" @__bb_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" @__b_position.y = unnamed_addr constant i32 5, section "var-$RUSTY$y:e2i32" -define i32 @a() section "fn-$RUSTY$a:i32" { +define i32 @a() { entry: %a = alloca i32, align 4 %position = alloca i32, align 4 @@ -24,7 +24,7 @@ entry: ret i32 %a_ret } -define i32 @aa() section "fn-$RUSTY$aa:i32" { +define i32 @aa() { entry: %aa = alloca i32, align 4 %position = alloca i32, align 4 @@ -34,7 +34,7 @@ entry: ret i32 %aa_ret } -define i32 @bb() section "fn-$RUSTY$bb:i32" { +define i32 @bb() { entry: %bb = alloca i32, align 4 %position = alloca i32, align 4 @@ -44,7 +44,7 @@ entry: ret i32 %bb_ret } -define i32 @b() section "fn-$RUSTY$b:i32" { +define i32 @b() { entry: %b = alloca i32, align 4 %position = alloca i32, align 4 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 bcdff271ea..3357ac0246 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 @@ -16,7 +16,7 @@ source_filename = "main" @__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] }] -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %alias_arr = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 ae268a9d1b..77a9b83e69 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 @@ -21,7 +21,7 @@ source_filename = "main" @__global_x.red = unnamed_addr constant i32 0, section "var-$RUSTY$red:e3i32" @__global_x.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %y = alloca i32, align 4 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 7765eaf209..23dc367dbe 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 @@ -13,14 +13,14 @@ source_filename = "main" @__main.struct1__init = unnamed_addr constant %TON { i16 10, i16 17 } @__main.struct2__init = unnamed_addr constant %TON { i16 17, i16 10 } -define void @TON(%TON* %0) section "fn-$RUSTY$TON:v[i16][i16]" { +define void @TON(%TON* %0) { entry: %a = getelementptr inbounds %TON, %TON* %0, i32 0, i32 0 %b = getelementptr inbounds %TON, %TON* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %TEN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %struct1 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 46b624c2e8..ebd4b81ed2 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 @@ -14,7 +14,7 @@ source_filename = "main" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2i32i32" @__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-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var_init1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index f13d221a36..9b11239a80 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -711,7 +711,7 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %str = alloca [81 x i8], align 1 @@ -724,7 +724,7 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i8* %0) section "fn-$RUSTY$foo:i32[s8u81]" { + define i32 @foo(i8* %0) { entry: %foo = alloca i32, align 4 %val = alloca [81 x i8], align 1 @@ -770,7 +770,7 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %str = alloca [65537 x i8], align 1 @@ -783,7 +783,7 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i8* %0) section "fn-$RUSTY$foo:i32[s8u65537]" { + define i32 @foo(i8* %0) { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i8], align 1 @@ -829,7 +829,7 @@ fn by_value_function_arg_arrays_are_memcopied() { ; ModuleID = 'main' source_filename = "main" - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [65537 x i32], align 4 @@ -842,7 +842,7 @@ fn by_value_function_arg_arrays_are_memcopied() { ret i32 %main_ret } - define i32 @foo(i32* %0) section "fn-$RUSTY$foo:i32[ai32]" { + define i32 @foo(i32* %0) { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i32], align 4 @@ -899,7 +899,7 @@ fn by_value_function_arg_structs_are_memcopied() { @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-$RUSTY$__S_TY__init:r2u8u8" - define i32 @foo(%S_TY* %0) section "fn-$RUSTY$foo:i32[r2u8u8]" { + define i32 @foo(%S_TY* %0) { entry: %foo = alloca i32, align 4 %val = alloca %S_TY, align 8 @@ -911,7 +911,7 @@ fn by_value_function_arg_structs_are_memcopied() { ret i32 %foo_ret } - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %s = alloca %S_TY, align 8 @@ -972,7 +972,7 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer, section "var-$RUSTY$__AGGREGATE_COLLECTOR_TY__init:r3ai32s8u65537r2u8u8" @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer, section "var-$RUSTY$__S_TY__init:r2u8u8" - define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) section "fn-$RUSTY$foo:i32[r3ai32s8u65537r2u8u8]" { + define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) { entry: %foo = alloca i32, align 4 %val = alloca %AGGREGATE_COLLECTOR_TY, align 8 @@ -984,7 +984,7 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { ret i32 %foo_ret } - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %s = alloca %AGGREGATE_COLLECTOR_TY, align 8 @@ -1033,7 +1033,7 @@ fn by_value_fb_arg_aggregates_are_memcopied() { @__FOO__init = unnamed_addr constant %FOO zeroinitializer, section "var-$RUSTY$__FOO__init:r2s8u65537ai32" - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %str = alloca [65537 x i8], align 1 @@ -1059,7 +1059,7 @@ fn by_value_fb_arg_aggregates_are_memcopied() { ret i32 %main_ret } - define void @FOO(%FOO* %0) section "fn-$RUSTY$FOO:v[s8u65537][ai32]" { + define void @FOO(%FOO* %0) { entry: %val = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 %field = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 @@ -1125,7 +1125,7 @@ fn var_output_aggregate_types_are_memcopied() { @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer, section "var-$RUSTY$__OUT_TYPE__init:r1u8" @PRG_instance = global %PRG zeroinitializer, section "var-$RUSTY$PRG_instance:r6r1u8ai32ar1u8s8u81s16u81r5r1u8ai32ar1u8s8u81s16u81" - define void @FB(%FB* %0) section "fn-$RUSTY$FB:v[r1u8][ai32][ar1u8][s8u81][s16u81]" { + define void @FB(%FB* %0) { entry: %output = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 %output2 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 @@ -1135,7 +1135,7 @@ fn var_output_aggregate_types_are_memcopied() { ret void } - define void @PRG(%PRG* %0) section "fn-$RUSTY$PRG:v" { + define void @PRG(%PRG* %0) { entry: %out = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 0 %out2 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 1 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 7634d39be5..bbdaf3a8b5 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 @@ -11,7 +11,7 @@ source_filename = "main" @gY = global i8 0, section "var-$RUSTY$gY:u8" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: ret void } 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 cb25e9ba1a..60d250d371 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 @@ -11,7 +11,7 @@ source_filename = "main" @Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1r1ai16" @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r1ai16" -define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { +define void @Main(%Main* %0) { entry: %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %field1 = getelementptr inbounds %MyStruct, %MyStruct* %m, i32 0, i32 0 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 304525bce4..f795a10de0 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 @@ -13,7 +13,7 @@ source_filename = "main" @__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer, section "var-$RUSTY$__OuterStruct__init:r2r2i16i16r2i16i16" @__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer, section "var-$RUSTY$__InnerStruct__init:r2i16i16" -define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { +define void @Main(%Main* %0) { entry: %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %out1 = getelementptr inbounds %OuterStruct, %OuterStruct* %m, i32 0, i32 0 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 ae2766bb08..6e50ec0c82 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 @@ -9,14 +9,14 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @prg.foo(%prg* %0) ret void } -define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { +define void @prg.foo(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 e2aa3a0c5e..0b3a0ce4b7 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 c8c90ea637..b0b9fb99b8 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 e2aa3a0c5e..0b3a0ce4b7 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 e2aa3a0c5e..0b3a0ce4b7 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 82c76115c3..58dfa7a7ba 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 1 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 0a2219c729..4063642e90 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [6 x i32], [6 x i32]* %x, i32 0, i32 1 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 de08512f59..6693f51d70 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [3 x i32], [3 x i32]* %x, i32 0, i32 0 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 ab227e820f..7b0f9a218b 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 @@ -14,7 +14,7 @@ source_filename = "main" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2u8i32" @__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-$RUSTY$mainProg:v" { +define void @mainProg(%mainProg* %0) { entry: %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 ret void 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 d26b1b97d4..50651c37fb 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 @@ -14,7 +14,7 @@ source_filename = "main" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer, section "var-$RUSTY$__STRUCT2__init:r2u8i32" @__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-$RUSTY$mainProg:v" { +define void @mainProg(%mainProg* %0) { entry: %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 ret void 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 52ff058371..a54cc154f1 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 @@ -9,7 +9,7 @@ source_filename = "main" @UP = unnamed_addr constant i32 8, section "var-$RUSTY$UP:i32" @DOWN = unnamed_addr constant i32 15, section "var-$RUSTY$DOWN:i32" -define i32 @drive() section "fn-$RUSTY$drive:i32" { +define i32 @drive() { entry: %drive = alloca i32, align 4 %input = alloca i32, align 4 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 c92e8dcee5..187c9aadbb 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 @@ -10,7 +10,7 @@ source_filename = "main" @Direction.UP = unnamed_addr constant i32 8, section "var-$RUSTY$UP:e3i32" @Direction.DOWN = unnamed_addr constant i32 28, section "var-$RUSTY$DOWN:e3i32" -define i32 @drive() section "fn-$RUSTY$drive:i32" { +define i32 @drive() { entry: %drive = alloca i32, align 4 %input = alloca i32, align 4 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 55a652984b..fe62bf8e4d 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 3d517cb7c7..a06653bcda 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 225e7ac1cc..13d8caaab9 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 1, i8* %z, align 1 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 8e7ce4e7ef..dc13a52802 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 58b69425f3..fe3cef6007 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 0d6aa79303..21130b8576 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 -1, i32* %x, align 4 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 3c7fb32230..39a42cb350 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 0da2859836..e4dcbf3b60 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 013bcce359..e11f457ee6 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 @@ -10,14 +10,14 @@ source_filename = "main" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" -define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { +define void @MyClass(%MyClass* %0) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 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 b6d4db0881..a19b1d95dd 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 @@ -12,14 +12,14 @@ source_filename = "main" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16i16" -define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { +define void @MyClass(%MyClass* %0) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 @@ -38,7 +38,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 0d9e542906..1199cf25a0 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i16ai16api16pai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %arrX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6cd81f4e4b..5e3cf56cb9 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 @@ -9,7 +9,7 @@ source_filename = "main" @__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 }, section "var-$RUSTY$__fbWithConstant__init:r2i16i16" -define void @fbWithConstant(%fbWithConstant* %0) section "fn-$RUSTY$fbWithConstant:v" { +define void @fbWithConstant(%fbWithConstant* %0) { entry: %x = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 0 %const = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 1 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 f1184db8de..e60a838246 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 @@ -10,7 +10,7 @@ source_filename = "main" @MIN = unnamed_addr constant i16 7, section "var-$RUSTY$MIN:i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -26,7 +26,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 5, i16 0, i16 8) 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 2bed0e81ab..5af5c094e0 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 @@ -10,7 +10,7 @@ source_filename = "main" @MyStruct = unnamed_addr constant %STRUCT1 { i32 99 }, section "var-$RUSTY$MyStruct:r1i32" @__STRUCT1__init = unnamed_addr constant %STRUCT1 zeroinitializer, section "var-$RUSTY$__STRUCT1__init:r1i32" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %local_value = alloca i32, align 4 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 41d5a82ad4..e60cf424d7 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main { i32 0, i32 60 }, section "var-$RUSTY$main_instance:r2i32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %DAYS_IN_MONTH = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %SIXTY = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap index 3b0fa08f84..4472284778 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @func(i64* %0, i64* %1) section "fn-$RUSTY$func:i32[pi64][pi64]" { +define i32 @func(i64* %0, i64* %1) { entry: %func = alloca i32, align 4 %d_and_t = alloca i64*, align 8 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 55a96725a2..bcb347e66b 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 @@ -25,7 +25,7 @@ source_filename = "main" @cLDT_SHORT = unnamed_addr constant i64 172799123000000, section "var-$RUSTY$cLDT_SHORT:i64" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r16i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64i64" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %t1 = alloca i64, align 8 %t2 = alloca i64, align 8 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 b01ef6be32..4f0b7c1a2f 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap index 6accb260f6..92d05112d5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @func() section "fn-$RUSTY$func:i16" { +define i16 @func() { entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 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 55c7afa92f..653656a943 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg { i16 0, i16 1, i32 2 }, section "var-$RUSTY$prg_instance:r3i16i16i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap index 1d50aaf709..3451443644 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @foo() section "fn-$RUSTY$foo:i16" { +define i16 @foo() { entry: %foo = alloca i16, align 2 store i16 0, i16* %foo, align 2 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 58ead4ad4c..703d381efa 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: ret void } 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 cc9d1a042b..b44c3dad58 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: ret void } 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 45c105a08d..d58a0e8485 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ef1c55f2b2..e3c2910f32 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 @@ -12,7 +12,7 @@ source_filename = "main" @MyEnum.yellow = unnamed_addr constant i32 1, section "var-$RUSTY$yellow:e3i32" @MyEnum.green = unnamed_addr constant i32 2, section "var-$RUSTY$green:e3i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %color = getelementptr inbounds %main, %main* %0, i32 0, i32 0 store i32 0, i32* %color, align 4 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 bd82fedca3..798c784c2b 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 @@ -13,7 +13,7 @@ source_filename = "main" @TrafficLight.Yellow = unnamed_addr constant i32 2, section "var-$RUSTY$Yellow:e4i32" @TrafficLight.Green = unnamed_addr constant i32 3, section "var-$RUSTY$Green:e4i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %tf1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 ret void 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 6fc1325f79..c4e0899328 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 @@ -9,9 +9,9 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -declare i32 @foo() section "fn-$RUSTY$foo:i32" +declare i32 @foo() -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %call = call i32 @foo() ret void 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 b7e06b1f73..b22fff5d2e 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 @@ -11,7 +11,7 @@ source_filename = "main" @gY = external global i8, section "var-$RUSTY$gY:u8" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: ret void } 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 d9521f41de..b4f65fb14b 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 @@ -9,4 +9,4 @@ source_filename = "main" @prg_instance = external global %prg, section "var-$RUSTY$prg_instance:r2i32i32" -declare void @prg(%prg*) section "fn-$RUSTY$prg:v" +declare void @prg(%prg*) 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 b6d4db0881..a19b1d95dd 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 @@ -12,14 +12,14 @@ source_filename = "main" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r2i16i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16i16" -define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { +define void @MyClass(%MyClass* %0) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) { entry: %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 @@ -38,7 +38,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ccff95cd6e..7d8f838211 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 58c3bc0e70..b870ca4514 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i16 3, i16* %x, align 2 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 f0ba938547..cf199874e9 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 3, i64* %x, align 4 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 939f4cbb48..667b531eed 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 3, i8* %x, align 1 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 d8dcfd34db..8520168a5e 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 00a9396ea4..6d2a467ab4 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 28d0351a43..98199a49aa 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i32i32i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %step = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d32995dea1..15d90744e7 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 411285a0cc..927c8adcdb 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 3, i32* %x, align 4 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 94777d2d7b..075997005d 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 @@ -11,14 +11,14 @@ source_filename = "main" @__foo__init = unnamed_addr constant %foo zeroinitializer, section "var-$RUSTY$__foo__init:r2i16i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1r2i16i16" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i16][i16]" { +define void @foo(%foo* %0) { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %fb_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @foo(%foo* %fb_inst) 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 72d159848b..ee6fda63b7 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 @@ -13,18 +13,18 @@ source_filename = "main" @__bar__init = unnamed_addr constant %bar zeroinitializer, section "var-$RUSTY$__bar__init:r0" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1r1r0" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { +define void @foo(%foo* %0) { entry: %bar_inst = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 ret void } -define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { +define void @bar(%bar* %0) { entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %foo_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %bar_inst = getelementptr inbounds %foo, %foo* %foo_inst, i32 0, i32 0 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 5c36e24087..c4eae6e43a 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i64 @TIME() section "fn-$RUSTY$TIME:i64" { +define i64 @TIME() { entry: %TIME = alloca i64, align 8 store i64 0, i64* %TIME, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %TIME_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %call = call i64 @TIME() ret void 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 0317488398..71d08091f1 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo() section "fn-$RUSTY$foo:i32" { +define i32 @foo() { entry: %foo = alloca i32, align 4 store i32 0, i32* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo() 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 87f13d62a3..662735a692 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo() section "fn-$RUSTY$foo:i32" { +define i32 @foo() { entry: %foo = alloca i32, align 4 store i32 0, i32* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %froo = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo() 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 e37a94c26f..d86a5e139b 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { +define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -30,7 +30,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %call = call i32 @foo(i32 5) ret void 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 0339a12c6b..c01cc63117 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { +define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -26,7 +26,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %call = call i32 @foo(i32 5) ret void 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 9746527493..de5790510a 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { +define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo(i32 2) 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 983140bb99..ab2ac3d3a6 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @foo(i32 %0, i8 %1) section "fn-$RUSTY$foo:i32[i32][u8]" { +define i32 @foo(i32 %0, i8 %1) { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 @@ -22,7 +22,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @foo(i32 2, i8 1) 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 7ae048cffc..5de181f3ee 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 @@ -10,7 +10,7 @@ source_filename = "main" @gX = global i16 0, section "var-$RUSTY$gX:i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i16 20, i16* @gX, align 2 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 23df0bcab4..ef343d0dce 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r7i32i32i32i32u8u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a824d5337e..fac3a0f4ca 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e49be94e85..975eb682da 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 53cc42de78..2e734ccece 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 @@ -12,7 +12,7 @@ source_filename = "main" @c = unnamed_addr constant i16 5, section "var-$RUSTY$c:i16" @aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer }, section "var-$RUSTY$aaa_instance:r4i16i16au8au8" -define void @aaa(%aaa* %0) section "fn-$RUSTY$aaa:v" { +define void @aaa(%aaa* %0) { entry: %a = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 0 %b = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 1 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 87c7d9eaa1..c8848798c7 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 @@ -10,12 +10,12 @@ source_filename = "main" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r0" -define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { +define void @MyClass(%MyClass* %0) { entry: ret void } -define i16 @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:i16[i16]" { +define i16 @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) { entry: %myMethodArg = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 0 %testMethod = alloca i16, align 2 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 8e9dc9ccaa..24c3052f2f 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 @@ -10,12 +10,12 @@ source_filename = "main" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer, section "var-$RUSTY$__MyClass__init:r0" -define void @MyClass(%MyClass* %0) section "fn-$RUSTY$MyClass:v" { +define void @MyClass(%MyClass* %0) { entry: ret void } -define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) section "fn-$RUSTY$MyClass.testMethod:v[i16]" { +define void @MyClass.testMethod(%MyClass* %0, %MyClass.testMethod* %1) { entry: %myMethodArg = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 0 %myMethodLocalVar = getelementptr inbounds %MyClass.testMethod, %MyClass.testMethod* %1, i32 0, i32 1 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 1579e045bc..6713e3b2f8 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF }, section "var-$RUSTY$main_instance:r4f32f32f64f64" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %F32_MIN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %F32_MAX = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 736ff83786..c7b88e4bda 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [8 x i32], [8 x i32]* %x, i32 0, i32 4 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 a234c2d499..96de0d7952 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 2c82ee55a2..cac737c57c 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1aai32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %x, i32 0, i32 2 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 5fb0d0ebc4..be3f58cc8d 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16i16i16ai32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 03487be827..91a6c84558 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16i16i16ai32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 da7ea64ee9..0dcf3c5c05 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1aai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 ca091a63ba..5046d8aa31 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define i32 @bar() section "fn-$RUSTY$bar:i32" { +define i32 @bar() { entry: %bar = alloca i32, align 4 store i32 0, i32* %bar, align 4 @@ -18,7 +18,7 @@ entry: ret i32 %bar_ret } -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { +define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ret i32 %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call i32 @bar() 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 9230623944..d90036fcb2 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i16i16" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %temp = alloca i16, align 2 %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 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 a8e6b32c9f..9f396f290a 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 @@ -13,14 +13,14 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1pi32" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @foo2(%foo2* %0) section "fn-$RUSTY$foo2:v[pi32][i32]" { +define void @foo2(%foo2* %0) { entry: %inout = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 0 %in = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 1 ret void } -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[pi32]" { +define void @foo(%foo* %0) { entry: %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %deref = load i32*, i32** %inout, align 8 @@ -32,7 +32,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32* %baz, i32** getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap index 02c169bf67..e9c9e7a662 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @main(i16** %0, i16* %1) section "fn-$RUSTY$main:i16[ppi16][pai16]" { +define i16 @main(i16** %0, i16* %1) { entry: %main = alloca i16, align 2 %a = alloca i16**, align 8 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 cd9516d4a5..6f1bc031c9 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8pu8pu8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %pX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 29ad582599..d17c3b89f2 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 @@ -11,12 +11,12 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r0" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { +define void @foo(%foo* %0) { entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: call void @foo(%foo* @foo_instance) ret void 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 7b0f68c8dc..7e2acd37df 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 8597d9c327..539a5fbb33 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 0056daf87e..e53849cbbb 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i8 1, i8* %y, align 1 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 80a0e3ea47..853aed8a72 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 @@ -11,7 +11,7 @@ source_filename = "main" @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] -define void @mainPROG(%mainPROG* %0) section "fn-$RUSTY$mainPROG:v" { +define void @mainPROG(%mainPROG* %0) { entry: %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 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 bcd7ca81bc..58f6f9427c 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 @@ -15,7 +15,7 @@ source_filename = "main" @utf16_literal_2 = private unnamed_addr constant [2 x i16] [i16 39, i16 0] @utf16_literal_3 = private unnamed_addr constant [2 x i16] [i16 65, i16 0] -define void @mainPROG(%mainPROG* %0) section "fn-$RUSTY$mainPROG:v" { +define void @mainPROG(%mainPROG* %0) { entry: %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 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 3fd53113a8..1a6dd497d5 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 e481318994..667f5db1de 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6247fa9ea4..a825e44e4b 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 aadb49f9e3..0ef5c5f8a8 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 @@ -11,7 +11,7 @@ source_filename = "main" @foo_instance = global %foo { i16 7 }, section "var-$RUSTY$foo_instance:r3i16i16i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { +define void @foo(%foo* %0) { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = alloca i16, align 2 @@ -26,7 +26,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: call void @foo(%foo* @foo_instance) ret void 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 6ddd1200b1..5360aff5c8 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4i64i64i64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 54552d47b5..8418335c49 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a0ee38c445..fbed213da5 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6529671a52..18e94d23ee 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ff2e14ca7e..1bc9835247 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32f32f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 4b50d7ee45..7d0e532fda 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store float 1.562500e-01, float* %y, align 4 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 6e4363b5f1..7f7a834165 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 59a354dd17..65c7967163 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 662befc1ea..03612618e3 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 @@ -13,7 +13,7 @@ source_filename = "main" @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] @utf16_literal_1 = private unnamed_addr constant [41 x i16] [i16 97, i16 10, i16 10, i16 32, i16 98, i16 10, i16 10, i16 32, i16 99, i16 12, i16 12, i16 32, i16 100, i16 13, i16 13, i16 32, i16 101, i16 9, i16 9, i16 32, i16 36, i16 32, i16 34, i16 100, i16 111, i16 117, i16 98, i16 108, i16 101, i16 34, i16 32, i16 87, i16 -10179, i16 -9066, i16 -10179, i16 -9066, i16 0, i16 0, i16 0, i16 0, i16 0] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %should_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %should_not_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 cde09cf13e..cad04066bf 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 @@ -11,7 +11,7 @@ source_filename = "main" @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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 7af52c8f38..01f162f9f6 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 0, i64* %y, align 4 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 148f498e94..4da9054179 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 0, i64* %y, align 4 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 eeacbb46c4..d62f9e7bdc 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 @@ -11,14 +11,14 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { +define void @foo(%foo* %0) { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 af00d4d3f0..0e4d6c28d7 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 @@ -11,14 +11,14 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r0" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { +define void @foo(%foo* %0) { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 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 d533f19db9..228fca5223 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 @@ -11,7 +11,7 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1pi32" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[pi32]" { +define void @foo(%foo* %0) { entry: %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %deref = load i32*, i32** %inout, align 8 @@ -22,7 +22,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 7, i32* %baz, align 4 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 cc8392f436..b872ee9b46 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 @@ -11,14 +11,14 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { +define void @foo(%foo* %0) { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 cc8392f436..b872ee9b46 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 @@ -11,14 +11,14 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r2i32u8" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][u8]" { +define void @foo(%foo* %0) { entry: %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 c3a91f18e9..5fa068962b 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 31f63a6092..9eea63415e 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 5e64b1a534..8be3b5de14 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d8193c60c5..40116a8d9d 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 7, i32* %y, align 4 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 9480d5c1e5..3fb8cae3e1 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 45c105a08d..d58a0e8485 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 9536961b07..c2ec2c91c4 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 4ad950148d..8b01b64820 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 945e2bde0a..ad33a4f79d 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 @@ -11,20 +11,20 @@ source_filename = "main" @bar_instance = global %bar zeroinitializer, section "var-$RUSTY$bar_instance:r1r1i32" @__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1i32" -define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { +define void @bar(%bar* %0) { entry: %fb_inst = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 call void @fb.foo(%fb* %fb_inst) ret void } -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { +define void @fb(%fb* %0) { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define void @fb.foo(%fb* %0) section "fn-$RUSTY$fb.foo:v" { +define void @fb.foo(%fb* %0) { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 55c0eb2814..9a21b7f016 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 @@ -11,19 +11,19 @@ source_filename = "main" @bar_instance = global %bar zeroinitializer, section "var-$RUSTY$bar_instance:r0" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @bar(%bar* %0) section "fn-$RUSTY$bar:v" { +define void @bar(%bar* %0) { entry: call void @prg.foo(%prg* @prg_instance) ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void } -define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { +define void @prg.foo(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 40b9b20ea5..e734d4d4dd 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 @@ -9,14 +9,14 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 call void @prg.foo(%prg* @prg_instance) ret void } -define void @prg.foo(%prg* %0) section "fn-$RUSTY$prg.foo:v" { +define void @prg.foo(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 2, i32* %x, align 4 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 17bbea8e09..e7d3ed05ad 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define float @foo() section "fn-$RUSTY$foo:f32" { +define float @foo() { entry: %foo = alloca float, align 4 store float 0.000000e+00, float* %foo, align 4 @@ -18,7 +18,7 @@ entry: ret float %foo_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %call = call float @foo() 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 fb28f15ddf..b24a8260c7 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 @@ -13,13 +13,13 @@ source_filename = "main" @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r3i32i32r1i32" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v[i32]" { +define void @fb(%fb* %0) { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void } -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v[i32][i32][r1i32]" { +define void @foo(%foo* %0) { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 @@ -27,7 +27,7 @@ entry: ret void } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 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 6677ce0538..aad499798c 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 @@ -19,14 +19,14 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2pr3u8u8u8pr3u8u8u8" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[pr3u8u8u8][pr3u8u8u8]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %input2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: store %STRUCT_params* @global1, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 8 store %STRUCT_params* @global2, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 8 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 eec9b3d007..ea95aded75 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %while_body diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap index c00bf980cc..557ea20ecf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @smaller_than_ten(i8 %0) section "fn-$RUSTY$smaller_than_ten:i16[i8]" { +define i16 @smaller_than_ten(i8 %0) { entry: %smaller_than_ten = alloca i16, align 2 %n = alloca i8, align 1 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 cb295b5885..3c07c812c1 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 @@ -9,7 +9,7 @@ source_filename = "main" @__abcdef__init = unnamed_addr constant %abcdef zeroinitializer, section "var-$RUSTY$__abcdef__init:r1i8" -define void @abcdef(%abcdef* %0) section "fn-$RUSTY$abcdef:v[i8]" { +define void @abcdef(%abcdef* %0) { entry: %n = getelementptr inbounds %abcdef, %abcdef* %0, i32 0, i32 0 %load_n = load i8, i8* %n, align 1 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 c41c610a88..888d769818 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 d789eb7721..211ff4a4d2 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap index 2677cbcb87..f879a980d2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %i = alloca i32, align 4 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 3e83ed11ae..2f7c199915 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 @@ -11,7 +11,7 @@ source_filename = "main" @MainProg_instance = global %MainProg zeroinitializer, section "var-$RUSTY$MainProg_instance:r1r2i32i32" @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer, section "var-$RUSTY$__MyStruct__init:r2i32i32" -define void @MainProg(%MainProg* %0) section "fn-$RUSTY$MainProg:v" { +define void @MainProg(%MainProg* %0) { entry: %Cord = getelementptr inbounds %MainProg, %MainProg* %0, i32 0, i32 0 %a = getelementptr inbounds %MyStruct, %MyStruct* %Cord, i32 0, i32 0 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 eb3ee8488d..c399cc55c6 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r10u8i8u8u16i16u16i32u32i64u64" -define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$CheckRangeSigned:i32[i32][i32][i32]" { +define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) { entry: %CheckRangeSigned = alloca i32, align 4 %v = alloca i32, align 4 @@ -24,7 +24,7 @@ entry: ret i32 %CheckRangeSigned_ret } -define i32 @CheckRangeUnsigned(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$CheckRangeUnsigned:u32[u32][u32][u32]" { +define i32 @CheckRangeUnsigned(i32 %0, i32 %1, i32 %2) { entry: %CheckRangeUnsigned = alloca i32, align 4 %v = alloca i32, align 4 @@ -39,7 +39,7 @@ entry: ret i32 %CheckRangeUnsigned_ret } -define i64 @CheckLRangeSigned(i64 %0, i64 %1, i64 %2) section "fn-$RUSTY$CheckLRangeSigned:i64[i64][i64][i64]" { +define i64 @CheckLRangeSigned(i64 %0, i64 %1, i64 %2) { entry: %CheckLRangeSigned = alloca i64, align 8 %v = alloca i64, align 8 @@ -54,7 +54,7 @@ entry: ret i64 %CheckLRangeSigned_ret } -define i64 @CheckLRangeUnsigned(i64 %0, i64 %1, i64 %2) section "fn-$RUSTY$CheckLRangeUnsigned:u64[u64][u64][u64]" { +define i64 @CheckLRangeUnsigned(i64 %0, i64 %1, i64 %2) { entry: %CheckLRangeUnsigned = alloca i64, align 8 %v = alloca i64, align 8 @@ -69,7 +69,7 @@ entry: ret i64 %CheckLRangeUnsigned_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 bc09741b3b..fd0bd69e7c 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 @@ -9,7 +9,7 @@ source_filename = "main" @Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1i16" -define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$Check_XX_RangeSigned:i16[i16][i16][i16]" { +define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) { entry: %Check_XX_RangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -25,7 +25,7 @@ entry: ret i16 %Check_XX_RangeSigned_ret } -define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { +define void @Main(%Main* %0) { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 store i16 7, i16* %x, align 2 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 dde219b202..39df02e6f2 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 @@ -9,7 +9,7 @@ source_filename = "main" @Main_instance = global %Main zeroinitializer, section "var-$RUSTY$Main_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -25,7 +25,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @Main(%Main* %0) section "fn-$RUSTY$Main:v" { +define void @Main(%Main* %0) { entry: %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 7, i16 0, i16 100) 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 19aa36b0df..3b4e031dc1 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i64 1000000, i64* %y, align 4 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 1184d09cb3..bdb2ff39bf 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 @@ -12,7 +12,7 @@ source_filename = "main" @gA = global i16 0, section "var-$RUSTY$gA:i16" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: ret void } 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 97965f0407..1145cbbcf5 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 @@ -18,7 +18,7 @@ source_filename = "main" @MyEnum3.yellow = unnamed_addr constant i32 26, section "var-$RUSTY$yellow:e3i32" @MyEnum3.green = unnamed_addr constant i32 27, section "var-$RUSTY$green:e3i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 5f55331eb1..ceb04500df 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1ai16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void 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 bf6f679b63..ed99ee0148 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 @@ -11,7 +11,7 @@ source_filename = "main" @MIN = global i16 7, section "var-$RUSTY$MIN:i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i16" -define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) section "fn-$RUSTY$CheckRangeSigned:i16[i16][i16][i16]" { +define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 @@ -27,7 +27,7 @@ entry: ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_MIN = load i16, i16* @MIN, align 2 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 f03fe9d1c1..5485f95791 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 @@ -12,7 +12,7 @@ source_filename = "main" @cC = unnamed_addr constant i16 3, section "var-$RUSTY$cC:i16" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 store i32 6, i32* %z, align 4 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 51c2a26aa4..e485c97508 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 @@ -9,7 +9,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1i64" -define i64 @func() section "fn-$RUSTY$func:i64" { +define i64 @func() { entry: %func = alloca i64, align 8 %TIME = alloca i64, align 8 @@ -19,7 +19,7 @@ entry: ret i64 %func_ret } -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %TIME = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 bb75b11e96..83bf6c0507 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check 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 2da5f62bc8..ceaaa8a618 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check 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 ff1fc737a2..2c18806bb6 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 br label %condition_check diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap index e00468537d..77c4051c76 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap index e00468537d..77c4051c76 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 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 cb1dcf50c3..4e07f28967 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i64i64i64i64" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var_time = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var_time_of_day = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 2374533195..24eab4862b 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r13pf32i16i32f32f64i8i16i32i64u8u16u32u64" -define float @foo() section "fn-$RUSTY$foo:f32" { +define float @foo() { entry: %foo = alloca float, align 4 store float 0.000000e+00, float* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret float %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %ptr_float = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 7061563847..32399acdb7 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r11pi16i16i32i8i16i32i64u8u16u32u64" -define i64 @foo() section "fn-$RUSTY$foo:i64" { +define i64 @foo() { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %ptr_int = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 8ea2a13eb6..68f9c7f2c7 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main { i16 10, i16 20, i16* null, i8 0 }, section "var-$RUSTY$main_instance:r4i16i16pi16u8" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 e1405db64d..81b6297605 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3pi16i16u8" -define i64 @foo() section "fn-$RUSTY$foo:i64" { +define i64 @foo() { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap index e00468537d..77c4051c76 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap index 48267d94d4..dbfdab2488 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap @@ -8,7 +8,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap index 96d9c979e5..d2f63f4a4f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap @@ -8,7 +8,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap index 9f9a9afc1f..ac657ffbc6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-$RUSTY$STRING_GREATER:u8[s8u1025][s8u1025]" { +define i8 @STRING_GREATER(i8* %0, i8* %1) { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_GREATER_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -39,7 +39,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap index 0df19053b2..c7b9ba036f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) section "fn-$RUSTY$STRING_GREATER:u8[s8u1025][s8u1025]" { +define i8 @STRING_GREATER(i8* %0, i8* %1) { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_GREATER_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap index 1c657cb42f..faeee3927f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-$RUSTY$STRING_LESS:u8[s8u1025][s8u1025]" { +define i8 @STRING_LESS(i8* %0, i8* %1) { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_LESS_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap index f92c798710..5116e3a419 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap index 4ae435d748..251f654eac 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) section "fn-$RUSTY$STRING_LESS:u8[s8u1025][s8u1025]" { +define i8 @STRING_LESS(i8* %0, i8* %1) { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -23,7 +23,7 @@ entry: ret i8 %STRING_LESS_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -39,7 +39,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 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 ea2fbfae18..af0e24f23f 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 @@ -10,7 +10,7 @@ source_filename = "main" @const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4], section "var-$RUSTY$const_arr:ai16" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1ai16" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [4 x i16]* %arr to i8* 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 2b61ed25b8..849076db82 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 @@ -10,7 +10,7 @@ source_filename = "main" @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-$RUSTY$const_str:s8u81" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [81 x i8]* %str to i8* 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 2691f18820..83c907ef95 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 @@ -12,7 +12,7 @@ source_filename = "main" @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r2i16i16" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %strct = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast %Point* %strct to i8* diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap index 17b1cc0780..eb9a21579b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %a = alloca i8, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap index 9dd16c7c5e..82157e5ee2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %b = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap index be0753e99e..df2fdd3223 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap index 3e4cf08673..730a856e1e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap index 4b2a62507b..4dbd80add5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 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 178b8710e9..653cd5b05e 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 @@ -9,7 +9,7 @@ source_filename = "main" @__myStruct__init = unnamed_addr constant %myStruct { i8 1 }, section "var-$RUSTY$__myStruct__init:r1u8" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %str = alloca %myStruct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap index b0ac3abaca..526cd8d415 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap @@ -5,7 +5,7 @@ expression: prog ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 %c = alloca i32, align 4 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 7b186085ef..47294328a2 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 @@ -9,7 +9,7 @@ source_filename = "main" @baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r3s8u11pu8pau8" -define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { +define void @baz(%baz* %0) { entry: %str = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 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 772275ede2..ddd60ad936 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4i16ai16pi16pai16" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %v = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap index 28886fa044..b133fefe3a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap index f8efd2d2ac..52150aac76 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap index 3007b56127..4d91b56344 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap index 34a91ddfc7..01d0a1147f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap index c08bacfc03..b61c2fa65e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap index d6d8a79ac0..32bf6aed61 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 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 8b30fb03c9..a133c104c7 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 8a90e7a960..0d09121adb 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 @@ -11,7 +11,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 48d5aecacc..ed65df19a1 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 83fc6f99f0..66f92fc5a3 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r5i32i32i32i32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 25482f90db..390672b4ba 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 @@ -13,7 +13,7 @@ source_filename = "main" @utf08_literal_2 = private unnamed_addr constant [6 x i8] c"lorem\00" @utf08_literal_3 = private unnamed_addr constant [4 x i8] c"sit\00" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 e4be51277b..4b9fbc9ac8 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 bd9ab0f2a9..be347b9900 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 035232f169..b055b6e77a 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 be59e2f268..159873b24b 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i64" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 f652e3b20d..f551751695 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 @@ -11,7 +11,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -30,7 +30,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 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 6451ebd31b..dd9d6bd66b 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 @@ -12,7 +12,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2ai32i32" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai32ai32" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -31,7 +31,7 @@ entry: ret void } -define i32 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { +define i32 @foo(%__foo_vla* %0) { entry: %foo = alloca i32, align 4 %vla = alloca %__foo_vla*, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap index ee02b908f5..8d2e3f2b8a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap index f8ff9fdbf9..7395120b94 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap index 20a48a564f..7ced418762 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap index 36e78e620c..7e26e3e1ce 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap index a3fd7da5db..968ff9a84b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap index db9b19e583..4a7ef99c6d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap @@ -5,7 +5,7 @@ expression: res ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 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 4171b61453..f58708dceb 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func([81 x i8]* %0) section "fn-$RUSTY$func:s8u81" { +define void @func([81 x i8]* %0) { entry: %func = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %func, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 e9f7708b71..2c85da0ba3 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 @@ -9,7 +9,7 @@ source_filename = "main" @baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r2pu8u16" -define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { +define void @baz(%baz* %0) { entry: %ptr_x = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %y = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap index 32dc6e8eb6..a7cd4f7fd4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %ptr_x = alloca i16*, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap index 57b04fefea..e5e9d1b1db 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 %ptr_x = alloca i16*, align 8 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 2d4d578bcb..42907222a9 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r8u8u8u8u8u8u8u8u8" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %cmp1 = alloca i8, align 1 %cmp2 = alloca i8, align 1 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 2b0dd2a577..97091e50ab 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 de482e43a1..b4989a14e7 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u8u8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap index eb1dc9ec1c..e21248df0d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @main() section "fn-$RUSTY$main:i16" { +define i16 @main() { entry: %main = alloca i16, align 2 store i16 0, i16* %main, align 2 @@ -31,4 +31,4 @@ entry: ret i16 %main_ret } -declare i16 @MAX__INT(i32, i16*) section "fn-$RUSTY$MAX__INT:i16" +declare i16 @MAX__INT(i32, i16*) 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 6857bb5d92..c74101c715 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" { +define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %a = alloca i32, align 4 @@ -19,7 +19,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %call = call i32 @foo(i32 2) %call1 = call i32 @foo(i32 %call) 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 fd92525307..9dad68d89d 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main { i16 10, i16 20, i16* null }, section "var-$RUSTY$main_instance:r3i16i16pi16" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 0820ec9a24..96851b82a0 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2pi16i16" -define i64 @foo() section "fn-$RUSTY$foo:i64" { +define i64 @foo() { entry: %foo = alloca i64, align 8 store i64 0, i64* %foo, align 4 @@ -17,7 +17,7 @@ entry: ret i64 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap index f4aef10525..cd7338e927 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16* @func() section "fn-$RUSTY$func:pi16" { +define i16* @func() { entry: %func = alloca i16*, align 8 store i16* null, i16** %func, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap index 941ea6b3e6..0ccf0a125c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap @@ -7,7 +7,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func([81 x i8]* %0, [81 x i8]* %1) section "fn-$RUSTY$func:s8u81[ps8u81]" { +define void @func([81 x i8]* %0, [81 x i8]* %1) { entry: %func = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %func, align 8 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 cfe7c75908..5667f24967 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 @@ -9,7 +9,7 @@ source_filename = "main" @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r1i16" -define void @func(%myStruct* %0, %myStruct* %1) section "fn-$RUSTY$func:r1i16[pr1i16]" { +define void @func(%myStruct* %0, %myStruct* %1) { entry: %func = alloca %myStruct*, align 8 store %myStruct* %0, %myStruct** %func, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap index 5905a187d2..618f020f64 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i16 @foo(i16 %0) section "fn-$RUSTY$foo:i16[i16]" { +define i16 @foo(i16 %0) { entry: %foo = alloca i16, align 2 %in = alloca i16, align 2 @@ -15,7 +15,7 @@ entry: ret i16 %foo_ret } -define i16 @baz() section "fn-$RUSTY$baz:i16" { +define i16 @baz() { entry: %baz = alloca i16, align 2 store i16 0, i16* %baz, align 2 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 9aded1e339..528b0110e6 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 885da78a65..06a2d391e6 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 @@ -9,7 +9,7 @@ source_filename = "main" @baz_instance = global %baz zeroinitializer, section "var-$RUSTY$baz_instance:r4pu8u8i8u8" -define void @baz(%baz* %0) section "fn-$RUSTY$baz:v" { +define void @baz(%baz* %0) { entry: %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 %b = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index cb493902b8..f101244f3a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [5 x i32], align 4 @@ -18,7 +18,7 @@ entry: ret i32 %main_ret } -define i32 @fn_by_ref(i32* %0) section "fn-$RUSTY$fn_by_ref:i32[pau32]" { +define i32 @fn_by_ref(i32* %0) { entry: %fn_by_ref = alloca i32, align 4 %arg_by_ref = alloca i32*, align 8 @@ -30,7 +30,7 @@ entry: ret i32 %fn_by_ref_ret } -define i32 @fn_by_val(i32* %0) section "fn-$RUSTY$fn_by_val:i32[au32]" { +define i32 @fn_by_val(i32* %0) { entry: %fn_by_val = alloca i32, align 4 %arg_by_val = alloca [5 x i32], align 4 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 a43fa0ad8d..e906476532 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define i32 @func(i8* %0, i16* %1, i32* %2, i64* %3, float* %4, double* %5) section "fn-$RUSTY$func:i32[pi8][pi16][pi32][pi64][pf32][pf64]" { +define i32 @func(i8* %0, i16* %1, i32* %2, i64* %3, float* %4, double* %5) { entry: %func = alloca i32, align 4 %byInt1 = alloca i8*, align 8 @@ -30,7 +30,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %1 = alloca i8, align 1 store i8 1, i8* %1, align 1 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 eba1401e34..1b64a76dcf 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 @@ -9,7 +9,7 @@ source_filename = "main" @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-$RUSTY$main_instance:r12i8i8i16i16i32i32i64i64f32f32f64f64" -define i8 @fn_sint(i8* %0, i8* %1) section "fn-$RUSTY$fn_sint:i8[pi8][pi8]" { +define i8 @fn_sint(i8* %0, i8* %1) { entry: %fn_sint = alloca i8, align 1 %in_ref = alloca i8*, align 8 @@ -21,7 +21,7 @@ entry: ret i8 %fn_sint_ret } -define i64 @fn_lint(i64* %0, i64* %1) section "fn-$RUSTY$fn_lint:i64[pi64][pi64]" { +define i64 @fn_lint(i64* %0, i64* %1) { entry: %fn_lint = alloca i64, align 8 %in_ref = alloca i64*, align 8 @@ -33,7 +33,7 @@ entry: ret i64 %fn_lint_ret } -define i64 @fn_real(float* %0, float* %1) section "fn-$RUSTY$fn_real:i64[pf32][pf32]" { +define i64 @fn_real(float* %0, float* %1) { entry: %fn_real = alloca i64, align 8 %in_ref = alloca float*, align 8 @@ -45,7 +45,7 @@ entry: ret i64 %fn_real_ret } -define i64 @fn_lreal(double* %0, double* %1) section "fn-$RUSTY$fn_lreal:i64[pf64][pf64]" { +define i64 @fn_lreal(double* %0, double* %1) { entry: %fn_lreal = alloca i64, align 8 %in_ref = alloca double*, align 8 @@ -57,7 +57,7 @@ entry: ret i64 %fn_lreal_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 dce4f413a1..375735e989 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 @@ -12,9 +12,9 @@ source_filename = "main" @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" -declare i32 @foo(i32, i8**) section "fn-$RUSTY$foo:i32" +declare i32 @foo(i32, i8**) -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %1 = alloca [3 x i8*], align 8 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 d91b7b02ed..2520f1765f 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 @@ -9,9 +9,9 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -declare i32 @foo(i32, i32*) section "fn-$RUSTY$foo:i32" +declare i32 @foo(i32, i32*) -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 1be4fb4117..c3a6d4a9ee 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 @@ -9,9 +9,9 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -declare i32 @foo(...) section "fn-$RUSTY$foo:i32" +declare i32 @foo(...) -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %load_x = load i32, i32* %x, align 4 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 2e5636d68b..b816149e10 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 @@ -10,9 +10,9 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -declare void @func([81 x i8]*, i8*) section "fn-$RUSTY$func:s8u81[ps8u81]" +declare void @func([81 x i8]*, i8*) -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %res = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap index 94c6a39e2c..f022f77470 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @func(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$func:i32[i16][pi8][pi64]" { +define i32 @func(i16 %0, i8* %1, i64* %2) { entry: %func = alloca i32, align 4 %i = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap index 770242651b..4fc0d2ed9d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @bump(i8* %0) section "fn-$RUSTY$bump:i32[pi8]" { +define i32 @bump(i8* %0) { entry: %bump = alloca i32, align 4 %v = alloca i8*, align 8 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 082aa87611..d09a234cf2 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u6" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) section "fn-$RUSTY$func:i32[s8u6]" { +define i32 @func(i8* %0) { entry: %func = alloca i32, align 4 %x = alloca [6 x i8], align 1 @@ -22,7 +22,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [6 x i8]* %a to i8* 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 1a2b372911..250741e6ae 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u6" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) section "fn-$RUSTY$func:i32[ps8u6]" { +define i32 @func(i8* %0) { entry: %func = alloca i32, align 4 %x = alloca i8*, align 8 @@ -20,7 +20,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = bitcast [6 x i8]* %a to i8* 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 e6cf5dc952..d1bdcd9611 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) section "fn-$RUSTY$func:i32[pi16][pi32][i16][i32]" { +define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) { entry: %func = alloca i32, align 4 %byRef1 = alloca i16*, align 8 @@ -38,7 +38,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %1 = alloca i16, align 2 store i16 1, i16* %1, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap index 1011885324..101a97e38a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap @@ -5,7 +5,7 @@ expression: codegen(src) ; ModuleID = 'main' source_filename = "main" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 @@ -20,7 +20,7 @@ entry: ret i32 %main_ret } -define i32 @SMC_Read(i64 %0) section "fn-$RUSTY$SMC_Read:i32[u64]" { +define i32 @SMC_Read(i64 %0) { entry: %SMC_Read = alloca i32, align 4 %ValAddr = alloca i64, align 8 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 b0d691e261..46c997f8eb 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define i32 @func(i32 %0) section "fn-$RUSTY$func:i32[i32]" { +define i32 @func(i32 %0) { entry: %func = alloca i32, align 4 %x = alloca i32, align 4 @@ -19,7 +19,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %load_a = load i32, i32* %a, align 4 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 93ce1a318b..26a71e77ed 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main { i16 4 }, section "var-$RUSTY$main_instance:r1i16" -define i32 @func(i16* %0) section "fn-$RUSTY$func:i32[pi16]" { +define i32 @func(i16* %0) { entry: %func = alloca i32, align 4 %o = alloca i16*, align 8 @@ -22,7 +22,7 @@ entry: ret i32 %func_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %call = call i32 @func(i16* %x) 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 8c1b8cb6f5..f4c6aa36e3 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r10f32f32f32f64f32f32f32f64i32i32" -define float @foo__REAL(float %0) section "fn-$RUSTY$foo__REAL:f32[f32]" { +define float @foo__REAL(float %0) { entry: %foo__REAL = alloca float, align 4 %in1 = alloca float, align 4 @@ -19,7 +19,7 @@ entry: ret float %foo__REAL_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %res_sint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %res_int = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -56,4 +56,4 @@ entry: ret void } -declare double @foo__LREAL(double) section "fn-$RUSTY$foo__LREAL:f64[f64]" +declare double @foo__LREAL(double) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap index e60815a9c2..41de8938d8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap @@ -5,7 +5,7 @@ expression: codegen(src) ; ModuleID = 'main' source_filename = "main" -define double @main() section "fn-$RUSTY$main:f64" { +define double @main() { entry: %main = alloca double, align 8 store double 0.000000e+00, double* %main, align 8 @@ -25,4 +25,4 @@ entry: ret double %main_ret } -declare double @MAX__LREAL(i32, double*) section "fn-$RUSTY$MAX__LREAL:f64" +declare double @MAX__LREAL(i32, double*) 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 e689ca4ee8..3aed824b31 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i16" -define i32 @MAX__DINT(i32 %0, i32 %1) section "fn-$RUSTY$MAX__DINT:i32[i32][i32]" { +define i32 @MAX__DINT(i32 %0, i32 %1) { entry: %MAX__DINT = alloca i32, align 4 %in1 = alloca i32, align 4 @@ -21,7 +21,7 @@ entry: ret i32 %MAX__DINT_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -32,4 +32,4 @@ entry: ret void } -declare i16 @MAX__INT(i16, i16) section "fn-$RUSTY$MAX__INT:i16[i16][i16]" +declare i16 @MAX__INT(i16, i16) 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 800a20c076..0c73c8834f 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16i16i64" -define i16 @foo__INT(i64 %0, i16* %1) section "fn-$RUSTY$foo__INT:i16[i64][pi16]" { +define i16 @foo__INT(i64 %0, i16* %1) { entry: %foo__INT = alloca i16, align 2 %in1 = alloca i64, align 8 @@ -21,7 +21,7 @@ entry: ret i16 %foo__INT_ret } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %theInt = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %iResult = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 51630a2755..70aed6ee98 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 @@ -18,7 +18,7 @@ source_filename = "prog.st" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1r2i32pi16" @__myStruct__init = external global %myStruct.1, section "var-$RUSTY$__myStruct__init:r2i32pi16" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 c988a33004..4d358e1e50 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 @@ -16,7 +16,7 @@ source_filename = "prog.st" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r1i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 dd5914128e..6dfa3a2de3 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 @@ -12,7 +12,7 @@ source_filename = "prog.st" @prog_instance = global %prog { i16 5 }, section "var-$RUSTY$prog_instance:r1i16" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 ret void 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 72d74b90c3..51004c059e 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 @@ -16,7 +16,7 @@ source_filename = "fb.st" @__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r1e3i32" -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { +define void @fb(%fb* %0) { entry: %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 ret void @@ -31,7 +31,7 @@ source_filename = "myStruct.st" @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r1r1e3i32" @__fb__init = external global %fb.2, section "var-$RUSTY$__fb__init:r1e3i32" -declare void @fb(%fb.2*) section "fn-$RUSTY$fb:v" +declare void @fb(%fb.2*) ; ModuleID = 'fb2.st' source_filename = "fb2.st" @@ -44,13 +44,13 @@ source_filename = "fb2.st" @__myStruct__init = external global %myStruct.4, section "var-$RUSTY$__myStruct__init:r1r1e3i32" @__fb__init = external global %fb.5, section "var-$RUSTY$__fb__init:r1e3i32" -define void @fb2(%fb2* %0) section "fn-$RUSTY$fb2:v" { +define void @fb2(%fb2* %0) { entry: %x = getelementptr inbounds %fb2, %fb2* %0, i32 0, i32 0 ret void } -declare void @fb(%fb.5*) section "fn-$RUSTY$fb:v" +declare void @fb(%fb.5*) ; ModuleID = 'fb3.st' source_filename = "fb3.st" @@ -59,7 +59,7 @@ source_filename = "fb3.st" @__fb3__init = unnamed_addr constant %fb3 zeroinitializer, section "var-$RUSTY$__fb3__init:r0" -define void @fb3(%fb3* %0) section "fn-$RUSTY$fb3:v" { +define void @fb3(%fb3* %0) { entry: ret void } 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 f0db85384b..9ae4bf78e2 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 @@ -5,7 +5,7 @@ expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" ; ModuleID = 'func.st' source_filename = "func.st" -define i32 @func() section "fn-$RUSTY$func:i32" { +define i32 @func() { entry: %func = alloca i32, align 4 store i32 0, i32* %func, align 4 @@ -20,7 +20,7 @@ source_filename = "fb.st" @__fb__init = unnamed_addr constant %fb zeroinitializer, section "var-$RUSTY$__fb__init:r0" -define void @fb(%fb* %0) section "fn-$RUSTY$fb:v" { +define void @fb(%fb* %0) { entry: ret void } @@ -32,7 +32,7 @@ source_filename = "prg.st" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 ret void @@ -45,7 +45,7 @@ source_filename = "prg2.st" @prg2_instance = global %prg2 zeroinitializer, section "var-$RUSTY$prg2_instance:r1i32" -define void @prg2(%prg2* %0) section "fn-$RUSTY$prg2:v" { +define void @prg2(%prg2* %0) { entry: %b = getelementptr inbounds %prg2, %prg2* %0, i32 0, i32 0 ret void @@ -64,7 +64,7 @@ source_filename = "prog.st" @prg_instance = external global %prg.5, section "var-$RUSTY$prg_instance:r1i32" @prg2_instance = external global %prg2.6, section "var-$RUSTY$prg2_instance:r1i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %myFb = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %load_a = load i32, i32* getelementptr inbounds (%prg.5, %prg.5* @prg_instance, i32 0, i32 0), align 4 @@ -74,10 +74,10 @@ entry: ret void } -declare void @fb(%fb.4*) section "fn-$RUSTY$fb:v" +declare void @fb(%fb.4*) -declare void @prg(%prg.5*) section "fn-$RUSTY$prg:v" +declare void @prg(%prg.5*) -declare void @prg2(%prg2.6*) section "fn-$RUSTY$prg2:v" +declare void @prg2(%prg2.6*) -declare i32 @func() section "fn-$RUSTY$func:i32" +declare i32 @func() 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 1bc2997856..eee300dccd 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 @@ -26,7 +26,7 @@ source_filename = "prog.st" @c = external global i32, section "var-$RUSTY$c:i32" @x = external global i32, section "var-$RUSTY$x:i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: store i32 7, i32* @x, align 4 ret void 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 722b4754f8..341f2a0715 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 @@ -28,7 +28,7 @@ source_filename = "prog.st" @__myStruct2__init = external global %myStruct2.3, section "var-$RUSTY$__myStruct2__init:r2i32i16" @__prog.x__init = unnamed_addr constant %myStruct.2 { i32 5, i16 2 } -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v" { +define void @prog(%prog* %0) { entry: %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %y = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 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 c9a5612cc4..282bc52aff 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 @@ -11,14 +11,14 @@ source_filename = "main" @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r2i32i32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1r2i32i32" -define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[i32][i32]" { +define void @fb_t(%fb_t* %0) { entry: %in1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %in2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 0 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 21a90da4c6..2d924e0979 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 @@ -11,14 +11,14 @@ source_filename = "main" @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r2i32i32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2r2i32i32i32" -define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[i32][i32]" { +define void @fb_t(%fb_t* %0) { entry: %out1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %out2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 c09ca8415a..fdb1ce656c 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @foo(i32 %0, i32 %1) section "fn-$RUSTY$foo:v[i32][i32]" { +define void @foo(i32 %0, i32 %1) { entry: %in1 = alloca i32, align 4 store i32 %0, i32* %in1, align 4 @@ -18,7 +18,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %1 = alloca i32, align 4 %2 = load i32, i32* %1, align 4 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 77bd210568..2d2b9d0261 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define void @foo(i32* %0, i32* %1) section "fn-$RUSTY$foo:v[pi32][pi32]" { +define void @foo(i32* %0, i32* %1) { entry: %out1 = alloca i32*, align 8 store i32* %0, i32** %out1, align 8 @@ -18,7 +18,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca i32, align 4 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 7f1397cbf1..6c61d9e44a 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 1ab6960d56..df36607694 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) section "fn-$RUSTY$foo:i32[i32][pi32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -25,7 +25,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 ce8d64e4d1..15540713ce 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 1f61d44c22..e32921f8a0 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 4d4a407879..d35debbb1f 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 ef1bc54697..b3d46dee52 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 ce8d64e4d1..15540713ce 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 1f61d44c22..e32921f8a0 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 81994a1570..cc66654ccc 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 4d4a407879..d35debbb1f 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 ef1bc54697..b3d46dee52 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 @@ -9,7 +9,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define i32 @foo(i32 %0, i32* %1, i32* %2) section "fn-$RUSTY$foo:i32[i32][pi32][pi32]" { +define i32 @foo(i32 %0, i32* %1, i32* %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 @@ -23,7 +23,7 @@ entry: ret i32 %foo_ret } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 997d928597..dafc7683a7 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 @@ -11,7 +11,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2r2u8u8pr2u8u8" @__file_t__init = unnamed_addr constant %file_t zeroinitializer, section "var-$RUSTY$__file_t__init:r2u8u8" -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %file = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %FileOpen = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -23,7 +23,7 @@ entry: ret void } -define void @file_t(%file_t* %0) section "fn-$RUSTY$file_t:v[u8][u8]" { +define void @file_t(%file_t* %0) { entry: %var1 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 0 %var2 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 1 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 461ca281a0..a86a28098e 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 @@ -11,14 +11,14 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2i32i32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r0" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32]" { +define void @prog(%prog* %0) { entry: %in1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %in2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: store i32 1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 call void @prog(%prog* @prog_instance) 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 72fae89445..c0a78e0385 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r2i32i32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32]" { +define void @prog(%prog* %0) { entry: %out1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %out2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -20,7 +20,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 call void @prog(%prog* @prog_instance) 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 d4904984ee..f21ba03119 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 aadcc395cc..d561708021 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 633ef5775a..ed4d73b7bb 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 7b3e689396..bd6e439f6e 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 296ca297db..aa60147529 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 @@ -11,7 +11,7 @@ source_filename = "main" @prog_instance = global %prog zeroinitializer, section "var-$RUSTY$prog_instance:r3i32i32pi32" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r3i32i32i32" -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[i32][i32][pi32]" { +define void @prog(%prog* %0) { entry: %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -19,7 +19,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 56d71b38e2..21a5fa901d 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 @@ -11,7 +11,7 @@ source_filename = "main" @mainProg_instance = global %mainProg zeroinitializer, section "var-$RUSTY$mainProg_instance:r3r5u8u8pu8u8pu8u8u8" @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer, section "var-$RUSTY$__fb_t__init:r5u8u8pu8u8pu8" -define void @mainProg(%mainProg* %0) section "fn-$RUSTY$mainProg:v" { +define void @mainProg(%mainProg* %0) { entry: %fb = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 %out1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 1 @@ -35,7 +35,7 @@ entry: ret void } -define void @fb_t(%fb_t* %0) section "fn-$RUSTY$fb_t:v[u8][pu8][u8][pu8]" { +define void @fb_t(%fb_t* %0) { entry: %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 @@ -45,7 +45,7 @@ entry: ret void } -define void @fb_t.foo(%fb_t* %0) section "fn-$RUSTY$fb_t.foo:v" { +define void @fb_t.foo(%fb_t* %0) { entry: %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 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 e9e2500aab..8790b18918 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 867df6704b..c7ec8c94bd 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8u32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b3afe4628d..e76606f12c 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u32u64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap index 1f93b11da8..a43cc06728 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap @@ -5,7 +5,7 @@ expression: result ; ModuleID = 'main' source_filename = "main" -define i32 @fn() section "fn-$RUSTY$fn:i32" { +define i32 @fn() { entry: %fn = alloca i32, align 4 %a = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap index 8932121af1..0bb3d3dc9b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap @@ -5,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-$RUSTY$CONCAT:s8u1025[s8u1025][s8u1025]" +declare void @CONCAT([1025 x i8]*, i8*, i8*) -define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-$RUSTY$LIST_ADD:u8[s8u1001][s8u2]" { +define i8 @LIST_ADD(i8* %0, i8* %1) { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap index 8932121af1..0bb3d3dc9b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap @@ -5,9 +5,9 @@ expression: result ; ModuleID = 'main' source_filename = "main" -declare void @CONCAT([1025 x i8]*, i8*, i8*) section "fn-$RUSTY$CONCAT:s8u1025[s8u1025][s8u1025]" +declare void @CONCAT([1025 x i8]*, i8*, i8*) -define i8 @LIST_ADD(i8* %0, i8* %1) section "fn-$RUSTY$LIST_ADD:u8[s8u1001][s8u2]" { +define i8 @LIST_ADD(i8* %0, i8* %1) { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 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 2169794163..6bea409913 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8u64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 ff8e6e1eff..544b3f2ee3 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r4u8u8i16i16" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 52722c634f..6c0aecb5bb 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u16u32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 9acdab89c7..9a02c15a42 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 @@ -11,7 +11,7 @@ source_filename = "main" @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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 29fa2da807..07e5da47e8 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2s8u61s8u81" @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-$RUSTY$MID__STRING:s8u81[ps8u81][i32][i32]" { +define void @MID__STRING([81 x i8]* %0, i8* %1, i32 %2, i32 %3) { entry: %MID__STRING = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %MID__STRING, align 8 @@ -29,7 +29,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v[s8u61][s8u81]" { +define void @main(%main* %0) { entry: %fmt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 bdc1540913..156e3a85c5 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" -define void @ret([81 x i8]* %0) section "fn-$RUSTY$ret:s8u81" { +define void @ret([81 x i8]* %0) { entry: %ret = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %ret, align 8 @@ -23,7 +23,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 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 385f0cc470..447a4cacd7 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 @@ -10,7 +10,7 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1s8u81" @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-$RUSTY$read_string:s8u81[s8u81]" { +define void @read_string([81 x i8]* %0, i8* %1) { entry: %read_string = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %read_string, align 8 @@ -28,7 +28,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %text1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index 9e9c351040..9b47ad7713 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -10,7 +10,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"#\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"*\00" -define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 3968ed4306..c426a7e6f9 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 @@ -13,7 +13,7 @@ source_filename = "main" @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] -define void @prog(%prog* %0) section "fn-$RUSTY$prog:v[s8u81][s16u81]" { +define void @prog(%prog* %0) { entry: %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 %output2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 @@ -24,7 +24,7 @@ entry: ret void } -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 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 3f2af07b08..4177ffbf84 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 @@ -13,7 +13,7 @@ source_filename = "main" @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] @utf16_literal_1 = 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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 73237fe8e0..1d81a623ce 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 @@ -14,7 +14,7 @@ source_filename = "main" @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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 763d82a4f8..0dd6faf2ea 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 @@ -11,7 +11,7 @@ source_filename = "main" @__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" -define i16 @foo(i8* %0) section "fn-$RUSTY$foo:i16[s8u81]" { +define i16 @foo(i8* %0) { entry: %foo = alloca i16, align 2 %s = alloca [81 x i8], align 1 @@ -27,7 +27,7 @@ buffer_block: ; No predecessors! ret i16 %foo_ret1 } -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index b12538dbe8..d764709e84 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -8,7 +8,7 @@ source_filename = "main" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[ps8u1025][ps8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca i8*, align 8 @@ -20,7 +20,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index e9582efb1b..f2ce23655c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -8,7 +8,7 @@ source_filename = "main" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) section "fn-$RUSTY$STRING_EQUAL:u8[s8u1025][s8u1025]" { +define i8 @STRING_EQUAL(i8* %0, i8* %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 @@ -24,7 +24,7 @@ entry: ret i8 %STRING_EQUAL_ret } -define i64 @FSTRING_TO_DT() section "fn-$RUSTY$FSTRING_TO_DT:i64" { +define i64 @FSTRING_TO_DT() { entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 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 f8a29a88a0..a41d323c51 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 @@ -13,7 +13,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a 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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 c66d927edb..28eac9349c 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 @@ -15,7 +15,7 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a 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] -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 160ce6ed30..707bb288eb 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 @@ -10,7 +10,7 @@ source_filename = "main" @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-$RUSTY$prg_instance:r2s8u16s8u31" @__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-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 b18d8db47c..aecb9e0e38 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 @@ -10,7 +10,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u16s8u31" @__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-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %y = alloca [16 x i8], align 1 %z = alloca [31 x i8], align 1 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 c5e96b18bd..1638c77dc5 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 aeb30559df..431287aeef 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i32i64i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 9217183a40..048f2f7404 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 be13838b66..0473fd1bb3 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i8i8i8" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 3645170b4a..9b387f7a0b 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32f64f64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 1cc04585f9..680d0b8b6c 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16u16f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 6f9cd627e6..4935ec8be5 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32f64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a0d78252fe..a603210500 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3i16u16f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 41368ecbee..3ac57cab3f 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2u8i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 5e02bd0f58..14f644db1f 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2f32i64" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 abcb8aca8a..2d31b10a5b 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3f32i16f32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 a6c9934fbf..220d47bef7 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 @@ -10,9 +10,9 @@ source_filename = "main" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4s8u81f32f64i16" @__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-$RUSTY$printf:i32[ps8u81]" +declare i32 @printf(i8*, ...) -define void @main(%main* %0) section "fn-$RUSTY$main:v" { +define void @main(%main* %0) { entry: %s = alloca [81 x i8], align 1 %float = alloca float, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap index 367285edf7..a55eb0255d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap @@ -8,9 +8,9 @@ source_filename = "main" @utf08_literal_0 = private unnamed_addr constant [26 x i8] c"(d) result : %d %d %d %u\0A\00" @utf08_literal_1 = private unnamed_addr constant [27 x i8] c"(hd) result : %hd %hd %hd\0A\00" -declare i32 @printf(i8*, ...) section "fn-$RUSTY$printf:i32[ps8u81]" +declare i32 @printf(i8*, ...) -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %out1 = alloca i16, align 2 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 f7c53cabc4..8d413cb6dd 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 @@ -9,7 +9,7 @@ source_filename = "main" @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r3u8i32i32" -define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { +define void @prg(%prg* %0) { entry: %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 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 7517e8f819..6bb562ea4a 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 @@ -9,7 +9,7 @@ source_filename = "main" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -57,7 +57,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [60 x i16], align 2 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 188e363617..f3b4e513f7 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 @@ -10,7 +10,7 @@ source_filename = "main" @arr = global [2 x i16] zeroinitializer, section "var-$RUSTY$arr:ai16" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -32,7 +32,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 store i32 0, i32* %main, align 4 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 d7cf5af6d3..fbcaa3173b 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 @@ -9,7 +9,7 @@ source_filename = "main" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define void @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:v[r2pai16ai32]" { +define void @foo(%__foo_vla* %0) { entry: %vla = alloca %__foo_vla, align 8 %1 = bitcast %__foo_vla* %vla to i8* @@ -18,7 +18,7 @@ entry: ret void } -define void @bar() section "fn-$RUSTY$bar:v" { +define void @bar() { entry: %arr = alloca [2 x i16], align 2 %0 = bitcast [2 x i16]* %arr to i8* 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 2d4e774ca8..af4bf4a202 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 @@ -9,7 +9,7 @@ source_filename = "main" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -57,7 +57,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [20 x i16], align 2 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 8ec1aaee73..f65402c222 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 @@ -9,7 +9,7 @@ source_filename = "main" @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer, section "var-$RUSTY$____foo_vla__init:r2pai16ai32" -define i16 @foo(%__foo_vla* %0) section "fn-$RUSTY$foo:i16[r2pai16ai32]" { +define i16 @foo(%__foo_vla* %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 @@ -32,7 +32,7 @@ entry: ret i16 %foo_ret } -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index e5a95bcc6b..fc7d17d094 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -73,7 +73,7 @@ fn assigning_full_arrays() { @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-$RUSTY$prg_instance:r2ai32ai32" @__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-$RUSTY$__Data__init:ai32" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -126,7 +126,7 @@ fn accessing_array_elements() { @__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-$RUSTY$__Data__init:ai32" @__prg.b__init = unnamed_addr constant [3 x i32] [i32 3, i32 4, i32 5] - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/enum_adr.rs b/src/tests/adr/enum_adr.rs index aa7af6da0f..5a50faea61 100644 --- a/src/tests/adr/enum_adr.rs +++ b/src/tests/adr/enum_adr.rs @@ -129,7 +129,7 @@ fn using_enums() { @Door.open = unnamed_addr constant i32 8, section "var-$RUSTY$open:e2i32" @Door.closed = unnamed_addr constant i32 16, section "var-$RUSTY$closed:e2i32" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index 2fbde24ad6..41bd65b40f 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -235,7 +235,7 @@ fn codegen_of_a_program_pou() { @main_prg_instance = global %main_prg zeroinitializer, section "var-$RUSTY$main_prg_instance:r5i16pi16i16i16i16" - define void @main_prg(%main_prg* %0) section "fn-$RUSTY$main_prg:v[i16][pi16][i16]" { + define void @main_prg(%main_prg* %0) { entry: %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 @@ -273,7 +273,7 @@ fn calling_a_program() { @main_prg_instance = global %main_prg zeroinitializer, section "var-$RUSTY$main_prg_instance:r5i16pi16i16i16i16" - define i16 @foo() section "fn-$RUSTY$foo:i16" { + define i16 @foo() { entry: %foo = alloca i16, align 2 %x = alloca i16, align 2 @@ -290,7 +290,7 @@ fn calling_a_program() { ret i16 %foo_ret } - define void @main_prg(%main_prg* %0) section "fn-$RUSTY$main_prg:v[i16][pi16][i16]" { + define void @main_prg(%main_prg* %0) { entry: %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 @@ -337,7 +337,7 @@ fn function_blocks_get_a_method_with_a_self_parameter() { @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-$RUSTY$__main_fb__init:r5i16pi16i16i16i16" - define void @main_fb(%main_fb* %0) section "fn-$RUSTY$main_fb:v[i16][pi16][i16]" { + define void @main_fb(%main_fb* %0) { entry: %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 @@ -378,7 +378,7 @@ fn calling_a_function_block() { @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } }, section "var-$RUSTY$foo_instance:r3i16i16r5i16pi16i16i16i16" @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 }, section "var-$RUSTY$__main_fb__init:r5i16pi16i16i16i16" - define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" { + define void @foo(%foo* %0) { entry: %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 @@ -394,7 +394,7 @@ fn calling_a_function_block() { ret void } - define void @main_fb(%main_fb* %0) section "fn-$RUSTY$main_fb:v[i16][pi16][i16]" { + define void @main_fb(%main_fb* %0) { entry: %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 @@ -431,7 +431,7 @@ fn function_get_a_method_with_by_ref_parameters() { ; ModuleID = 'main' source_filename = "main" - define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$main_fun:i32[i16][pi8][pi64]" { + define i32 @main_fun(i16 %0, i8* %1, i64* %2) { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 @@ -477,7 +477,7 @@ fn calling_a_function() { @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2i16i8" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -487,7 +487,7 @@ fn calling_a_function() { ret void } - define i32 @main_fun(i16 %0, i8* %1, i64* %2) section "fn-$RUSTY$main_fun:i32[i16][pi8][pi64]" { + define i32 @main_fun(i16 %0, i8* %1, i64* %2) { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 @@ -540,7 +540,7 @@ fn return_a_complex_type_from_function() { @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r1s8u81" @utf08_literal_0 = private unnamed_addr constant [13 x i8] c"hello world!\00" - define void @foo([81 x i8]* %0) section "fn-$RUSTY$foo:s8u81" { + define void @foo([81 x i8]* %0) { entry: %foo = alloca [81 x i8]*, align 8 store [81 x i8]* %0, [81 x i8]** %foo, align 8 @@ -553,7 +553,7 @@ fn return_a_complex_type_from_function() { ret void } - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 @@ -623,7 +623,7 @@ fn passing_aggregate_types_to_functions_by_value() { @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, section "var-$RUSTY$__myStruct__init:r4i32i32i32s8u81" @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r4s8u81s16u81ai32r4i32i32i32s8u81" - define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) section "fn-$RUSTY$foo:v[s8u81][s16u81][ai32][r4i32i32i32s8u81]" { + define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) { entry: %s = alloca [81 x i8], align 1 %bitcast = bitcast [81 x i8]* %s to i8* @@ -648,7 +648,7 @@ fn passing_aggregate_types_to_functions_by_value() { ret void } - define void @main(%main* %0) section "fn-$RUSTY$main:v" { + define void @main(%main* %0) { entry: %string1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %string2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 @@ -707,7 +707,7 @@ fn passing_by_ref_to_functions() { @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2s8u81s8u81" - define i8 @StrEqual(i8* %0, i8* %1) section "fn-$RUSTY$StrEqual:u8[ps8u81][ps8u81]" { + define i8 @StrEqual(i8* %0, i8* %1) { entry: %StrEqual = alloca i8, align 1 %o1 = alloca i8*, align 8 @@ -719,7 +719,7 @@ fn passing_by_ref_to_functions() { ret i8 %StrEqual_ret } - define void @main(%main* %0) section "fn-$RUSTY$main:v" { + define void @main(%main* %0) { entry: %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 %str2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index 33dc2b22d2..f1581eab53 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -70,7 +70,7 @@ fn assigning_strings() { @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2s8u11s8u11" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -113,7 +113,7 @@ fn assigning_string_literals() { @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" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index 23f2b550bf..6132912825 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -103,7 +103,7 @@ fn initializing_a_struct() { @__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 } } - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -146,7 +146,7 @@ fn assigning_structs() { @prg_instance = global %prg zeroinitializer, section "var-$RUSTY$prg_instance:r2r2i16i16r2i16i16" @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %p1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %p2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 @@ -204,7 +204,7 @@ fn accessing_struct_members() { @__Rect__init = unnamed_addr constant %Rect zeroinitializer, section "var-$RUSTY$__Rect__init:r2r2i16i16r2i16i16" @__Point__init = unnamed_addr constant %Point zeroinitializer, section "var-$RUSTY$__Point__init:r2i16i16" - define void @prg(%prg* %0) section "fn-$RUSTY$prg:v" { + define void @prg(%prg* %0) { entry: %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index 38d3a8eb83..80f6ffd3f0 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -318,7 +318,7 @@ fn pass() { @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @main() section "fn-$RUSTY$main:i32" { + define i32 @main() { entry: %main = alloca i32, align 4 %local = alloca [6 x i32], align 4 @@ -340,7 +340,7 @@ fn pass() { ret i32 %main_ret } - define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -384,7 +384,7 @@ fn access() { @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 @@ -442,7 +442,7 @@ fn multi_dimensional() { @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer, section "var-$RUSTY$____foo_arr__init:r2pai32ai32" - define i32 @foo(%__foo_arr* %0) section "fn-$RUSTY$foo:i32[pr2pai32ai32]" { + define i32 @foo(%__foo_arr* %0) { entry: %foo = alloca i32, align 4 %arr = alloca %__foo_arr*, align 8 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 b12c6d93a5..a6b35ef8f2 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r2i32i32", !dbg !0 -define void @main(%main* %0) section "fn-$RUSTY$main:v" !dbg !12 { +define void @main(%main* %0) !dbg !12 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !17 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !18 @@ -17,7 +17,7 @@ entry: ret void, !dbg !20 } -define void @main.newAction(%main* %0) section "fn-$RUSTY$main.newAction:v" !dbg !21 { +define void @main.newAction(%main* %0) !dbg !21 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !22 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !23 @@ -28,7 +28,7 @@ entry: ret void, !dbg !22 } -define void @main.newAction2(%main* %0) section "fn-$RUSTY$main.newAction2:v" !dbg !24 { +define void @main.newAction2(%main* %0) !dbg !24 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !25 %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !26 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 f9950133be..02f401d831 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap index 25a2211efc..7bca5852a2 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @foo(i32 %0) section "fn-$RUSTY$foo:i32[i32]" !dbg !4 { +define i32 @foo(i32 %0) !dbg !4 { entry: %foo = alloca i32, align 4, !dbg !9 %val = alloca i32, align 4, !dbg !9 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 1ecce88ccf..4857a76a80 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 @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @__conditional_return__init = constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ; Function Attrs: argmemonly nofree nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 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 46dee4354a..8e66efb9af 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 @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @__conditional_return__init = constant %conditional_return zeroinitializer, section "var-$RUSTY$__conditional_return__init:r1i32" -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 @@ -29,7 +29,7 @@ entry: ; Function Attrs: argmemonly nofree nounwind willreturn declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) section "fn-$RUSTY$conditional_return:v[i32]" { +define void @conditional_return(%conditional_return* %0) { entry: %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 %load_val = load i32, i32* %val, align 4 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 ea666e9a67..d984cc6b0d 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @foo_instance = global %foo zeroinitializer, section "var-$RUSTY$foo_instance:r1i32", !dbg !0 -define void @foo(%foo* %0) section "fn-$RUSTY$foo:v" !dbg !11 { +define void @foo(%foo* %0) !dbg !11 { entry: call void @llvm.dbg.declare(metadata %foo* %0, metadata !15, metadata !DIExpression()), !dbg !16 %val = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0, !dbg !17 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap index fd0716b3fc..ebd0076c90 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap index 9e3f4c97b9..1bd4633480 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 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 79be9a600a..ad52f2fa78 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 @@ -6,7 +6,7 @@ expression: output_file_content_without_headers @main_instance = global %main zeroinitializer, section "var-$RUSTY$main_instance:r1i32", !dbg !0 -define void @main(%main* %0) section "fn-$RUSTY$main:v" !dbg !11 { +define void @main(%main* %0) !dbg !11 { entry: call void @llvm.dbg.declare(metadata %main* %0, metadata !15, metadata !DIExpression()), !dbg !16 %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0, !dbg !17 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap index 1dcbe82b60..6a9c900a13 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap @@ -2,7 +2,7 @@ source: tests/integration/cfc.rs expression: output_file_content_without_headers --- -define i32 @main() section "fn-$RUSTY$main:i32" { +define i32 @main() { entry: %main = alloca i32, align 4 %value = alloca i32, align 4 @@ -15,7 +15,7 @@ entry: ret i32 %main_ret } -define i32 @myAdd(i32 %0, i32 %1) section "fn-$RUSTY$myAdd:i32[i32][i32]" { +define i32 @myAdd(i32 %0, i32 %1) { entry: %myAdd = alloca i32, align 4 %a = alloca i32, align 4 @@ -31,7 +31,7 @@ entry: ret i32 %myAdd_ret } -define i32 @myConnection(i32 %0) section "fn-$RUSTY$myConnection:i32[i32]" { +define i32 @myConnection(i32 %0) { entry: %myConnection = alloca i32, align 4 %x = alloca i32, align 4 diff --git a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap index 7d5863d39d..e4e3c4a811 100644 --- a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap +++ b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap @@ -2,4 +2,4 @@ source: tests/integration/command_line_compile.rs expression: content --- -define i32 @myFunc(i32 %0, i32 %1, i32 %2) section "fn-$RUSTY$myFunc:i32[i32][i32][i32]" {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, i32* %a, align 4 %b = alloca i32, align 4 store i32 %1, i32* %b, align 4 %c = alloca i32, align 4 store i32 %2, i32* %c, align 4 store i32 0, i32* %myFunc, align 4 %myFunc_ret = load i32, i32* %myFunc, align 4 ret i32 %myFunc_ret} +define i32 @myFunc(i32 %0, i32 %1, i32 %2) {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, i32* %a, align 4 %b = alloca i32, align 4 store i32 %1, i32* %b, align 4 %c = alloca i32, align 4 store i32 %2, i32* %c, align 4 store i32 0, i32* %myFunc, align 4 %myFunc_ret = load i32, i32* %myFunc, align 4 ret i32 %myFunc_ret} From 3382d2673a0c2a41506795a4dcb24c1e1a6e5b47 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Wed, 12 Jun 2024 16:50:01 +0200 Subject: [PATCH 40/40] cli: Make --got-layout-file override the default GOT layout file location --- compiler/plc_driver/src/cli.rs | 18 +++++++++++------ compiler/plc_driver/src/lib.rs | 10 +++++----- compiler/plc_driver/src/pipelines.rs | 15 ++++---------- src/codegen.rs | 21 ++++++++++++++------ src/codegen/generators/variable_generator.rs | 9 ++++++++- src/lib.rs | 2 ++ 6 files changed, 46 insertions(+), 29 deletions(-) diff --git a/compiler/plc_driver/src/cli.rs b/compiler/plc_driver/src/cli.rs index 960b88fb87..63ae99640e 100644 --- a/compiler/plc_driver/src/cli.rs +++ b/compiler/plc_driver/src/cli.rs @@ -5,7 +5,8 @@ use encoding_rs::Encoding; use plc_diagnostics::diagnostics::{diagnostics_registry::DiagnosticsConfiguration, Diagnostic}; use std::{env, ffi::OsStr, num::ParseIntError, path::PathBuf}; -use plc::{output::FormatOption, ConfigFormat, DebugLevel, ErrorFormat, Target, Threads}; +use plc::output::FormatOption; +use plc::{ConfigFormat, DebugLevel, ErrorFormat, Target, Threads, DEFAULT_GOT_LAYOUT_FILE}; pub type ParameterError = clap::Error; @@ -116,9 +117,12 @@ pub struct CompileParameters { Save information about the generated custom GOT layout to the given file. Format is detected by extension. Supported formats : json, toml", - parse(try_from_str = validate_config) + default_value = DEFAULT_GOT_LAYOUT_FILE, + parse(try_from_str = validate_config), + // FIXME: For some reason, this does not work at the moment but it really should + // requires = "online_change" ) ] - pub got_layout_file: Option, + pub got_layout_file: String, #[clap( name = "optimization", @@ -335,7 +339,8 @@ pub fn get_config_format(name: &str) -> Option { impl CompileParameters { pub fn parse + AsRef>(args: &[T]) -> Result { CompileParameters::try_parse_from(args).and_then(|mut result| { - result.got_layout_file = Some(String::from("tmp.json")); + result.got_layout_file = String::from("tmp.json"); + result.online_change = true; if result.sysroot.len() > result.target.len() { let mut cmd = CompileParameters::command(); @@ -407,8 +412,9 @@ impl CompileParameters { self.hardware_config.as_deref().and_then(get_config_format) } - pub fn got_layout_format(&self) -> Option { - self.got_layout_file.as_deref().and_then(get_config_format) + pub fn got_layout_format(&self) -> ConfigFormat { + // It is safe to unwrap here, since the provided argument to `--got-online-change` has been checked with `validate_config` + get_config_format(&self.got_layout_file).unwrap() } /// Returns the location where the build artifacts should be stored / output diff --git a/compiler/plc_driver/src/lib.rs b/compiler/plc_driver/src/lib.rs index 67460c6052..77b5d1ce68 100644 --- a/compiler/plc_driver/src/lib.rs +++ b/compiler/plc_driver/src/lib.rs @@ -20,7 +20,7 @@ use cli::{CompileParameters, ParameterError, SubCommands}; use pipelines::AnnotatedProject; use plc::{ codegen::CodegenContext, linker::LinkerType, output::FormatOption, ConfigFormat, DebugLevel, ErrorFormat, - OnlineChange, OptimizationLevel, Target, Threads, + OnlineChange, OptimizationLevel, Target, Threads, DEFAULT_GOT_LAYOUT_FILE, }; use plc_diagnostics::{diagnostician::Diagnostician, diagnostics::Diagnostic}; @@ -50,8 +50,8 @@ pub struct CompileOptions { /// The name of the resulting compiled file pub output: String, pub output_format: FormatOption, - pub got_layout_file: Option, - pub got_layout_format: Option, + pub got_layout_file: String, + pub got_layout_format: ConfigFormat, pub optimization: OptimizationLevel, pub error_format: ErrorFormat, pub debug_level: DebugLevel, @@ -66,8 +66,8 @@ impl Default for CompileOptions { build_location: None, output: String::new(), output_format: Default::default(), - got_layout_file: None, - got_layout_format: None, + got_layout_file: String::from(DEFAULT_GOT_LAYOUT_FILE), + got_layout_format: ConfigFormat::JSON, optimization: OptimizationLevel::None, error_format: ErrorFormat::None, debug_level: DebugLevel::None, diff --git a/compiler/plc_driver/src/pipelines.rs b/compiler/plc_driver/src/pipelines.rs index 80dd6c7766..6a4793e548 100644 --- a/compiler/plc_driver/src/pipelines.rs +++ b/compiler/plc_driver/src/pipelines.rs @@ -321,13 +321,13 @@ impl AnnotatedProject { unit: &CompilationUnit, dependencies: &FxIndexSet, literals: &StringLiterals, - got_layout: &Mutex>>, + got_layout: &Mutex>, ) -> Result, Diagnostic> { let mut code_generator = plc::codegen::CodeGen::new( context, compile_options.root.as_deref(), &unit.file_name, - compile_options.got_layout_file.clone().zip(compile_options.got_layout_format), + (compile_options.got_layout_file.clone(), compile_options.got_layout_format), compile_options.optimization, compile_options.debug_level, compile_options.online_change, @@ -388,12 +388,7 @@ impl AnnotatedProject { ensure_compile_dirs(targets, &compile_directory)?; let targets = if targets.is_empty() { &[Target::System] } else { targets }; - let got_layout = compile_options - .got_layout_file - .as_ref() - .map(|path| read_got_layout(path, ConfigFormat::JSON)) - .transpose()?; - + let got_layout = read_got_layout(&compile_options.got_layout_file, ConfigFormat::JSON)?; let got_layout = Mutex::new(got_layout); let res = targets @@ -456,9 +451,7 @@ impl AnnotatedProject { }) .collect::, Diagnostic>>()?; - compile_options.got_layout_file.as_ref().map(|path| { - write_got_layout(got_layout.into_inner().unwrap().unwrap(), path, ConfigFormat::JSON) - }); + write_got_layout(got_layout.into_inner().unwrap(), &compile_options.got_layout_file, ConfigFormat::JSON)?; Ok(res) } diff --git a/src/codegen.rs b/src/codegen.rs index 5000bad2fe..2636ffaee8 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -78,7 +78,7 @@ pub struct CodeGen<'ink> { /// Whether we are generating a hot-reloadable binary or not pub online_change: OnlineChange, - pub got_layout_file: Option<(String, ConfigFormat)>, + pub got_layout_file: (String, ConfigFormat), pub module_location: String, } @@ -97,7 +97,7 @@ impl<'ink> CodeGen<'ink> { context: &'ink CodegenContext, root: Option<&Path>, module_location: &str, - got_layout_file: Option<(String, ConfigFormat)>, + got_layout_file: (String, ConfigFormat), optimization_level: OptimizationLevel, debug_level: DebugLevel, online_change: OnlineChange, @@ -121,7 +121,7 @@ impl<'ink> CodeGen<'ink> { literals: &StringLiterals, dependencies: &FxIndexSet, global_index: &Index, - got_layout: &Mutex>>, + got_layout: &Mutex>, ) -> Result, Diagnostic> { let llvm = Llvm::new(context, context.create_builder()); let mut index = LlvmTypedIndex::default(); @@ -135,8 +135,14 @@ impl<'ink> CodeGen<'ink> { )?; index.merge(llvm_type_index); - let mut variable_generator = - VariableGenerator::new(&self.module, &llvm, global_index, annotations, &index, &mut self.debug); + let mut variable_generator = VariableGenerator::new( + &self.module, + &llvm, + global_index, + annotations, + &index, + &mut self.debug, + ); //Generate global variables let llvm_gv_index = @@ -175,7 +181,10 @@ impl<'ink> CodeGen<'ink> { acc }); - if let Some(got_entries) = &mut *got_layout.lock().unwrap() { + + if self.online_change == OnlineChange::Enabled { + let got_entries = &mut *got_layout.lock().unwrap(); + let mut new_symbols = Vec::new(); let mut new_got_entries = HashMap::new(); let mut new_got = HashMap::new(); diff --git a/src/codegen/generators/variable_generator.rs b/src/codegen/generators/variable_generator.rs index f963689de8..6f156e5e1f 100644 --- a/src/codegen/generators/variable_generator.rs +++ b/src/codegen/generators/variable_generator.rs @@ -38,7 +38,14 @@ impl<'ctx, 'b> VariableGenerator<'ctx, 'b> { types_index: &'b LlvmTypedIndex<'ctx>, debug: &'b mut DebugBuilderEnum<'ctx>, ) -> Self { - VariableGenerator { module, llvm, global_index, annotations, types_index, debug } + VariableGenerator { + module, + llvm, + global_index, + annotations, + types_index, + debug, + } } pub fn generate_global_variables( diff --git a/src/lib.rs b/src/lib.rs index 715c1639b1..468eb0baea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -143,6 +143,8 @@ impl FromStr for ConfigFormat { } } +pub const DEFAULT_GOT_LAYOUT_FILE: &str = "online_change_got.json"; + #[derive(Debug, Copy, Clone, PartialEq, Eq, ArgEnum, Serialize, Deserialize, Default)] pub enum ErrorFormat { #[default]