Compare commits

...

6 Commits

Author SHA1 Message Date
xgopilot
022ba1c067 refactor(runtime): combine two if cases in methods() function
Simplified the methods() function in z_face.go by combining two
if statements that both return u.Methods() into a single condition
using logical OR operator.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-31 02:28:17 +00:00
xgopilot
a3a7876d16 chore: regenerate out.ll files with updated llgen
Regenerated all out.ll files after reinstalling llgen to fix TestFromTestrt and TestFromTestgo test failures.

Updated files:
- cl/_testgo/equal/out.ll
- cl/_testrt/asmfull/out.ll
- cl/_testrt/makemap/out.ll
- cl/_testrt/tpmap/out.ll

The changes correctly update interface PkgPath from specific package paths to empty strings (zeroinitializer) for interfaces with only exported methods, which aligns with the fix in PR #1380 for issue #1370.

🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-30 09:49:51 +00:00
xgopilot
eb0fa2e107 fix(ssa): revert unnecessary formatting changes
Reverted two unnecessary formatting changes based on code review:
- ssa/interface.go: Restored single-line format for val function
- ssa/abitype.go: Moved pkg variable declaration back to original position

These changes don't affect functionality, just code formatting.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-30 08:06:40 +00:00
xgopilot
210d8858d5 chore: regenerate out.ll files with llgen after interface changes
Regenerated all out.ll test files using llgen after the interface
metadata changes. The updated files now reflect:
- Anonymous interfaces use empty PkgPath (zeroinitializer)
- Anonymous interface types have unique identifiers
- Runtime correctly handles empty PkgPath for method visibility

Files regenerated:
- cl/_testgo/errors/out.ll
- cl/_testgo/ifaceconv/out.ll
- cl/_testgo/ifaceprom/out.ll
- cl/_testgo/interface/out.ll
- cl/_testgo/interface1370/out.ll
- cl/_testgo/invoke/out.ll
- cl/_testgo/reader/out.ll
- cl/_testgo/reflect/out.ll
- cl/_testgo/tpinst/out.ll
- cl/_testrt/tpabi/out.ll
- cl/_testrt/tpmethod/out.ll
- cl/_testrt/vamethod/out.ll

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-30 07:53:06 +00:00
xgopilot
79bf753c0e fix(ssa): use empty PkgPath for anonymous interfaces
Based on meeting discussion, this commit reverts the previous approach
of extracting PkgPath from interface methods. Instead, anonymous
interfaces now use an empty PkgPath string, and the runtime's methods()
function handles empty PkgPath by returning all methods.

Changes:
- Reverted unsafeInterface() to remove originType parameter
- Set anonymous interface PkgPath to empty string in abitype.go:202
- Added early return in methods() in z_face.go for empty PkgPath
- All call sites of unsafeInterface() updated to pass rawIntf directly

This approach is cleaner because anonymous interfaces don't belong to
any package, and the compiler already guarantees safety for cross-package
private method access.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-30 07:33:20 +00:00
xgopilot
88d32c9930 fix(ssa): correct PkgPath for interface metadata in cross-package conversions
Fixes #1370 - Segmentation Fault When Calling Interface Private Methods Cross-Package

This commit fixes a critical bug where interface metadata's PkgPath was incorrectly
set when converting concrete type pointers to interfaces with private methods across
package boundaries.

Problem:
- When a concrete type pointer was converted to an interface with private methods
  in a package different from the interface definition package, the compiler
  incorrectly set the interface metadata's PkgPath to the current compilation
  package instead of the interface definition package
- This caused the runtime to only fill exported methods in the itab, leaving
  private method slots as NULL (0x0), resulting in segmentation faults

Solution:
- Modified abiInterfaceOf() in ssa/abitype.go to extract the package path from
  the interface's private methods (if any)
- Use that package path instead of the current compilation package path
- Fall back to current package path only if all methods are exported

Changes:
- ssa/abitype.go: Use abi.PathOf() to get correct package path
- ssa/interface.go: Refactor to simplify interface type handling
- Added comprehensive test cases and demos for go/types, go/token, and go/ast
- Updated all test outputs to reflect correct interface metadata generation

This fix resolves segmentation faults when using Go standard library interfaces
and user-defined interfaces with private methods across package boundaries.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
2025-10-30 06:24:23 +00:00
23 changed files with 1352 additions and 49 deletions

356
_demo/go/gotoken/main.go Normal file
View File

