1
.github/workflows/llgo.yml
vendored
1
.github/workflows/llgo.yml
vendored
@@ -165,6 +165,7 @@ jobs:
|
|||||||
|
|
||||||
- name: run llgo test
|
- name: run llgo test
|
||||||
run: |
|
run: |
|
||||||
|
llgo test ./...
|
||||||
cd _demo
|
cd _demo
|
||||||
llgo test -v ./runtest
|
llgo test -v ./runtest
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -175,6 +175,14 @@ func Do(args []string, conf *Config) ([]Package, error) {
|
|||||||
}
|
}
|
||||||
case ModeRun:
|
case ModeRun:
|
||||||
return nil, fmt.Errorf("cannot run multiple packages")
|
return nil, fmt.Errorf("cannot run multiple packages")
|
||||||
|
case ModeTest:
|
||||||
|
newInitial := make([]*packages.Package, 0, len(initial))
|
||||||
|
for _, pkg := range initial {
|
||||||
|
if needLink(pkg, mode) {
|
||||||
|
newInitial = append(newInitial, pkg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
initial = newInitial
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package buildtags
|
package buildtags
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
3
compiler/internal/env/env_test.go
vendored
3
compiler/internal/env/env_test.go
vendored
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package env
|
package env
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -387,14 +387,13 @@ func (p Program) NewPackage(name, pkgPath string) Package {
|
|||||||
pyobjs := make(map[string]PyObjRef)
|
pyobjs := make(map[string]PyObjRef)
|
||||||
pymods := make(map[string]Global)
|
pymods := make(map[string]Global)
|
||||||
strs := make(map[string]llvm.Value)
|
strs := make(map[string]llvm.Value)
|
||||||
goStrs := make(map[string]llvm.Value)
|
|
||||||
chkabi := make(map[types.Type]bool)
|
chkabi := make(map[types.Type]bool)
|
||||||
glbDbgVars := make(map[Expr]bool)
|
glbDbgVars := make(map[Expr]bool)
|
||||||
// Don't need reset p.needPyInit here
|
// Don't need reset p.needPyInit here
|
||||||
// p.needPyInit = false
|
// p.needPyInit = false
|
||||||
ret := &aPackage{
|
ret := &aPackage{
|
||||||
mod: mod, vars: gbls, fns: fns, stubs: stubs,
|
mod: mod, vars: gbls, fns: fns, stubs: stubs,
|
||||||
pyobjs: pyobjs, pymods: pymods, strs: strs, goStrs: goStrs,
|
pyobjs: pyobjs, pymods: pymods, strs: strs,
|
||||||
chkabi: chkabi, Prog: p,
|
chkabi: chkabi, Prog: p,
|
||||||
di: nil, cu: nil, glbDbgVars: glbDbgVars,
|
di: nil, cu: nil, glbDbgVars: glbDbgVars,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package ssatest
|
package ssatest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
package abi
|
package abi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
21
test/c_test.go
Normal file
21
test/c_test.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
//go:build llgo
|
||||||
|
// +build llgo
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/goplus/llgo/c"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Can't put it in c/ package because it is marked as 'decl'
|
||||||
|
func TestCstr(t *testing.T) {
|
||||||
|
cstr := c.Str("foo")
|
||||||
|
if cstr == nil {
|
||||||
|
t.Fatal("cstr() returned nil")
|
||||||
|
}
|
||||||
|
if c.Strlen(cstr) != 3 {
|
||||||
|
t.Fatal("cstr() returned invalid length")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//go:build !llgo
|
||||||
|
// +build !llgo
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
|
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user