From f9ef9cab8157c0f225d2444ce9a81c53947e8a50 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sun, 12 May 2024 11:22:55 +0800 Subject: [PATCH] TestSetBlockEx --- ssa/ssa_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ssa/ssa_test.go b/ssa/ssa_test.go index 17b7ccf5..08f00f2d 100644 --- a/ssa/ssa_test.go +++ b/ssa/ssa_test.go @@ -25,6 +25,28 @@ import ( "github.com/goplus/llvm" ) +func TestSetBlock(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Log("SetBlock: no error?") + } + }() + fn := &aFunction{} + b := &aBuilder{Func: fn} + b.SetBlock(&aBasicBlock{}) +} + +func TestSetBlockEx(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Log("SetBlockEx: no error?") + } + }() + fn := &aFunction{} + b := &aBuilder{Func: fn} + b.SetBlockEx(&aBasicBlock{fn: fn}, -1) +} + func TestSetPython(t *testing.T) { prog := NewProgram(nil) typ := types.NewPackage("foo", "foo")