@@ -0,0 +1,356 @@
package main
import (
"fmt"
"go/token"
)
func main() {
testPos()
testToken()
testFileSet()
testFile()
testPosition()
testTokenPrecedence()
testTokenKeywords()
testUtilityFunctions()
}
func testPos() {
fmt.Println("=== Test Pos ===")
pos1 := token.Pos(100)
pos2 := token.Pos(200)
if pos1 != 100 {
panic(fmt.Sprintf("Expected pos1 to be 100, got %d", pos1))
}
if pos2 != 200 {
panic(fmt.Sprintf("Expected pos2 to be 200, got %d", pos2))
}
fmt.Printf("Pos1: %d, Pos2: %d\n", pos1, pos2)
if !pos1.IsValid() {
panic("Expected pos1.IsValid() to be true")
}
fmt.Printf("Pos1.IsValid(): %v\n", pos1.IsValid())
noPos := token.NoPos
if noPos != 0 {
panic(fmt.Sprintf("Expected NoPos to be 0, got %d", noPos))
}
if noPos.IsValid() {
panic("Expected NoPos.IsValid() to be false")
}
fmt.Printf("NoPos: %d, IsValid: %v\n", noPos, noPos.IsValid())
fmt.Println("SUCCESS: Pos operations work correctly\n")
}
func testToken() {
fmt.Println("\n=== Test Token Types ===")
expectedStrings := map[token.Token]string{
token.ADD: "+",
token.SUB: "-",
token.MUL: "*",
token.QUO: "/",
token.LPAREN: "(",
token.RPAREN: ")",
token.EQL: "==",
token.NEQ: "!=",
}
for tok, expected := range expectedStrings {
if tok.String() != expected {
panic(fmt.Sprintf("Expected %v.String() to be %q, got %q", tok, expected, tok.String()))
}
}
tokens := []token.Token{
token.ILLEGAL,
token.EOF,
token.COMMENT,
token.IDENT,
token.INT,
token.FLOAT,
token.IMAG,
token.CHAR,
token.STRING,
token.ADD,
token.SUB,
token.MUL,
token.QUO,
token.REM,
token.AND,
token.OR,
token.XOR,
token.SHL,
token.SHR,
token.AND_NOT,
token.ADD_ASSIGN,
token.SUB_ASSIGN,
token.MUL_ASSIGN,
token.QUO_ASSIGN,
token.REM_ASSIGN,
token.AND_ASSIGN,
token.OR_ASSIGN,
token.XOR_ASSIGN,
token.SHL_ASSIGN,
token.SHR_ASSIGN,
token.AND_NOT_ASSIGN,
token.LAND,
token.LOR,
token.ARROW,
token.INC,
token.DEC,
token.EQL,
token.LSS,
token.GTR,
token.ASSIGN,
token.NOT,
token.NEQ,
token.LEQ,
token.GEQ,
token.DEFINE,
token.ELLIPSIS,
token.LPAREN,
token.LBRACK,
token.LBRACE,
token.COMMA,
token.PERIOD,
token.RPAREN,
token.RBRACK,
token.RBRACE,
token.SEMICOLON,
token.COLON,
}
for _, tok := range tokens {
fmt.Printf("Token: %s (String: %q)\n", tok, tok.String())
}
fmt.Println("SUCCESS: Token types work correctly\n")
}
func testTokenKeywords() {
fmt.Println("\n=== Test Keywords ===")
keywords := []token.Token{
token.BREAK,
token.CASE,
token.CHAN,
token.CONST,
token.CONTINUE,
token.DEFAULT,
token.DEFER,
token.ELSE,
token.FALLTHROUGH,
token.FOR,
token.FUNC,
token.GO,
token.GOTO,
token.IF,
token.IMPORT,
token.INTERFACE,
token.MAP,
token.PACKAGE,
token.RANGE,
token.RETURN,
token.SELECT,
token.STRUCT,
token.SWITCH,
token.TYPE,
token.VAR,
}
for _, kw := range keywords {
if !kw.IsKeyword() {
panic(fmt.Sprintf("Expected %s to be a keyword", kw))
}
fmt.Printf("Keyword: %s, IsKeyword: %v\n", kw, kw.IsKeyword())
}
if token.ADD.IsKeyword() {
panic("Expected ADD operator to not be a keyword")
}
if token.IDENT.IsKeyword() {
panic("Expected IDENT token to not be a keyword")
}
fmt.Println("SUCCESS: Keyword checks work correctly\n")
}
func testTokenPrecedence() {
fmt.Println("\n=== Test Token Precedence ===")
if token.MUL.Precedence() <= token.ADD.Precedence() {
panic("Expected MUL to have higher precedence than ADD")
}
if token.LAND.Precedence() <= token.LOR.Precedence() {
panic("Expected LAND to have higher precedence than LOR")
}
if token.MUL.Precedence() != token.QUO.Precedence() {
panic("Expected MUL and QUO to have same precedence")
}
if token.ADD.Precedence() != token.SUB.Precedence() {
panic("Expected ADD and SUB to have same precedence")
}
operators := []token.Token{
token.ADD,
token.SUB,
token.MUL,
token.QUO,
token.REM,
token.LAND,
token.LOR,
token.EQL,
token.LSS,
token.GTR,
}
for _, op := range operators {
fmt.Printf("Operator: %s, Precedence: %d\n", op, op.Precedence())
}
fmt.Println("SUCCESS: Precedence operations work correctly\n")
}
func testFileSet() {
fmt.Println("\n=== Test FileSet ===")
fset := token.NewFileSet()
file1 := fset.AddFile("file1.go", -1, 1000)
file2 := fset.AddFile("file2.go", -1, 2000)
fmt.Printf("Added file1: %s, Base: %d, Size: %d\n", file1.Name(), file1.Base(), file1.Size())
fmt.Printf("Added file2: %s, Base: %d, Size: %d\n", file2.Name(), file2.Base(), file2.Size())
pos := file1.Pos(100)
retrievedFile := fset.File(pos)
if retrievedFile != file1 {
panic("FileSet.File failed to retrieve correct file")
}
position := fset.Position(pos)
fmt.Printf("Position at offset 100: %s\n", position)
fmt.Println("SUCCESS: FileSet operations work correctly\n")
}
func testFile() {
fmt.Println("\n=== Test File ===")
fset := token.NewFileSet()
file := fset.AddFile("test.go", -1, 1000)
if file.Name() != "test.go" {
panic(fmt.Sprintf("Expected file name to be 'test.go', got %q", file.Name()))
}
if file.Size() != 1000 {
panic(fmt.Sprintf("Expected file size to be 1000, got %d", file.Size()))
}
file.AddLine(0)
file.AddLine(50)
file.AddLine(100)
if file.LineCount() != 3 {
panic(fmt.Sprintf("Expected line count to be 3, got %d", file.LineCount()))
}
fmt.Printf("File name: %s\n", file.Name())
fmt.Printf("File base: %d\n", file.Base())
fmt.Printf("File size: %d\n", file.Size())
fmt.Printf("File line count: %d\n", file.LineCount())
pos := file.Pos(50)
fmt.Printf("Pos at offset 50: %d\n", pos)
offset := file.Offset(pos)
if offset != 50 {
panic(fmt.Sprintf("Expected offset to be 50, got %d", offset))
}
fmt.Printf("Offset of pos: %d\n", offset)
line := file.Line(pos)
if line != 2 {
panic(fmt.Sprintf("Expected line to be 2, got %d", line))
}
fmt.Printf("Line number at pos: %d\n", line)
lineStart := file.LineStart(2)
fmt.Printf("Line 2 starts at pos: %d\n", lineStart)
position := file.Position(pos)
fmt.Printf("Position: %s\n", position)
fmt.Println("SUCCESS: File operations work correctly\n")
}
func testPosition() {
fmt.Println("\n=== Test Position ===" )
pos := token.Position{
Filename: "test.go",
Offset: 100,
Line: 5,
Column: 10,
}
if !pos.IsValid() {
panic("Expected valid position to be valid")
}
if pos.Filename != "test.go" {
panic(fmt.Sprintf("Expected filename to be 'test.go', got %q", pos.Filename))
}
if pos.Line != 5 {
panic(fmt.Sprintf("Expected line to be 5, got %d", pos.Line))
}
if pos.Column != 10 {
panic(fmt.Sprintf("Expected column to be 10, got %d", pos.Column))
}
fmt.Printf("Position: %s\n", pos.String())
fmt.Printf("Filename: %s, Line: %d, Column: %d, Offset: %d\n",
pos.Filename, pos.Line, pos.Column, pos.Offset)
fmt.Printf("IsValid: %v\n", pos.IsValid())
invalidPos := token.Position{}
if invalidPos.IsValid() {
panic("Expected empty position to be invalid")
}
fmt.Printf("Invalid position IsValid: %v\n", invalidPos.IsValid())
fmt.Println("SUCCESS: Position operations work correctly\n")
}
func testUtilityFunctions() {
fmt.Println("\n=== Test Utility Functions ===")
fmt.Printf("IsExported(\"Foo\"): %v\n", token.IsExported("Foo"))
fmt.Printf("IsExported(\"foo\"): %v\n", token.IsExported("foo"))
fmt.Printf("IsExported(\"_foo\"): %v\n", token.IsExported("_foo"))
fmt.Printf("IsIdentifier(\"foo\"): %v\n", token.IsIdentifier("foo"))
fmt.Printf("IsIdentifier(\"foo123\"): %v\n", token.IsIdentifier("foo123"))
fmt.Printf("IsIdentifier(\"123foo\"): %v\n", token.IsIdentifier("123foo"))
fmt.Printf("IsIdentifier(\"foo-bar\"): %v\n", token.IsIdentifier("foo-bar"))
fmt.Printf("IsKeyword(\"func\"): %v\n", token.IsKeyword("func"))
fmt.Printf("IsKeyword(\"if\"): %v\n", token.IsKeyword("if"))
fmt.Printf("IsKeyword(\"foo\"): %v\n", token.IsKeyword("foo"))
lookupFunc := token.Lookup("func")
fmt.Printf("Lookup(\"func\"): %s\n", lookupFunc)
lookupIdent := token.Lookup("myVar")
fmt.Printf("Lookup(\"myVar\"): %s\n", lookupIdent)
lookupFor := token.Lookup("for")
fmt.Printf("Lookup(\"for\"): %s\n", lookupFor)
fmt.Println("SUCCESS: Utility functions work correctly\n")
}

488
_demo/go/gotypes/main.go Normal file
View File

