TestErrCompileInstrOrValue
This commit is contained in:
@@ -25,6 +25,18 @@ import (
|
|||||||
"golang.org/x/tools/go/ssa"
|
"golang.org/x/tools/go/ssa"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestErrCompileInstrOrValue(t *testing.T) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r == nil {
|
||||||
|
t.Fatal("compileInstrOrValue: no error?")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
ctx := &context{
|
||||||
|
bvals: make(map[ssa.Value]llssa.Expr),
|
||||||
|
}
|
||||||
|
ctx.compileInstrOrValue(nil, &ssa.Call{}, true)
|
||||||
|
}
|
||||||
|
|
||||||
func TestErrAdvance(t *testing.T) {
|
func TestErrAdvance(t *testing.T) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r == nil {
|
if r := recover(); r == nil {
|
||||||
|
|||||||
@@ -587,14 +587,11 @@ func (p *context) compileValue(b llssa.Builder, v ssa.Value) llssa.Expr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *ssa.Function:
|
case *ssa.Function:
|
||||||
panic("unreachable")
|
fn, ftype := p.funcOf(v)
|
||||||
/*
|
if ftype >= llgoInstrBase {
|
||||||
fn, ftype := p.funcOf(v)
|
panic("can't use llgo instruction as a value")
|
||||||
if ftype >= llgoInstrBase {
|
}
|
||||||
panic("can't use llgo instruction as a value")
|
return fn.Expr
|
||||||
}
|
|
||||||
return fn.Expr
|
|
||||||
*/
|
|
||||||
case *ssa.Global:
|
case *ssa.Global:
|
||||||
g := p.varOf(v)
|
g := p.varOf(v)
|
||||||
return g.Expr
|
return g.Expr
|
||||||
|
|||||||
Reference in New Issue
Block a user