Extended Berkeley Packet Filter (eBPF) assembler and virtual machine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
501 B

package ebpf
import "testing"
func TestALU(t *testing.T) {
testInstructionSuite{
{
Test: Negate{R1},
WantRaw: RawInstruction{
Op: opClassALU | aluSourceImmediate | Opcode(aluOpNegate),
Dst: R1,
},
WantString: "neg32 R1",
},
}.Run(t)
}
func TestALU64(t *testing.T) {
testInstructionSuite{
{
Test: Negate64{R1},
WantRaw: RawInstruction{
Op: opClassALU64 | aluSourceImmediate | Opcode(aluOpNegate),
Dst: R1,
},
WantString: "neg R1",
},
}.Run(t)
}