@@ -0,0 +1,488 @@
package main
import (
"fmt"
"go/token"
"go/types"
)
func main() {
testBasicTypes()
testObjects()
testScope()
testPackage()
testNamed()
testInterface()
testStruct()
testSignature()
testTuple()
testArray()
testSlice()
testPointer()
testMap()
testChan()
testTypeComparison()
testTypeChecking()
testStringFunctions()
testLookupFunctions()
testUtilityFunctions()
}
func testBasicTypes() {
fmt.Println("=== Test Basic Types ===")
intType := types.Typ[types.Int]
fmt.Printf("Int type: %v, Kind: %v\n", intType, intType.Kind())
if intType.Kind() != types.Int {
panic(fmt.Sprintf("Int type kind mismatch: expected %v, got %v", types.Int, intType.Kind()))
}
stringType := types.Typ[types.String]
fmt.Printf("String type: %v, Kind: %v\n", stringType, stringType.Kind())
if stringType.Kind() != types.String {
panic(fmt.Sprintf("String type kind mismatch: expected %v, got %v", types.String, stringType.Kind()))
}
boolType := types.Typ[types.Bool]
fmt.Printf("Bool type: %v, Kind: %v\n", boolType, boolType.Kind())
if boolType.Kind() != types.Bool {
panic(fmt.Sprintf("Bool type kind mismatch: expected %v, got %v", types.Bool, boolType.Kind()))
}
float64Type := types.Typ[types.Float64]
fmt.Printf("Float64 type: %v, Kind: %v\n", float64Type, float64Type.Kind())
if float64Type.Kind() != types.Float64 {
panic(fmt.Sprintf("Float64 type kind mismatch: expected %v, got %v", types.Float64, float64Type.Kind()))
}
fmt.Println("SUCCESS: Basic types work correctly\n")
}
func testObjects() {
fmt.Println("\n=== Test Objects (Var, Const, Func, TypeName) ===")
varObj := types.NewVar(token.NoPos, nil, "x", types.Typ[types.Int])
fmt.Printf("Var: Name=%s, Type=%v\n", varObj.Name(), varObj.Type())
if varObj.Name() != "x" {
panic(fmt.Sprintf("Var name mismatch: expected x, got %s", varObj.Name()))
}
if varObj.Type() != types.Typ[types.Int] {
panic(fmt.Sprintf("Var type mismatch: expected int, got %v", varObj.Type()))
}
constObj := types.NewConst(token.NoPos, nil, "pi", types.Typ[types.Float64], nil)
fmt.Printf("Const: Name=%s, Type=%v\n", constObj.Name(), constObj.Type())
if constObj.Name() != "pi" {
panic(fmt.Sprintf("Const name mismatch: expected pi, got %s", constObj.Name()))
}
if constObj.Type() != types.Typ[types.Float64] {
panic(fmt.Sprintf("Const type mismatch: expected float64, got %v", constObj.Type()))
}
sig := types.NewSignatureType(nil, nil, nil, nil, nil, false)
funcObj := types.NewFunc(token.NoPos, nil, "foo", sig)
fmt.Printf("Func: Name=%s, Type=%v\n", funcObj.Name(), funcObj.Type())
if funcObj.Name() != "foo" {
panic(fmt.Sprintf("Func name mismatch: expected foo, got %s", funcObj.Name()))
}
typeObj := types.NewTypeName(token.NoPos, nil, "MyInt", types.Typ[types.Int])
fmt.Printf("TypeName: Name=%s, Type=%v\n", typeObj.Name(), typeObj.Type())
if typeObj.Name() != "MyInt" {
panic(fmt.Sprintf("TypeName name mismatch: expected MyInt, got %s", typeObj.Name()))
}
var obj types.Object = varObj
if obj.Name() != "x" {
panic("Object interface conversion failed")
}
fmt.Println("SUCCESS: Object interface works correctly\n")
}
func testScope() {
fmt.Println("\n=== Test Scope ===")
scope := types.NewScope(nil, 0, 0, "test")
obj := types.NewVar(0, nil, "x", types.Typ[types.Int])
scope.Insert(obj)
result := scope.Lookup("x")
if result != obj {
panic("Scope.Lookup failed")
}
names := scope.Names()
if len(names) != 1 || names[0] != "x" {
panic("Scope.Names failed")
}
num := scope.Len()
if num != 1 {
panic("Scope.Len failed")
}
fmt.Printf("Scope contains %d object(s): %v\n", num, names)
fmt.Println("SUCCESS: Scope operations work correctly\n")
}
func testPackage() {
fmt.Println("\n=== Test Package ===")
pkg := types.NewPackage("example.com/test", "test")
fmt.Printf("Package: Path=%s, Name=%s\n", pkg.Path(), pkg.Name())
if pkg.Path() != "example.com/test" {
panic(fmt.Sprintf("Package path mismatch: expected example.com/test, got %s", pkg.Path()))
}
if pkg.Name() != "test" {
panic(fmt.Sprintf("Package name mismatch: expected test, got %s", pkg.Name()))
}
scope := pkg.Scope()
if scope == nil {
panic("Package.Scope returned nil")
}
varObj := types.NewVar(token.NoPos, pkg, "x", types.Typ[types.Int])
scope.Insert(varObj)
result := pkg.Scope().Lookup("x")
if result != varObj {
panic("Package scope lookup failed")
}
fmt.Println("SUCCESS: Package operations work correctly\n")
}
func testNamed() {
fmt.Println("\n=== Test Named Types ===")
pkg := types.NewPackage("example.com/test", "test")
typeName := types.NewTypeName(token.NoPos, pkg, "MyInt", nil)
named := types.NewNamed(typeName, types.Typ[types.Int], nil)
fmt.Printf("Named type: %v, Underlying: %v\n", named, named.Underlying())
if named.Obj() != typeName {
panic("Named.Obj failed")
}
fmt.Println("SUCCESS: Named type operations work correctly\n")
}
func testInterface() {
fmt.Println("\n=== Test Interface ===")
pkg := types.NewPackage("example.com/test", "test")
posMethod := types.NewFunc(token.NoPos, pkg, "Pos", types.NewSignatureType(nil, nil, nil, nil, types.NewTuple(types.NewVar(0, pkg, "", types.Typ[types.Int])), false))
endMethod := types.NewFunc(token.NoPos, pkg, "End", types.NewSignatureType(nil, nil, nil, nil, types.NewTuple(types.NewVar(0, pkg, "", types.Typ[types.Int])), false))
methods := []*types.Func{posMethod, endMethod}
iface := types.NewInterfaceType(methods, nil)
iface.Complete()
fmt.Printf("Interface with %d methods\n", iface.NumMethods())
if iface.NumMethods() != 2 {
panic(fmt.Sprintf("Interface method count mismatch: expected 2, got %d", iface.NumMethods()))
}
method := iface.Method(0)
fmt.Printf("Method 0: %s\n", method.Name())
if method.Name() != "End" && method.Name() != "Pos" {
panic(fmt.Sprintf("Unexpected method name: %s", method.Name()))
}
fmt.Println("SUCCESS: Interface operations work correctly\n")
}
func testStruct() {
fmt.Println("\n=== Test Struct ===")
fields := []*types.Var{
types.NewField(token.NoPos, nil, "X", types.Typ[types.Int], false),
types.NewField(token.NoPos, nil, "Y", types.Typ[types.String], false),
}
structType := types.NewStruct(fields, nil)
fmt.Printf("Struct with %d fields\n", structType.NumFields())
if structType.NumFields() != 2 {
panic(fmt.Sprintf("Struct field count mismatch: expected 2, got %d", structType.NumFields()))
}
field0 := structType.Field(0)
fmt.Printf("Field 0: Name=%s, Type=%v\n", field0.Name(), field0.Type())
if field0.Name() != "X" {
panic(fmt.Sprintf("Field 0 name mismatch: expected X, got %s", field0.Name()))
}
if field0.Type() != types.Typ[types.Int] {
panic(fmt.Sprintf("Field 0 type mismatch: expected int, got %v", field0.Type()))
}
fmt.Println("SUCCESS: Struct operations work correctly\n")
}
func testSignature() {
fmt.Println("\n=== Test Signature ===")
params := types.NewTuple(
types.NewVar(token.NoPos, nil, "x", types.Typ[types.Int]),
types.NewVar(token.NoPos, nil, "y", types.Typ[types.String]),
)
results := types.NewTuple(
types.NewVar(token.NoPos, nil, "", types.Typ[types.Bool]),
)
sig := types.NewSignatureType(nil, nil, nil, params, results, false)
fmt.Printf("Signature: %d params, %d results\n", sig.Params().Len(), sig.Results().Len())
if sig.Params().Len() != 2 {
panic(fmt.Sprintf("Signature param count mismatch: expected 2, got %d", sig.Params().Len()))
}
if sig.Results().Len() != 1 {
panic(fmt.Sprintf("Signature result count mismatch: expected 1, got %d", sig.Results().Len()))
}
param0 := sig.Params().At(0)
fmt.Printf("Param 0: Name=%s, Type=%v\n", param0.Name(), param0.Type())
if param0.Name() != "x" {
panic(fmt.Sprintf("Param 0 name mismatch: expected x, got %s", param0.Name()))
}
if param0.Type() != types.Typ[types.Int] {
panic(fmt.Sprintf("Param 0 type mismatch: expected int, got %v", param0.Type()))
}
fmt.Println("SUCCESS: Signature operations work correctly\n")
}
func testTuple() {
fmt.Println("\n=== Test Tuple ===")
tuple := types.NewTuple(
types.NewVar(token.NoPos, nil, "a", types.Typ[types.Int]),
types.NewVar(token.NoPos, nil, "b", types.Typ[types.String]),
)
fmt.Printf("Tuple length: %d\n", tuple.Len())
if tuple.Len() != 2 {
panic(fmt.Sprintf("Tuple length mismatch: expected 2, got %d", tuple.Len()))
}
var0 := tuple.At(0)
fmt.Printf("Element 0: Name=%s, Type=%v\n", var0.Name(), var0.Type())
if var0.Name() != "a" {
panic(fmt.Sprintf("Tuple element 0 name mismatch: expected a, got %s", var0.Name()))
}
if var0.Type() != types.Typ[types.Int] {
panic(fmt.Sprintf("Tuple element 0 type mismatch: expected int, got %v", var0.Type()))
}
fmt.Println("SUCCESS: Tuple operations work correctly\n")
}
func testArray() {
fmt.Println("\n=== Test Array ===")
arrayType := types.NewArray(types.Typ[types.Int], 10)
fmt.Printf("Array type: %v, Elem: %v, Len: %d\n", arrayType, arrayType.Elem(), arrayType.Len())
if arrayType.Len() != 10 {
panic(fmt.Sprintf("Array length mismatch: expected 10, got %d", arrayType.Len()))
}
if arrayType.Elem() != types.Typ[types.Int] {
panic(fmt.Sprintf("Array element type mismatch: expected int, got %v", arrayType.Elem()))
}
fmt.Println("SUCCESS: Array operations work correctly\n")
}
func testSlice() {
fmt.Println("\n=== Test Slice ===")
sliceType := types.NewSlice(types.Typ[types.String])
fmt.Printf("Slice type: %v, Elem: %v\n", sliceType, sliceType.Elem())
if sliceType.Elem() != types.Typ[types.String] {
panic(fmt.Sprintf("Slice element type mismatch: expected string, got %v", sliceType.Elem()))
}
fmt.Println("SUCCESS: Slice operations work correctly\n")
}
func testPointer() {
fmt.Println("\n=== Test Pointer ===")
ptrType := types.NewPointer(types.Typ[types.Int])
fmt.Printf("Pointer type: %v, Elem: %v\n", ptrType, ptrType.Elem())
if ptrType.Elem() != types.Typ[types.Int] {
panic(fmt.Sprintf("Pointer element type mismatch: expected int, got %v", ptrType.Elem()))
}
fmt.Println("SUCCESS: Pointer operations work correctly\n")
}
func testMap() {
fmt.Println("\n=== Test Map ===")
mapType := types.NewMap(types.Typ[types.String], types.Typ[types.Int])
fmt.Printf("Map type: %v, Key: %v, Elem: %v\n", mapType, mapType.Key(), mapType.Elem())
if mapType.Key() != types.Typ[types.String] {
panic(fmt.Sprintf("Map key type mismatch: expected string, got %v", mapType.Key()))
}
if mapType.Elem() != types.Typ[types.Int] {
panic(fmt.Sprintf("Map element type mismatch: expected int, got %v", mapType.Elem()))
}
fmt.Println("SUCCESS: Map operations work correctly\n")
}
func testChan() {
fmt.Println("\n=== Test Chan ===" )
chanType := types.NewChan(types.SendRecv, types.Typ[types.Int])
fmt.Printf("Chan type: %v, Dir: %v, Elem: %v\n", chanType, chanType.Dir(), chanType.Elem())
if chanType.Dir() != types.SendRecv {
panic(fmt.Sprintf("Chan direction mismatch: expected SendRecv, got %v", chanType.Dir()))
}
if chanType.Elem() != types.Typ[types.Int] {
panic(fmt.Sprintf("Chan element type mismatch: expected int, got %v", chanType.Elem()))
}
sendChan := types.NewChan(types.SendOnly, types.Typ[types.String])
fmt.Printf("SendOnly chan: %v, Dir: %v\n", sendChan, sendChan.Dir())
if sendChan.Dir() != types.SendOnly {
panic(fmt.Sprintf("SendOnly chan direction mismatch: expected SendOnly, got %v", sendChan.Dir()))
}
recvChan := types.NewChan(types.RecvOnly, types.Typ[types.Bool])
fmt.Printf("RecvOnly chan: %v, Dir: %v\n", recvChan, recvChan.Dir())
if recvChan.Dir() != types.RecvOnly {
panic(fmt.Sprintf("RecvOnly chan direction mismatch: expected RecvOnly, got %v", recvChan.Dir()))
}
fmt.Println("SUCCESS: Chan operations work correctly\n")
}
func testTypeComparison() {
fmt.Println("\n=== Test Type Comparison Functions ===")
t1 := types.Typ[types.Int]
t2 := types.Typ[types.Int]
t3 := types.Typ[types.String]
if !types.Identical(t1, t2) {
panic("Identical failed: int should be identical to int")
}
fmt.Printf("Identical(int, int): %v\n", types.Identical(t1, t2))
fmt.Printf("Identical(int, string): %v\n", types.Identical(t1, t3))
if !types.AssignableTo(t1, t2) {
panic("AssignableTo failed")
}
fmt.Printf("AssignableTo(int, int): %v\n", types.AssignableTo(t1, t2))
fmt.Printf("AssignableTo(int, string): %v\n", types.AssignableTo(t1, t3))
fmt.Printf("Comparable(int): %v\n", types.Comparable(t1))
fmt.Printf("Comparable(string): %v\n", types.Comparable(t3))
fmt.Printf("ConvertibleTo(int, int): %v\n", types.ConvertibleTo(t1, t2))
fmt.Println("SUCCESS: Type comparison functions work correctly\n")
}
func testTypeChecking() {
fmt.Println("\n=== Test Type Checking Functions ===")
pkg := types.NewPackage("example.com/test", "test")
m1 := types.NewFunc(token.NoPos, pkg, "Method1", types.NewSignatureType(nil, nil, nil, nil, nil, false))
m2 := types.NewFunc(token.NoPos, pkg, "Method2", types.NewSignatureType(nil, nil, nil, nil, nil, false))
iface := types.NewInterfaceType([]*types.Func{m1, m2}, nil)
iface.Complete()
fields := []*types.Var{
types.NewField(token.NoPos, nil, "x", types.Typ[types.Int], false),
}
structType := types.NewStruct(fields, nil)
fmt.Printf("Implements(struct, interface): %v\n", types.Implements(structType, iface))
fmt.Printf("Implements(int, interface): %v\n", types.Implements(types.Typ[types.Int], iface))
emptyIface := types.NewInterfaceType(nil, nil)
emptyIface.Complete()
fmt.Printf("Implements(int, empty interface): %v\n", types.Implements(types.Typ[types.Int], emptyIface))
fmt.Printf("AssertableTo(interface, int): %v\n", types.AssertableTo(iface, types.Typ[types.Int]))
fmt.Println("SUCCESS: Type checking functions work correctly\n")
}
func testStringFunctions() {
fmt.Println("\n=== Test String Functions ===")
pkg := types.NewPackage("example.com/test", "test")
varObj := types.NewVar(token.NoPos, pkg, "myVar", types.Typ[types.Int])
objStr := types.ObjectString(varObj, nil)
fmt.Printf("ObjectString: %s\n", objStr)
objStrQual := types.ObjectString(varObj, types.RelativeTo(pkg))
fmt.Printf("ObjectString (qualified): %s\n", objStrQual)
typeStr := types.TypeString(types.Typ[types.Int], nil)
fmt.Printf("TypeString(int): %s\n", typeStr)
sliceType := types.NewSlice(types.Typ[types.String])
sliceStr := types.TypeString(sliceType, nil)
fmt.Printf("TypeString([]string): %s\n", sliceStr)
fmt.Println("SUCCESS: String functions work correctly\n")
}
func testLookupFunctions() {
fmt.Println("\n=== Test Lookup Functions ===")
pkg := types.NewPackage("example.com/test", "test")
fields := []*types.Var{
types.NewField(token.NoPos, pkg, "X", types.Typ[types.Int], false),
types.NewField(token.NoPos, pkg, "Y", types.Typ[types.String], false),
}
structType := types.NewStruct(fields, nil)
obj, index, indirect := types.LookupFieldOrMethod(structType, false, pkg, "X")
if obj == nil {
panic("LookupFieldOrMethod failed to find X")
}
fmt.Printf("LookupFieldOrMethod found: %s, index: %v, indirect: %v\n", obj.Name(), index, indirect)
obj2, index2, indirect2 := types.LookupFieldOrMethod(structType, false, pkg, "NonExistent")
fmt.Printf("LookupFieldOrMethod (non-existent): found=%v, index=%v, indirect=%v\n", obj2 != nil, index2, indirect2)
mset := types.NewMethodSet(structType)
fmt.Printf("NewMethodSet: %d methods\n", mset.Len())
fmt.Println("SUCCESS: Lookup functions work correctly\n")
}
func testUtilityFunctions() {
fmt.Println("\n=== Test Utility Functions ===")
pkg := types.NewPackage("example.com/test", "test")
iface := types.NewInterfaceType(nil, nil)
iface.Complete()
fmt.Printf("IsInterface(interface): %v\n", types.IsInterface(iface))
fmt.Printf("IsInterface(int): %v\n", types.IsInterface(types.Typ[types.Int]))
typedNil := types.Typ[types.UntypedNil]
defaultType := types.Default(typedNil)
fmt.Printf("Default(UntypedNil): %v\n", defaultType)
intDefault := types.Default(types.Typ[types.Int])
fmt.Printf("Default(int): %v\n", intDefault)
idStr := types.Id(pkg, "MyType")
fmt.Printf("Id(pkg, \"MyType\"): %s\n", idStr)
fmt.Println("SUCCESS: Utility functions work correctly\n")
}

