Skip to content

Commit

Permalink
rusty: Update insta testsuite for section mangling.
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Apr 18, 2024
1 parent e250a72 commit cdfe947
Show file tree
Hide file tree
Showing 422 changed files with 1,348 additions and 1,348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Up @@ -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
Expand All @@ -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
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion compiler/section_mangler/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn parse_fn_content<'i>(input: &'i str, name: &str) -> ParseResult<'i, SectionMa
// TODO: Do not always encode parameters as ByValue
let mangler = parameters
.into_iter()
.fold(SectionMangler::function(name).with_return_type(Some(return_type)), |mangler, param| {
.fold(SectionMangler::function(name).with_return_type(return_type), |mangler, param| {
mangler.with_parameter(FunctionArgument::ByValue(param))
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit cdfe947

Please sign in to comment.