Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _demo/embed/targetsbuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ case "$test_dir" in
"riscv32"
"riscv64"
"rp2040"
"nintendoswitch" # undefined symbol under lto, should not work when no-lto
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the comment says "should not work when no-lto" but the intent seems to be that it doesn't work with LTO (undefined symbol under LTO). Consider rephrasing, e.g.: # undefined symbol under lto, skip for now.

)
;;
defer)
Expand Down
6 changes: 4 additions & 2 deletions cl/_testdata/apkg/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/apkg"

@"github.com/goplus/llgo/cl/_testdata/apkg.init$guard" = global i1 false, align 1

define double @"github.com/goplus/llgo/cl/_testdata/apkg.Max"(double %0, double %1) {
define double @"github.com/goplus/llgo/cl/_testdata/apkg.Max"(double %0, double %1) #0 {
_llgo_0:
%2 = fcmp ogt double %0, %1
br i1 %2, label %_llgo_1, label %_llgo_2
Expand All @@ -15,7 +15,7 @@ _llgo_2: ; preds = %_llgo_0
ret double %1
}

define void @"github.com/goplus/llgo/cl/_testdata/apkg.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/apkg.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/apkg.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -27,3 +27,5 @@ _llgo_1: ; preds = %_llgo_0
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

attributes #0 = { "frame-pointer"="non-leaf" }
11 changes: 7 additions & 4 deletions cl/_testdata/cpkg/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
source_filename = "github.com/goplus/llgo/cl/_testdata/cpkg"

@"github.com/goplus/llgo/cl/_testdata/cpkg.init$guard" = global i1 false, align 1
@llvm.compiler.used = appending global [2 x ptr] [ptr @Double, ptr @add], section "llvm.metadata"

define double @Double(double %0) {
define double @Double(double %0) #0 {
_llgo_0:
%1 = fmul double 2.000000e+00, %0
ret double %1
}

define i64 @add(i64 %0, i64 %1) {
define i64 @add(i64 %0, i64 %1) #0 {
_llgo_0:
%2 = call i64 @"github.com/goplus/llgo/cl/_testdata/cpkg.add"(i64 %0, i64 %1)
ret i64 %2
}

define i64 @"github.com/goplus/llgo/cl/_testdata/cpkg.add"(i64 %0, i64 %1) {
define i64 @"github.com/goplus/llgo/cl/_testdata/cpkg.add"(i64 %0, i64 %1) #0 {
_llgo_0:
%2 = add i64 %0, %1
ret i64 %2
}

define void @"github.com/goplus/llgo/cl/_testdata/cpkg.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/cpkg.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/cpkg.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -33,3 +34,5 @@ _llgo_1: ; preds = %_llgo_0
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

attributes #0 = { "frame-pointer"="non-leaf" }
18 changes: 10 additions & 8 deletions cl/_testdata/cpkgimp/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/cpkgimp"

@"github.com/goplus/llgo/cl/_testdata/cpkgimp.init$guard" = global i1 false, align 1

define void @"github.com/goplus/llgo/cl/_testdata/cpkgimp.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/cpkgimp.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/cpkgimp.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -17,7 +17,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/cpkgimp.main"() {
define void @"github.com/goplus/llgo/cl/_testdata/cpkgimp.main"() #0 {
_llgo_0:
%0 = call i64 @add(i64 1, i64 2)
%1 = call double @Double(double 3.140000e+00)
Expand All @@ -28,14 +28,16 @@ _llgo_0:
ret void
}

declare void @"github.com/goplus/llgo/cl/_testdata/cpkg.init"()
declare void @"github.com/goplus/llgo/cl/_testdata/cpkg.init"() #0

declare i64 @add(i64, i64)
declare i64 @add(i64, i64) #0

declare double @Double(double)
declare double @Double(double) #0

declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64) #0

declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) #0

declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintFloat"(double) #0

attributes #0 = { "frame-pointer"="non-leaf" }
16 changes: 9 additions & 7 deletions cl/_testdata/embedunexport/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/embedunexport"
@"github.com/goplus/llgo/cl/_testdata/embedunexport.init$guard" = global i1 false, align 1
@0 = private unnamed_addr constant [8 x i8] c"modified", align 1

define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/cl/_testdata/embedunexport.(*Base).Name"(ptr %0) {
define %"github.com/goplus/llgo/runtime/internal/runtime.String" @"github.com/goplus/llgo/cl/_testdata/embedunexport.(*Base).Name"(ptr %0) #0 {
_llgo_0:
%1 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/embedunexport.Base", ptr %0, i32 0, i32 0
%2 = load %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr %1, align 8
ret %"github.com/goplus/llgo/runtime/internal/runtime.String" %2
}