View File

@@ -0,0 +1,25 @@
package geometry1370
type Shape interface {
Area() float64
validate() bool
setID(int)
}
type Rectangle struct {
Width, Height float64
id int
}
func (r *Rectangle) Area() float64 { return r.Width * r.Height }
func (r *Rectangle) validate() bool { return r.Width > 0 && r.Height > 0 }
func (r *Rectangle) setID(id int) { r.id = id }
func (r *Rectangle) GetID() int { return r.id }
func NewRectangle(width, height float64) *Rectangle {
return &Rectangle{Width: width, Height: height}
}
func RegisterShape(s Shape, id int) {
s.setID(id)
}

View File

@@ -0,0 +1,90 @@
; ModuleID = 'github.com/goplus/llgo/cl/_testdata/geometry1370'
source_filename = "github.com/goplus/llgo/cl/_testdata/geometry1370"
%"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle" = type { double, double, i64 }
%"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr }
@"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) {
_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
%4 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %2, i32 0, i32 1
store double %0, ptr %3, align 8
store double %1, ptr %4, align 8
ret ptr %2
}
define double @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area"(ptr %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
%3 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 1
%4 = load double, ptr %3, align 8
%5 = fmul double %2, %4
ret double %5
}
define i64 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID"(ptr %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) {
_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) {
_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
%3 = fcmp ogt double %2, 0.000000e+00
br i1 %3, label %_llgo_1, label %_llgo_2
_llgo_1: ; preds = %_llgo_0
%4 = getelementptr inbounds %"github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", ptr %0, i32 0, i32 1
%5 = load double, ptr %4, align 8
%6 = fcmp ogt double %5, 0.000000e+00
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
%7 = phi i1 [ false, %_llgo_0 ], [ %6, %_llgo_1 ]
ret i1 %7
}
define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.RegisterShape"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0, i64 %1) {
_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
%4 = getelementptr ptr, ptr %3, i64 4
%5 = load ptr, ptr %4, align 8
%6 = insertvalue { ptr, ptr } undef, ptr %5, 0
%7 = insertvalue { ptr, ptr } %6, ptr %2, 1
%8 = extractvalue { ptr, ptr } %7, 1
%9 = extractvalue { ptr, ptr } %7, 0
call void %9(ptr %8, i64 %1)
ret void
}
define void @"github.com/goplus/llgo/cl/_testdata/geometry1370.init"() {
_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
_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.init$guard", align 1
br label %_llgo_2
_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.IfacePtrData"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")

