cl: _testdata/printf: almost done

This commit is contained in:
xushiwei
2024-04-21 15:12:57 +08:00
parent 8f31e4a6d3
commit 4641cb11eb
12 changed files with 305 additions and 265 deletions

View File

@@ -25,6 +25,7 @@ import (
func init() {
Initialize(InitAll)
SetDebug(DbgFlagAll)
}
func assertPkg(t *testing.T, p Package, expected string) {
@@ -55,7 +56,7 @@ func TestConst(t *testing.T) {
rets := types.NewTuple(types.NewVar(0, nil, "", types.Typ[types.Bool]))
sig := types.NewSignatureType(nil, nil, nil, nil, rets, false)
b := pkg.NewFunc("fn", sig).MakeBody(1)
b.Return(b.Const(constant.MakeBool(true), types.Typ[types.Bool]))
b.Return(b.Const(constant.MakeBool(true), prog.Bool()))
assertPkg(t, pkg, `; ModuleID = 'foo/bar'
source_filename = "foo/bar"