define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.(*Base).setName"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) {
define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.(*Base).setName"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.String" %1) #0 {
_llgo_0:
%2 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/embedunexport.Base", ptr %0, i32 0, i32 0
store %"github.com/goplus/llgo/runtime/internal/runtime.String" %1, ptr %2, align 8
ret void
}

define ptr @"github.com/goplus/llgo/cl/_testdata/embedunexport.NewBase"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) {
define ptr @"github.com/goplus/llgo/cl/_testdata/embedunexport.NewBase"(%"github.com/goplus/llgo/runtime/internal/runtime.String" %0) #0 {
_llgo_0:
%1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16)
%2 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/embedunexport.Base", ptr %1, i32 0, i32 0
store %"github.com/goplus/llgo/runtime/internal/runtime.String" %0, ptr %2, align 8
ret ptr %1
}

define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.Use"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) {
define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.Use"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) #0 {
_llgo_0:
%1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0)
%2 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 0
Expand All @@ -44,7 +44,7 @@ _llgo_0:
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/embedunexport.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/embedunexport.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -57,6 +57,8 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) #0

declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") #0

attributes #0 = { "frame-pointer"="non-leaf" }
8 changes: 5 additions & 3 deletions cl/_testdata/fncall/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/fncall"

@"github.com/goplus/llgo/cl/_testdata/fncall.init$guard" = global i1 false, align 1

define void @"github.com/goplus/llgo/cl/_testdata/fncall.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/fncall.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/fncall.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -16,13 +16,13 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/fncall.main"() {
define void @"github.com/goplus/llgo/cl/_testdata/fncall.main"() #0 {
_llgo_0:
%0 = call i64 @"github.com/goplus/llgo/cl/_testdata/fncall.max"(i64 1, i64 2)
ret void
}

define i64 @"github.com/goplus/llgo/cl/_testdata/fncall.max"(i64 %0, i64 %1) {
define i64 @"github.com/goplus/llgo/cl/_testdata/fncall.max"(i64 %0, i64 %1) #0 {
_llgo_0:
%2 = icmp sgt i64 %0, %1
br i1 %2, label %_llgo_1, label %_llgo_2
Expand All @@ -33,3 +33,5 @@ _llgo_1: ; preds = %_llgo_0
_llgo_2: ; preds = %_llgo_0
ret i64 %1
}

attributes #0 = { "frame-pointer"="non-leaf" }
33 changes: 17 additions & 16 deletions cl/_testdata/foo/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/foo"
@"github.com/goplus/llgo/cl/_testdata/foo.struct$MYpsoM99ZwFY087IpUOkIw1zjBA_sgFXVodmn1m-G88$fields" = weak_odr constant [1 x %"github.com/goplus/llgo/runtime/abi.StructField"] [%"github.com/goplus/llgo/runtime/abi.StructField" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 1 }, ptr @_llgo_int, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false }], align 8
@6 = private unnamed_addr constant [4 x i8] c"load", align 1

define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.Bar"() {
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.Bar"() #0 {
_llgo_0:
%0 = alloca { i64 }, align 8
call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false)
Expand All @@ -40,7 +40,7 @@ _llgo_0:
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5
}

define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.F"() {
define %"github.com/goplus/llgo/runtime/internal/runtime.eface" @"github.com/goplus/llgo/cl/_testdata/foo.F"() #0 {
_llgo_0:
%0 = alloca { i64 }, align 8
call void @llvm.memset(ptr %0, i8 0, i64 8, i1 false)
Expand All @@ -53,7 +53,7 @@ _llgo_0:
ret %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5
}

define ptr @"github.com/goplus/llgo/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/cl/_testdata/foo.Foo" %0) {
define ptr @"github.com/goplus/llgo/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/cl/_testdata/foo.Foo" %0) #0 {
_llgo_0:
%1 = alloca %"github.com/goplus/llgo/cl/_testdata/foo.Foo", align 8
call void @llvm.memset(ptr %1, i8 0, i64 16, i1 false)
Expand All @@ -63,26 +63,26 @@ _llgo_0:
ret ptr %3
}

define ptr @"github.com/goplus/llgo/cl/_testdata/foo.(*Foo).Pb"(ptr %0) {
define ptr @"github.com/goplus/llgo/cl/_testdata/foo.(*Foo).Pb"(ptr %0) #0 {
_llgo_0:
%1 = load %"github.com/goplus/llgo/cl/_testdata/foo.Foo", ptr %0, align 8
%2 = call ptr @"github.com/goplus/llgo/cl/_testdata/foo.Foo.Pb"(%"github.com/goplus/llgo/cl/_testdata/foo.Foo" %1)
ret ptr %2
}