View File

@@ -483,7 +483,7 @@ _llgo_7: ; preds = %_llgo_6
%17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %16, 0
%18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 0, 1
%19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 0, 2
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19)
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19)
store ptr %20, ptr @_llgo_any, align 8
br label %_llgo_8
@@ -499,7 +499,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6
%29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %28, 0
%30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 0, 1
%31 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30, i64 0, 2
%32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31)
%32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %31)
%33 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 1 }, ptr %32, i64 32, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%34 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 224)
%35 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %34, i64 0

View File

@@ -155,7 +155,7 @@ _llgo_5: ; preds = %_llgo_4
%44 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %42, 0
%45 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, i64 1, 1
%46 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %45, i64 1, 2
%47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46)
%47 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %46)
store ptr %47, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
br label %_llgo_6

View File

@@ -552,7 +552,7 @@ _llgo_16: ; preds = %_llgo_15, %_llgo_14
%48 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %46, 0
%49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %48, i64 1, 1
%50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %49, i64 1, 2
%51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50)
%51 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50)
store ptr %51, ptr @"github.com/goplus/llgo/cl/_testgo/ifaceconv.iface$brpgdLtIeRlPi8QUoTgPCXzlehUkncg7v9aITo-GsF4", align 8
%52 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 2 }, i64 25, i64 0, i64 1, i64 1)
%53 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceconv.C1", align 8
@@ -609,7 +609,7 @@ _llgo_20: ; preds = %_llgo_19, %_llgo_18
%85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %82, 0
%86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %85, i64 2, 1
%87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %86, i64 2, 2
%88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87)
%88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87)
store ptr %88, ptr @"github.com/goplus/llgo/cl/_testgo/ifaceconv.iface$gZBF8fFlqIMZ9M6lT2VWPyc3eu5Co6j0WoKGIEgDPAw", align 8
%89 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @14, i64 2 }, i64 25, i64 0, i64 2, i64 2)
%90 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceconv.C2", align 8

View File

@@ -527,7 +527,7 @@ _llgo_8: ; preds = %_llgo_7, %_llgo_6
%74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %71, 0
%75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74, i64 2, 1
%76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 2, 2
%77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76)
%77 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76)
store ptr %77, ptr @"github.com/goplus/llgo/cl/_testgo/ifaceprom.iface$zZ89tENb5h_KNjvpxf1TXPfaWFYn0IZrZwyVf42lRtA", align 8
%78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamedInterface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 1 })
%79 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/_testgo/ifaceprom.I", align 8

View File

@@ -417,7 +417,7 @@ _llgo_24: ; preds = %_llgo_23, %_llgo_22
%116 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %113, 0
%117 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %116, i64 2, 1
%118 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %117, i64 2, 2
%119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 43 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %118)
%119 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %118)
store ptr %119, ptr @"github.com/goplus/llgo/cl/_testgo/interface.iface$sO8a1LvuUsjXwiwaC6sR9-L4DiYgiOnZi7iosyShJXg", align 8
ret void
}

View File

@@ -0,0 +1,11 @@
package main
import (
"github.com/goplus/llgo/cl/_testdata/geometry1370"
)
func main() {
rect := geometry1370.NewRectangle(5.0, 3.0)
geometry1370.RegisterShape(rect, 42)
println("ID:", rect.GetID())
}

View File

