aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-12-16 12:38:49 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-12-17 11:39:14 +0100
commita33677f8bfabac326dc2446637e626b3b6fc15ab (patch)
treee199430e884072b57ba83fc26540d26174218f8d /prog/encodingexec_test.go
parentfea5478f4686624974d34edd8b4268d7a6af9584 (diff)
prog: use dense indexes for copyout instructions
Fixes #174
Diffstat (limited to 'prog/encodingexec_test.go')
-rw-r--r--prog/encodingexec_test.go44
1 files changed, 22 insertions, 22 deletions
diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go
index 8a0325f0a..15d58d873 100644
--- a/prog/encodingexec_test.go
+++ b/prog/encodingexec_test.go
@@ -48,23 +48,23 @@ func TestSerializeForExec(t *testing.T) {
{
"syz_test()",
[]uint64{
- callID("syz_test"), 0,
+ callID("syz_test"), ExecNoCopyout, 0,
execInstrEOF,
},
&ExecProg{
Calls: []ExecCall{
{
Meta: target.SyscallMap["syz_test"],
- Index: 0,
+ Index: ExecNoCopyout,
},
},
- NumVars: 1,
+ NumVars: 0,
},
},
{
"syz_test$int(0x1, 0x2, 0x3, 0x4, 0x5)",
[]uint64{
- callID("syz_test$int"), 5,
+ callID("syz_test$int"), ExecNoCopyout, 5,
execArgConst, 8, 1, 0, 0,
execArgConst, 1, 2, 0, 0,
execArgConst, 2, 3, 0, 0,
@@ -82,7 +82,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 8, execArgConst, 1, 3, 0, 0,
execInstrCopyin, dataOffset + 10, execArgConst, 2, 4, 0, 0,
execInstrCopyin, dataOffset + 16, execArgConst, 8, 5, 0, 0,
- callID("syz_test$align0"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align0"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -95,7 +95,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 6, execArgConst, 1, 3, 0, 0,
execInstrCopyin, dataOffset + 7, execArgConst, 2, 4, 0, 0,
execInstrCopyin, dataOffset + 9, execArgConst, 8, 5, 0, 0,
- callID("syz_test$align1"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align1"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -106,7 +106,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 1, 0x42, 0, 0,
execInstrCopyin, dataOffset + 1, execArgConst, 2, 0x43, 0, 0,
execInstrCopyin, dataOffset + 4, execArgConst, 2, 0x44, 0, 0,
- callID("syz_test$align2"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align2"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -117,7 +117,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 1, 0x42, 0, 0,
execInstrCopyin, dataOffset + 1, execArgConst, 1, 0x43, 0, 0,
execInstrCopyin, dataOffset + 4, execArgConst, 1, 0x44, 0, 0,
- callID("syz_test$align3"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align3"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -128,7 +128,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 1, 0x42, 0, 0,
execInstrCopyin, dataOffset + 1, execArgConst, 2, 0x43, 0, 0,
execInstrCopyin, dataOffset + 4, execArgConst, 1, 0x44, 0, 0,
- callID("syz_test$align4"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align4"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -142,7 +142,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 18, execArgConst, 2, 0x45, 0, 0,
execInstrCopyin, dataOffset + 20, execArgConst, 2, 0x46, 0, 0,
execInstrCopyin, dataOffset + 22, execArgConst, 1, 0x47, 0, 0,
- callID("syz_test$align5"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align5"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -152,7 +152,7 @@ func TestSerializeForExec(t *testing.T) {
[]uint64{
execInstrCopyin, dataOffset + 0, execArgConst, 1, 0x42, 0, 0,
execInstrCopyin, dataOffset + 4, execArgConst, 4, 0x43, 0, 0,
- callID("syz_test$align6"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$align6"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -162,7 +162,7 @@ func TestSerializeForExec(t *testing.T) {
[]uint64{
execInstrCopyin, dataOffset + 0, execArgConst, 8, 1, 0, 0,
execInstrCopyin, dataOffset + 8, execArgConst, 1, 2, 0, 0,
- callID("syz_test$union0"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$union0"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -172,7 +172,7 @@ func TestSerializeForExec(t *testing.T) {
[]uint64{
execInstrCopyin, dataOffset + 0, execArgConst, 4, 0x42, 0, 0,
execInstrCopyin, dataOffset + 8, execArgConst, 1, 0x43, 0, 0,
- callID("syz_test$union1"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$union1"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -182,7 +182,7 @@ func TestSerializeForExec(t *testing.T) {
[]uint64{
execInstrCopyin, dataOffset + 0, execArgConst, 4, 0x42, 0, 0,
execInstrCopyin, dataOffset + 4, execArgConst, 1, 0x43, 0, 0,
- callID("syz_test$union2"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$union2"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -194,7 +194,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 1, execArgConst, 2, 2, 0, 0,
execInstrCopyin, dataOffset + 3, execArgConst, 8, 3, 0, 0,
execInstrCopyin, dataOffset + 11, execArgConst, 8, 4, 0, 0,
- callID("syz_test$array0"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$array0"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -204,7 +204,7 @@ func TestSerializeForExec(t *testing.T) {
[]uint64{
execInstrCopyin, dataOffset + 0, execArgConst, 1, 0x42, 0, 0,
execInstrCopyin, dataOffset + 1, execArgData, 5, 0x0504030201,
- callID("syz_test$array1"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$array1"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -215,7 +215,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 2, 0x42, 0, 0,
execInstrCopyin, dataOffset + 2, execArgData, 16, 0xbbbbbbbbaaaaaaaa, 0xddddddddcccccccc,
execInstrCopyin, dataOffset + 18, execArgConst, 2, 0x43, 0, 0,
- callID("syz_test$array2"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$array2"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -227,7 +227,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 1, execArgConst, 2, 0x4200, 0, 0,
execInstrCopyin, dataOffset + 3, execArgConst, 4, 0x42000000, 0, 0,
execInstrCopyin, dataOffset + 7, execArgConst, 8, 0x4200000000000000, 0, 0,
- callID("syz_test$end0"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$end0"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -238,7 +238,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 2, 0x0e00, 0, 0,
execInstrCopyin, dataOffset + 2, execArgConst, 4, 0x42000000, 0, 0,
execInstrCopyin, dataOffset + 6, execArgConst, 8, 0x0100000000000000, 0, 0,
- callID("syz_test$end1"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$end1"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -254,7 +254,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 24, execArgConst, 2, 0x42, 0, 11,
execInstrCopyin, dataOffset + 26, execArgConst, 2, 0x4200, 0, 11,
execInstrCopyin, dataOffset + 28, execArgConst, 1, 0x42, 0, 0,
- callID("syz_test$bf0"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$bf0"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -266,7 +266,7 @@ func TestSerializeForExec(t *testing.T) {
execInstrCopyin, dataOffset + 0, execArgConst, 4, 0x42, 10, 10,
execInstrCopyin, dataOffset + 0, execArgConst, 4, 0x42, 20, 10,
execInstrCopyin, dataOffset + 4, execArgConst, 1, 0x42, 0, 0,
- callID("syz_test$bf1"), 1, execArgConst, ptrSize, dataOffset, 0, 0,
+ callID("syz_test$bf1"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset, 0, 0,
execInstrEOF,
},
nil,
@@ -274,7 +274,7 @@ func TestSerializeForExec(t *testing.T) {
{
"syz_test$res1(0xffff)",
[]uint64{
- callID("syz_test$res1"), 1, execArgConst, 4, 0xffff, 0, 0,
+ callID("syz_test$res1"), ExecNoCopyout, 1, execArgConst, 4, 0xffff, 0, 0,
execInstrEOF,
},
nil,