This commit is contained in:
xushiwei
2024-04-17 00:01:42 +08:00
parent 70ec2350eb
commit 2596f1d5b2
4 changed files with 29 additions and 1 deletions

View File

@@ -78,3 +78,16 @@ source_filename = "foo/bar"
@a = external global %Empty
`)
}
func TestFunc(t *testing.T) {
prog := NewProgram(nil)
pkg := prog.NewPackage("bar", "foo/bar")
params := types.NewTuple(types.NewVar(0, nil, "a", types.Typ[types.Int]))
sig := types.NewSignatureType(nil, nil, nil, params, nil, false)
pkg.NewFunc("fn", sig)
assertPkg(t, pkg, `; ModuleID = 'foo/bar'
source_filename = "foo/bar"
declare void @fn(i64)
`)
}