@@ -0,0 +1,333 @@
; ModuleID = 'github.com/goplus/llgo/cl/_testgo/interface1370'
source_filename = "github.com/goplus/llgo/cl/_testgo/interface1370"
%"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr }
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
%"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 }
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 }
%"github.com/goplus/llgo/runtime/abi.Method" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, ptr, ptr }
%"github.com/goplus/llgo/runtime/abi.Imethod" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr }
@"github.com/goplus/llgo/cl/_testgo/interface1370.init$guard" = global i1 false, align 1
@"_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle" = linkonce global ptr null, align 8
@0 = private unnamed_addr constant [48 x i8] c"github.com/goplus/llgo/cl/_testdata/geometry1370", align 1
@1 = private unnamed_addr constant [9 x i8] c"Rectangle", align 1
@_llgo_float64 = linkonce global ptr null, align 8
@_llgo_int = linkonce global ptr null, align 8
@"github.com/goplus/llgo/cl/_testgo/interface1370.struct$EuRbjzGGO7GwkW6RxZGl-8lEjTdEMzAFD8LnY_SpVoQ" = linkonce global ptr null, align 8
@2 = private unnamed_addr constant [5 x i8] c"Width", align 1
@3 = private unnamed_addr constant [6 x i8] c"Height", align 1
@4 = private unnamed_addr constant [2 x i8] c"id", align 1
@5 = private unnamed_addr constant [47 x i8] c"github.com/goplus/llgo/cl/_testgo/interface1370", align 1
@6 = private unnamed_addr constant [4 x i8] c"Area", align 1
@"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8" = linkonce global ptr null, align 8
@7 = private unnamed_addr constant [5 x i8] c"GetID", align 1
@"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA" = linkonce global ptr null, align 8
@8 = private unnamed_addr constant [5 x i8] c"setID", align 1
@9 = private unnamed_addr constant [54 x i8] c"github.com/goplus/llgo/cl/_testdata/geometry1370.setID", align 1
@"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA" = linkonce global ptr null, align 8
@10 = private unnamed_addr constant [8 x i8] c"validate", align 1
@11 = private unnamed_addr constant [57 x i8] c"github.com/goplus/llgo/cl/_testdata/geometry1370.validate", align 1
@_llgo_bool = linkonce global ptr null, align 8
@"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk" = linkonce global ptr null, align 8
@"*_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle" = linkonce global ptr null, align 8
@"github.com/goplus/llgo/cl/_testgo/interface1370.iface$OopIVfjRcxQr1gmJyGi5G7hHt__vH05AREEM7PthH9o" = linkonce global ptr null, align 8
@12 = private unnamed_addr constant [3 x i8] c"ID:", align 1
define void @"github.com/goplus/llgo/cl/_testgo/interface1370.init"() {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.init$guard", align 1
call void @"github.com/goplus/llgo/cl/_testdata/geometry1370.init"()
call void @"github.com/goplus/llgo/cl/_testgo/interface1370.init$after"()
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}
define void @"github.com/goplus/llgo/cl/_testgo/interface1370.main"() {
_llgo_0:
%0 = call ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.NewRectangle"(double 5.000000e+00, double 3.000000e+00)
%1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
%2 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
%3 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8
%4 = load ptr, ptr @"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA", align 8
%5 = load ptr, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8
%6 = load ptr, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.iface$OopIVfjRcxQr1gmJyGi5G7hHt__vH05AREEM7PthH9o", align 8
%7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr %6, ptr %2)
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" undef, ptr %7, 0
%9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %8, ptr %0, 1
call void @"github.com/goplus/llgo/cl/_testdata/geometry1370.RegisterShape"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %9, i64 42)
%10 = call i64 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID"(ptr %0)
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintString"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @12, i64 3 })
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 32)
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64 %10)
call void @"github.com/goplus/llgo/runtime/internal/runtime.PrintByte"(i8 10)
ret void
}
declare void @"github.com/goplus/llgo/cl/_testdata/geometry1370.init"()
declare ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.NewRectangle"(double, double)
declare void @"github.com/goplus/llgo/cl/_testdata/geometry1370.RegisterShape"(%"github.com/goplus/llgo/runtime/internal/runtime.iface", i64)
define void @"github.com/goplus/llgo/cl/_testgo/interface1370.init$after"() {
_llgo_0:
%0 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 9 }, i64 25, i64 24, i64 0, i64 4)
%1 = load ptr, ptr @"_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
%2 = icmp eq ptr %1, null
br i1 %2, label %_llgo_1, label %_llgo_2
_llgo_1: ; preds = %_llgo_0
store ptr %0, ptr @"_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
%3 = load ptr, ptr @_llgo_float64, align 8
%4 = icmp eq ptr %3, null
br i1 %4, label %_llgo_3, label %_llgo_4
_llgo_3: ; preds = %_llgo_2
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 46)
store ptr %5, ptr @_llgo_float64, align 8
br label %_llgo_4
_llgo_4: ; preds = %_llgo_3, %_llgo_2
%6 = load ptr, ptr @_llgo_float64, align 8
%7 = load ptr, ptr @_llgo_int, align 8
%8 = icmp eq ptr %7, null
br i1 %8, label %_llgo_5, label %_llgo_6
_llgo_5: ; preds = %_llgo_4
%9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
store ptr %9, ptr @_llgo_int, align 8
br label %_llgo_6
_llgo_6: ; preds = %_llgo_5, %_llgo_4
%10 = load ptr, ptr @_llgo_int, align 8
%11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 46)
%12 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 5 }, ptr %11, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 46)
%14 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 6 }, ptr %13, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%15 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%16 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 2 }, ptr %15, i64 16, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 168)
%18 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %17, i64 0
store %"github.com/goplus/llgo/runtime/abi.StructField" %12, ptr %18, align 8
%19 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %17, i64 1
store %"github.com/goplus/llgo/runtime/abi.StructField" %14, ptr %19, align 8
%20 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %17, i64 2
store %"github.com/goplus/llgo/runtime/abi.StructField" %16, ptr %20, align 8
%21 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %17, 0
%22 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %21, i64 3, 1
%23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %22, i64 3, 2
%24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @5, i64 47 }, i64 24, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %23)
store ptr %24, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.struct$EuRbjzGGO7GwkW6RxZGl-8lEjTdEMzAFD8LnY_SpVoQ", align 8
%25 = load ptr, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.struct$EuRbjzGGO7GwkW6RxZGl-8lEjTdEMzAFD8LnY_SpVoQ", align 8
br i1 %2, label %_llgo_7, label %_llgo_8
_llgo_7: ; preds = %_llgo_6
%26 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8
%27 = icmp eq ptr %26, null
br i1 %27, label %_llgo_9, label %_llgo_10
_llgo_8: ; preds = %_llgo_18, %_llgo_6
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 48 }, %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 9 }, i64 25, i64 24, i64 0, i64 4)
%29 = load ptr, ptr @"*_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
%30 = icmp eq ptr %29, null
br i1 %30, label %_llgo_19, label %_llgo_20
_llgo_9: ; preds = %_llgo_7
%31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0)
%32 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %31, 0
%33 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %32, i64 0, 1
%34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %33, i64 0, 2
%35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 46)
%36 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
%37 = getelementptr ptr, ptr %36, i64 0
store ptr %35, ptr %37, align 8
%38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %36, 0
%39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, i64 1, 1
%40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 1, 2
%41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, i1 false)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %41)
store ptr %41, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8
br label %_llgo_10
_llgo_10: ; preds = %_llgo_9, %_llgo_7
%42 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8
%43 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }, ptr undef, ptr undef, ptr undef }, ptr %42, 1
%44 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %43, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area", 2
%45 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %44, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area", 3
%46 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8
%47 = icmp eq ptr %46, null
br i1 %47, label %_llgo_11, label %_llgo_12
_llgo_11: ; preds = %_llgo_10
%48 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0)
%49 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %48, 0
%50 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %49, i64 0, 1
%51 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %50, i64 0, 2
%52 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%53 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
%54 = getelementptr ptr, ptr %53, i64 0
store ptr %52, ptr %54, align 8
%55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %53, 0
%56 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55, i64 1, 1
%57 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %56, i64 1, 2
%58 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %51, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %57, i1 false)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %58)
store ptr %58, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8
br label %_llgo_12
_llgo_12: ; preds = %_llgo_11, %_llgo_10
%59 = load ptr, ptr @"_llgo_func$ETeB8WwW04JEq0ztcm-XPTJtuYvtpkjIsAc0-2NT9zA", align 8
%60 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @7, i64 5 }, ptr undef, ptr undef, ptr undef }, ptr %59, 1
%61 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %60, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID", 2
%62 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %61, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID", 3
%63 = load ptr, ptr @"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA", align 8
%64 = icmp eq ptr %63, null
br i1 %64, label %_llgo_13, label %_llgo_14
_llgo_13: ; preds = %_llgo_12
%65 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%66 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
%67 = getelementptr ptr, ptr %66, i64 0
store ptr %65, ptr %67, align 8
%68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %66, 0
%69 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68, i64 1, 1
%70 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %69, i64 1, 2
%71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0)
%72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %71, 0
%73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, i64 0, 1
%74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73, i64 0, 2
%75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %70, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74, i1 false)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %75)
store ptr %75, ptr @"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA", align 8
br label %_llgo_14
_llgo_14: ; preds = %_llgo_13, %_llgo_12
%76 = load ptr, ptr @"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA", align 8
%77 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 54 }, ptr undef, ptr undef, ptr undef }, ptr %76, 1
%78 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %77, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).setID", 2
%79 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %78, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).setID", 3
%80 = load ptr, ptr @_llgo_bool, align 8
%81 = icmp eq ptr %80, null
br i1 %81, label %_llgo_15, label %_llgo_16
_llgo_15: ; preds = %_llgo_14
%82 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 33)
store ptr %82, ptr @_llgo_bool, align 8
br label %_llgo_16
_llgo_16: ; preds = %_llgo_15, %_llgo_14
%83 = load ptr, ptr @_llgo_bool, align 8
%84 = load ptr, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8
%85 = icmp eq ptr %84, null
br i1 %85, label %_llgo_17, label %_llgo_18
_llgo_17: ; preds = %_llgo_16
%86 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0)
%87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %86, 0
%88 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87, i64 0, 1
%89 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %88, i64 0, 2
%90 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 33)
%91 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
%92 = getelementptr ptr, ptr %91, i64 0
store ptr %90, ptr %92, align 8
%93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %91, 0
%94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, i64 1, 1
%95 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94, i64 1, 2
%96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice" %89, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %95, i1 false)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %96)
store ptr %96, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8
br label %_llgo_18
_llgo_18: ; preds = %_llgo_17, %_llgo_16
%97 = load ptr, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8
%98 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 57 }, ptr undef, ptr undef, ptr undef }, ptr %97, 1
%99 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %98, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).validate", 2
%100 = insertvalue %"github.com/goplus/llgo/runtime/abi.Method" %99, ptr @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).validate", 3
%101 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 160)
%102 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %101, i64 0
store %"github.com/goplus/llgo/runtime/abi.Method" %45, ptr %102, align 8
%103 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %101, i64 1
store %"github.com/goplus/llgo/runtime/abi.Method" %62, ptr %103, align 8
%104 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %101, i64 2
store %"github.com/goplus/llgo/runtime/abi.Method" %79, ptr %104, align 8
%105 = getelementptr %"github.com/goplus/llgo/runtime/abi.Method", ptr %101, i64 3
store %"github.com/goplus/llgo/runtime/abi.Method" %100, ptr %105, align 8
%106 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %101, 0
%107 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %106, i64 4, 1
%108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %107, i64 4, 2
call void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr %0, ptr %25, { ptr, i64, i64 } zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %108)
br label %_llgo_8
_llgo_19: ; preds = %_llgo_8
%109 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr %28)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %109)
store ptr %109, ptr @"*_llgo_github.com/goplus/llgo/cl/_testdata/geometry1370.Rectangle", align 8
br label %_llgo_20
_llgo_20: ; preds = %_llgo_19, %_llgo_8
%110 = load ptr, ptr @"_llgo_func$UYiLlmcWxoOKZPPzvR4LByitNeKoVGoTrB_5ubdOWW8", align 8
%111 = load ptr, ptr @"_llgo_func$VZ-8VPNF1RaLICwxc1Ghn7BbgyFX3v762OCdx127EkA", align 8
%112 = load ptr, ptr @"_llgo_func$YHeRw3AOvQtzv982-ZO3Yn8vh3Fx89RM3VvI8E4iKVk", align 8
%113 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @6, i64 4 }, ptr undef }, ptr %110, 1
%114 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @9, i64 54 }, ptr undef }, ptr %111, 1
%115 = insertvalue %"github.com/goplus/llgo/runtime/abi.Imethod" { %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @11, i64 57 }, ptr undef }, ptr %112, 1
%116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 72)
%117 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %116, i64 0
store %"github.com/goplus/llgo/runtime/abi.Imethod" %113, ptr %117, align 8
%118 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %116, i64 1
store %"github.com/goplus/llgo/runtime/abi.Imethod" %114, ptr %118, align 8
%119 = getelementptr %"github.com/goplus/llgo/runtime/abi.Imethod", ptr %116, i64 2
store %"github.com/goplus/llgo/runtime/abi.Imethod" %115, ptr %119, align 8
%120 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %116, 0
%121 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %120, i64 3, 1
%122 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %121, i64 3, 2
%123 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122)
store ptr %123, ptr @"github.com/goplus/llgo/cl/_testgo/interface1370.iface$OopIVfjRcxQr1gmJyGi5G7hHt__vH05AREEM7PthH9o", align 8
ret void
}
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewNamed"(%"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.String", i64, i64, i64, i64)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String", i64, %"github.com/goplus/llgo/runtime/internal/runtime.Slice")
declare %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.InitNamed"(ptr, ptr, %"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.Slice")
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Func"(%"github.com/goplus/llgo/runtime/internal/runtime.Slice", %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr)
declare double @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).Area"(ptr)
declare i64 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).GetID"(ptr)
declare void @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).setID"(ptr, i64)
declare i1 @"github.com/goplus/llgo/cl/_testdata/geometry1370.(*Rectangle).validate"(ptr)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.PointerTo"(ptr)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String", %"github.com/goplus/llgo/runtime/internal/runtime.Slice")
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.NewItab"(ptr, ptr)
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.PrintByte"(i8)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.PrintInt"(i64)

