Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'volsa/lit' of https://github.com/plc-lang/rusty into vo…
Browse files Browse the repository at this point in the history
…lsa/lit
volsa committed Jun 17, 2024
2 parents 7828d7e + 450e278 commit 44ef766
Showing 426 changed files with 1,626 additions and 1,374 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions compiler/section_mangler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@ version = "0.0.1"
edition = "2021"

[dependencies]
nom = "7.1"
21 changes: 19 additions & 2 deletions compiler/section_mangler/src/lib.rs
Original file line number Diff line number Diff line change
@@ -44,20 +44,25 @@
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
#[derive(Debug, PartialEq, Clone)]
pub enum SectionMangler {
Function(FunctionMangler),
Variable(VariableMangler),
}

#[derive(Debug, PartialEq, Clone)]
pub struct FunctionMangler {
name: String,
parameters: Vec<FunctionArgument>,
return_type: Option<Type>,
}

#[derive(Debug, PartialEq, Clone)]
pub struct VariableMangler {
name: String,
ty: Type,
@@ -72,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) => {
@@ -113,6 +125,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, Clone)]
pub enum FunctionArgument {
ByValue(Type),
ByRef(Type),
@@ -129,6 +142,7 @@ impl fmt::Display for FunctionArgument {
}

// TODO: Do we have to encode this? Does that affect ABI? Probably
#[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`
@@ -148,6 +162,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, Clone)]
pub enum Type {
/// Encoded as `v`
Void,
@@ -235,16 +250,18 @@ 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!("{name}:{mangled}")
format!("{PREFIX}{name}:{mangled}")
}

fn mangle_variable(VariableMangler { name, ty }: VariableMangler) -> String {
format!("{name}:{ty}")
format!("{PREFIX}{name}:{ty}")
}
231 changes: 231 additions & 0 deletions compiler/section_mangler/src/parser.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
use crate::{FunctionArgument, 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::{many0, many_m_n};
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<Prefix> {
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))
}

fn parse_entity_name(input: &str) -> ParseResult<&str> {
delimited(char('-'), take_until1(":"), char(':'))(input)
}

fn type_void(input: &str) -> ParseResult<Type> {
char('v').map(|_| Type::Void).parse(input)
}

fn number<T: str::FromStr>(input: &str) -> ParseResult<T> {
map_res(digit1, str::parse)(input)
}

fn type_integer(input: &str) -> ParseResult<Type> {
fn parse_signedness(input: &str) -> ParseResult<bool> {
let signed = char('i').map(|_| true);
let unsigned = char('u').map(|_| false);

alt((signed, unsigned))(input)
}

parse_signedness
.and(number::<u32>)
.map(|(signed, size)| Type::Integer { signed, size, semantic_size: None })
.parse(input)
}

fn type_float(input: &str) -> ParseResult<Type> {
char('f').and(number::<u32>).map(|(_, size)| Type::Float { size }).parse(input)
}

fn type_pointer(input: &str) -> ParseResult<Type> {
char('p').and(parse_type).map(|(_, inner)| Type::Pointer { inner: Box::new(inner) }).parse(input)
}

fn type_struct(input: &str) -> ParseResult<Type> {
let (input, (_, n)) = char('r').and(number::<usize>).parse(input)?;

many_m_n(n, n, parse_type).map(|members| Type::Struct { members }).parse(input)
}

fn type_enum(input: &str) -> ParseResult<Type> {
char('e')
.and(number::<usize>)
.and(parse_type)
.map(|((_, elements), ty)| Type::Enum { referenced_type: Box::new(ty), elements })
.parse(input)
}

fn parse_type(input: &str) -> ParseResult<Type> {
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> {
let (input, ty) = parse_type(input)?;

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(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 {
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 => parse_fn_content(input, name).unwrap().1,
}
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn parse_prefix_valid() {
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());
}

#[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());
}

#[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_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");
}

#[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");
}
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -7,17 +7,17 @@ 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
%foo_int_ret = load i16, i16* %foo_int, align 2
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -7,19 +7,19 @@ 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
%foo_int_ret = load i16, i16* %foo_int, align 2
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
Original file line number Diff line number Diff line change
@@ -7,17 +7,17 @@ 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
%foo_int_ret = load i16, i16* %foo_int, align 2
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 21 additions & 21 deletions src/codegen/tests/parameters_tests.rs
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 44ef766

Please sign in to comment.