Skip to content

Commit

Permalink
fix(ryujin): tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SrGaabriel committed Sep 9, 2024
1 parent 434132d commit c658d40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions bard/output/ll/bard.ll
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@formatln_int32 = unnamed_addr constant [4 x i8] c"%d
\00"
declare i32 @printf(i8*, ...)
@str_1785507932 = unnamed_addr constant [14 x i8] c"Hello, World!\00"
@str_1613095350 = unnamed_addr constant [14 x i8] c"Hello, World!\00"

define i32 @test() {
ret i32 8
Expand All @@ -10,14 +10,9 @@ define i32 @main() {
%1 = call i32 @test()
%2 = getelementptr [4 x i8], [4 x i8]* @formatln_int32, i32 0, i32 0
call i32 @printf(i8* %2, i32 %1)
%4 = call i32 @test()
%5 = getelementptr [4 x i8], [4 x i8]* @formatln_int32, i32 0, i32 0
call i32 @printf(i8* %5, i32 %4)
%7 = call i32 @test()
%8 = getelementptr [4 x i8], [4 x i8]* @formatln_int32, i32 0, i32 0
call i32 @printf(i8* %8, i32 %7)
%10 = getelementptr [14 x i8], [14 x i8]* @str_1785507932, i32 0, i32 0
call i32 @printf(i8* %10)
%12 = call i32 @test()
ret i32 %12
call i32 @printf(i8* %2, i32 %1)
call i32 @printf(i8* %2, i32 %1)
%6 = getelementptr [14 x i8], [14 x i8]* @str_1613095350, i32 0, i32 0
call i32 @printf(i8* %6)
ret i32 %1
}
2 changes: 1 addition & 1 deletion ryujin/src/commonMain/kotlin/dsl/FunctionScopeDsl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class FunctionScopeDsl(
fun load(target: Memory): LoadStatement =
LoadStatement(target)

fun assign(constantOverride: Boolean, value: (FunctionScopeDsl) -> TypedDragonStatement): Memory =
fun assign(constantOverride: Boolean? = null, value: (FunctionScopeDsl) -> TypedDragonStatement): Memory =
value(this).assign(constantOverride = constantOverride)

fun TypedDragonStatement.ignore() =
Expand Down

0 comments on commit c658d40

Please sign in to comment.