View File

@@ -596,7 +596,7 @@ _llgo_13: ; preds = %_llgo_6
%72 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %70, 0
%73 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %72, i64 1, 1
%74 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %73, i64 1, 2
%75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74)
%75 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %74)
store ptr %75, ptr @"_llgo_iface$uRUteI7wmSy7y7ODhGzk0FdDaxGKMhVSSu6HZEv9aa0", align 8
br label %_llgo_14
@@ -994,7 +994,7 @@ _llgo_61: ; preds = %_llgo_60
%275 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %272, 0
%276 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %275, i64 2, 1
%277 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %276, i64 2, 2
%278 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %277)
%278 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %277)
store ptr %278, ptr @"_llgo_iface$jwmSdgh1zvY_TDIgLzCkvkbiyrdwl9N806DH0JGcyMI", align 8
br label %_llgo_62
@@ -1033,7 +1033,7 @@ _llgo_67: ; preds = %_llgo_66
%292 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %291, 0
%293 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %292, i64 0, 1
%294 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %293, i64 0, 2
%295 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @8, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %294)
%295 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %294)
store ptr %295, ptr @_llgo_any, align 8
br label %_llgo_68

View File

@@ -1149,7 +1149,7 @@ _llgo_29: ; preds = %_llgo_28
%107 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %105, 0
%108 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %107, i64 1, 1
%109 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %108, i64 1, 2
%110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %109)
%110 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %109)
store ptr %110, ptr @"_llgo_iface$p5Bo_emI1h8acs1rFbUxZTrpeDbIQ34gFcsbwK9YIgs", align 8
br label %_llgo_30
@@ -1275,7 +1275,7 @@ _llgo_37: ; preds = %_llgo_36
%190 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %187, 0
%191 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %190, i64 2, 1
%192 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %191, i64 2, 2
%193 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %192)
%193 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %192)
store ptr %193, ptr @"_llgo_iface$2bmbYDBStAIdmbXPPn7qIaCcpVcj2I5k6AqgqwAfh84", align 8
br label %_llgo_38
@@ -1380,7 +1380,7 @@ _llgo_45: ; preds = %_llgo_44
%255 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %253, 0
%256 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %255, i64 1, 1
%257 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %256, i64 1, 2
%258 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %257)
%258 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %257)
store ptr %258, ptr @"_llgo_iface$Ly4zXiUMEac-hYAMw6b6miJ1JEhGfLyBWyBOhpsRZcU", align 8
br label %_llgo_46
@@ -1661,7 +1661,7 @@ _llgo_61: ; preds = %_llgo_60
%440 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %438, 0
%441 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %440, i64 1, 1
%442 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %441, i64 1, 2
%443 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %442)
%443 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %442)
store ptr %443, ptr @"_llgo_iface$uycIKA3bbxRhudEjW1hHKWKdLqHQsCVy8NdW1bkQmNw", align 8
br label %_llgo_62
@@ -1707,7 +1707,7 @@ _llgo_63: ; preds = %_llgo_62
%471 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %469, 0
%472 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %471, i64 1, 1
%473 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %472, i64 1, 2
%474 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %473)
%474 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %473)
store ptr %474, ptr @"_llgo_iface$Fh8eUJ-Gw4e6TYuajcFIOSCuqSPKAt5nS4ow7xeGXEU", align 8
br label %_llgo_64

View File

@@ -1220,7 +1220,7 @@ _llgo_15: ; preds = %_llgo_14
%78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %76, 0
%79 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %78, i64 1, 1
%80 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %79, i64 1, 2
%81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80)
%81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %80)
store ptr %81, ptr @"_llgo_iface$VdBKYV8-gcMjZtZfcf-u2oKoj9Lu3VXwuG8TGCW2S4A", align 8
br label %_llgo_16
@@ -1234,7 +1234,7 @@ _llgo_17: ; preds = %_llgo_16
%85 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %84, 0
%86 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %85, i64 0, 1
%87 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %86, i64 0, 2
%88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87)
%88 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %87)
store ptr %88, ptr @_llgo_any, align 8
br label %_llgo_18
@@ -1248,7 +1248,7 @@ _llgo_19: ; preds = %_llgo_18
%92 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %91, 0
%93 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %92, i64 0, 1
%94 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %93, i64 0, 2
%95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94)
%95 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %94)
%96 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %95)
store ptr %96, ptr @"[]_llgo_any", align 8
br label %_llgo_20
@@ -1272,7 +1272,7 @@ _llgo_21: ; preds = %_llgo_20
%109 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %108, 0
%110 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %109, i64 0, 1
%111 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %110, i64 0, 2
%112 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %111)
%112 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %111)
%113 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %112)
%114 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80)
%115 = getelementptr ptr, ptr %114, i64 0
@@ -1327,7 +1327,7 @@ _llgo_22: ; preds = %_llgo_21, %_llgo_20
%147 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %146, 0
%148 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %147, i64 0, 1
%149 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %148, i64 0, 2
%150 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %149)
%150 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %149)
%151 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %150)
%152 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 80)
%153 = getelementptr ptr, ptr %152, i64 0

View File