define void @"github.com/goplus/llgo/cl/_testdata/foo.(*Game).Load"(ptr %0) {
define void @"github.com/goplus/llgo/cl/_testdata/foo.(*Game).Load"(ptr %0) #0 {
_llgo_0:
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 })
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10)
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/foo.(*Game).initGame"(ptr %0) {
define void @"github.com/goplus/llgo/cl/_testdata/foo.(*Game).initGame"(ptr %0) #0 {
_llgo_0:
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/foo.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/foo.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/foo.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -96,28 +96,29 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #0
declare void @llvm.memset(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.structequal"(ptr, ptr, ptr)
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.structequal"(ptr, ptr, ptr) #0

declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr, ptr)
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr, ptr) #0

define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr %0, ptr %1, ptr %2) {
define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr %0, ptr %1, ptr %2) #0 {
_llgo_0:
%3 = tail call i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequalptr"(ptr %1, ptr %2)
ret i1 %3
}

declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr, ptr)
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr, ptr) #0

define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr %0, ptr %1, ptr %2) {
define linkonce i1 @"__llgo_stub.github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr %0, ptr %1, ptr %2) #0 {
_llgo_0:
%3 = tail call i1 @"github.com/goplus/llgo/runtime/internal/runtime.memequal64"(ptr %1, ptr %2)
ret i1 %3
}

declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String")
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String") #0

declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8) #0

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #0 = { "frame-pointer"="non-leaf" }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) "frame-pointer"="non-leaf" }
20 changes: 11 additions & 9 deletions cl/_testdata/geometry1370/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/geometry1370"

@"github.com/goplus/llgo/cl/_testdata/geometry1370.init$guard" = global i1 false, align 1

define ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.NewRectangle"(double %0, double %1) {
define ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.NewRectangle"(double %0, double %1) #0 {
_llgo_0:
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 24)
%3 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %2, i32 0, i32 0
Expand All @@ -16,7 +16,7 @@ _llgo_0:
ret ptr %2
}

define double @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area"(ptr %0) {
define double @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area"(ptr %0) #0 {
_llgo_0:
%1 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 0
%2 = load double, ptr %1, align 8
Expand All @@ -26,21 +26,21 @@ _llgo_0:
ret double %5
}

define i64 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID"(ptr %0) {
define i64 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID"(ptr %0) #0 {
_llgo_0:
%1 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 2
%2 = load i64, ptr %1, align 4
ret i64 %2
}

define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).setID"(ptr %0, i64 %1) {
define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).setID"(ptr %0, i64 %1) #0 {
_llgo_0:
%2 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 2
store i64 %1, ptr %2, align 4
ret void
}

define i1 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).validate"(ptr %0) {
define i1 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).validate"(ptr %0) #0 {
_llgo_0:
%1 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 0
%2 = load double, ptr %1, align 8
Expand All @@ -58,7 +58,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret i1 %7
}

define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.RegisterShape"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, i64 %1) {
define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.RegisterShape"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, i64 %1) #0 {
_llgo_0:
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0)
%3 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, 0
Expand All @@ -72,7 +72,7 @@ _llgo_0:
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -85,6 +85,8 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64) #0

declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface") #0

attributes #0 = { "frame-pointer"="non-leaf" }
12 changes: 7 additions & 5 deletions cl/_testdata/importpkg/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source_filename = "github.com/goplus/llgo/cl/_testdata/importpkg"
@"github.com/goplus/llgo/cl/_testdata/importpkg.hello" = global [7 x i8] zeroinitializer, align 1
@"github.com/goplus/llgo/cl/_testdata/importpkg.init$guard" = global i1 false, align 1

define void @"github.com/goplus/llgo/cl/_testdata/importpkg.init"() {
define void @"github.com/goplus/llgo/cl/_testdata/importpkg.init"() #0 {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testdata/importpkg.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
Expand All @@ -25,15 +25,17 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}

define void @"github.com/goplus/llgo/cl/_testdata/importpkg.main"() {
define void @"github.com/goplus/llgo/cl/_testdata/importpkg.main"() #0 {
_llgo_0:
%0 = call i64 @"github.com/goplus/llgo/cl/_testdata/importpkg/stdio.Max"(i64 2, i64 100)
call void (ptr, ...) @printf(ptr @"github.com/goplus/llgo/cl/_testdata/importpkg.hello")
ret void
}

declare void @"github.com/goplus/llgo/cl/_testdata/importpkg/stdio.init"()
declare void @"github.com/goplus/llgo/cl/_testdata/importpkg/stdio.init"() #0

declare i64 @"github.com/goplus/llgo/cl/_testdata/importpkg/stdio.Max"(i64, i64)
declare i64 @"github.com/goplus/llgo/cl/_testdata/importpkg/stdio.Max"(i64, i64) #0

declare void @printf(ptr, ...)
declare void @printf(ptr, ...) #0

attributes #0 = { "frame-pointer"="non-leaf" }
Loading
Loading