@@ -302,7 +302,7 @@ _llgo_11: ; preds = %_llgo_10
%53 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %51, 0
%54 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %53, i64 1, 1
%55 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %54, i64 1, 2
%56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55)
%56 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %55)
store ptr %56, ptr @"_llgo_iface$Jvxc0PCI_drlfK7S5npMGdZkQLeRkQ_x2e2CifPE6w8", align 8
br label %_llgo_12
@@ -419,7 +419,7 @@ _llgo_25: ; preds = %_llgo_24
%113 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %111, 0
%114 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %113, i64 1, 1
%115 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %114, i64 1, 2
%116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115)
%116 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %115)
store ptr %116, ptr @"_llgo_iface$2dxw6yZ6V86Spb7J0dTDIoWqg7ba7UDXlAlpJv3-HLk", align 8
br label %_llgo_26
@@ -432,7 +432,7 @@ _llgo_26: ; preds = %_llgo_25, %_llgo_24
%121 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %119, 0
%122 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %121, i64 1, 1
%123 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %122, i64 1, 2
%124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 40 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123)
%124 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %123)
store ptr %124, ptr @"github.com/goplus/llgo/cl/_testgo/tpinst.iface$2sV9fFeqOv1SzesvwIdhTqCFzDT8ZX5buKUSAoHNSww", align 8
ret void
}

View File

@@ -9,12 +9,12 @@ source_filename = "github.com/goplus/llgo/cl/_testrt/asmfull"
@"github.com/goplus/llgo/cl/_testrt/asmfull.init$guard" = global i1 false, align 1
@_llgo_string = linkonce global ptr null, align 8
@_llgo_any = linkonce global ptr null, align 8
@0 = private unnamed_addr constant [41 x i8] c"github.com/goplus/llgo/cl/_testrt/asmfull", align 1
@"map[_llgo_string]_llgo_any" = linkonce global ptr null, align 8
@1 = private unnamed_addr constant [7 x i8] c"topbits", align 1
@2 = private unnamed_addr constant [4 x i8] c"keys", align 1
@3 = private unnamed_addr constant [5 x i8] c"elems", align 1
@4 = private unnamed_addr constant [8 x i8] c"overflow", align 1
@0 = private unnamed_addr constant [7 x i8] c"topbits", align 1
@1 = private unnamed_addr constant [4 x i8] c"keys", align 1
@2 = private unnamed_addr constant [5 x i8] c"elems", align 1
@3 = private unnamed_addr constant [8 x i8] c"overflow", align 1
@4 = private unnamed_addr constant [41 x i8] c"github.com/goplus/llgo/cl/_testrt/asmfull", align 1
@_llgo_int = linkonce global ptr null, align 8
@5 = private unnamed_addr constant [5 x i8] c"value", align 1
@6 = private unnamed_addr constant [7 x i8] c"Result:", align 1
@@ -113,7 +113,7 @@ _llgo_3: ; preds = %_llgo_2
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %5, 0
%7 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %6, i64 0, 1
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %7, i64 0, 2
%9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8)
%9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %8)
store ptr %9, ptr @_llgo_any, align 8
br label %_llgo_4
@@ -128,22 +128,22 @@ _llgo_5: ; preds = %_llgo_4
%14 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %13, 0
%15 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %14, i64 0, 1
%16 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %15, i64 0, 2
%17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16)
%17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %16)
%18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40)
%19 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %18)
%20 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 7 }, ptr %19, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%20 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }, ptr %19, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 24)
%22 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %21)
%23 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 4 }, ptr %22, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%23 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %22, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 0)
%25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %24, 0
%26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25, i64 0, 1
%27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 0, 2
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27)
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27)
%29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %28)
%30 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 5 }, ptr %29, i64 136, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%30 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 5 }, ptr %29, i64 136, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 58)
%32 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 8 }, ptr %31, i64 264, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%32 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 8 }, ptr %31, i64 264, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%33 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 224)
%34 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %33, i64 0
store %"github.com/goplus/llgo/runtime/abi.StructField" %20, ptr %34, align 8
@@ -156,7 +156,7 @@ _llgo_5: ; preds = %_llgo_4
%38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0
%39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, i64 4, 1
%40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 4, 2
%41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 41 }, i64 272, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40)
%41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 41 }, i64 272, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40)
%42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %12, ptr %17, ptr %41, i64 12)
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %42)
store ptr %42, ptr @"map[_llgo_string]_llgo_any", align 8

View File

@@ -958,7 +958,7 @@ _llgo_9: ; preds = %_llgo_8
%59 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %58, 0
%60 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %59, i64 0, 1
%61 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %60, i64 0, 2
%62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61)
%62 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %61)
store ptr %62, ptr @_llgo_any, align 8
br label %_llgo_10
@@ -972,7 +972,7 @@ _llgo_11: ; preds = %_llgo_10
%66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %65, 0
%67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66, i64 0, 1
%68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %67, i64 0, 2
%69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68)
%69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68)
%70 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
%71 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40)
%72 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %71)
@@ -981,7 +981,7 @@ _llgo_11: ; preds = %_llgo_10
%75 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %74, 0
%76 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %75, i64 0, 1
%77 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %76, i64 0, 2
%78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 41 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77)
%78 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %77)
%79 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %78)
%80 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %79, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%81 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)

View File

@@ -278,7 +278,7 @@ _llgo_13: ; preds = %_llgo_12
%66 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %64, 0
%67 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %66, i64 1, 1
%68 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %67, i64 1, 2
%69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68)
%69 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %68)
store ptr %69, ptr @"_llgo_iface$BP0p_lUsEd-IbbtJVukGmgrdQkqzcoYzSiwgUvgFvUs", align 8
br label %_llgo_14

View File

@@ -200,7 +200,7 @@ _llgo_13: ; preds = %_llgo_12
%28 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %27, 0
%29 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %28, i64 0, 1
%30 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %29, i64 0, 2
%31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30)
%31 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %30)
store ptr %31, ptr @_llgo_any, align 8
br label %_llgo_14
@@ -210,7 +210,7 @@ _llgo_14: ; preds = %_llgo_13, %_llgo_12
%34 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %33, 0
%35 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %34, i64 0, 1
%36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %35, i64 0, 2
%37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 39 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36)
%37 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %36)
%38 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 1 }, ptr %37, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
%39 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 56)
%40 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %39, i64 0

View File

@@ -538,7 +538,7 @@ _llgo_21: ; preds = %_llgo_20
%256 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %254, 0
%257 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %256, i64 1, 1
%258 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %257, i64 1, 2
%259 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 42 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %258)
%259 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %258)
store ptr %259, ptr @"_llgo_iface$kSla6xFkiJD3PX1RdCGebCgULXloNxgSHKPEQsXsqos", align 8
br label %_llgo_22

View File

@@ -211,7 +211,7 @@ _llgo_9: ; preds = %_llgo_7
%17 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %16, 0
%18 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %17, i64 0, 1
%19 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %18, i64 0, 2
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 42 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19)
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %19)
store ptr %20, ptr @_llgo_any, align 8
br label %_llgo_10
@@ -226,7 +226,7 @@ _llgo_11: ; preds = %_llgo_10
%25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %24, 0
%26 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25, i64 0, 1
%27 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %26, i64 0, 2
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 42 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27)
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %27)
%29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %28)
store ptr %29, ptr @"[]_llgo_any", align 8
br label %_llgo_12
@@ -253,7 +253,7 @@ _llgo_15: ; preds = %_llgo_14
%38 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %37, 0
%39 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %38, i64 0, 1
%40 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %39, i64 0, 2
%41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 42 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40)
%41 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40)
%42 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %41)
%43 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
%44 = getelementptr ptr, ptr %43, i64 0
@@ -437,7 +437,7 @@ _llgo_31: ; preds = %_llgo_30
%146 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %143, 0
%147 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %146, i64 2, 1
%148 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %147, i64 2, 2
%149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 42 }, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %148)
%149 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Interface"(%"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %148)
store ptr %149, ptr @"_llgo_iface$a85zs5wWQQoPIERm_en8plssh4spdIeeXZPC-E0TDh0", align 8
br label %_llgo_32

View File

@@ -396,7 +396,7 @@ func findMethod(mthds []abi.Method, im abi.Imethod) abi.Text {
}
func methods(u *abi.UncommonType, from string) []abi.Method {
if u.PkgPath_ == from {
if from == "" || u.PkgPath_ == from {
return u.Methods()
}
return u.ExportedMethods()

View File

@@ -199,7 +199,7 @@ func (b Builder) abiInterfaceOf(t *types.Interface) func() Expr {
fn := pkg.rtFunc("Interface")
tSlice := lastParamType(prog, fn)
methodSlice := b.SliceLit(tSlice, methods...)
return b.Call(fn, b.Str(pkg.Path()), methodSlice)
return b.Call(fn, b.Str(""), methodSlice)
}
}