aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encodingexec_test.go')
-rw-r--r--prog/encodingexec_test.go26
1 files changed, 24 insertions, 2 deletions
diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go
index 651352fd6..eddda5199 100644
--- a/prog/encodingexec_test.go
+++ b/prog/encodingexec_test.go
@@ -67,15 +67,26 @@ func TestSerializeForExec(t *testing.T) {
},
},
{
- // TODO: the offsets are currently caclulated incorrectly.
"syz_test$align0(&(0x7f0000000000)={0x1, 0x2, 0x3, 0x4, 0x5})",
[]uint64{
instrCopyin, dataOffset + 0, argConst, 2, 1,
+ instrCopyin, dataOffset + 4, argConst, 4, 2,
+ instrCopyin, dataOffset + 8, argConst, 1, 3,
+ instrCopyin, dataOffset + 10, argConst, 2, 4,
+ instrCopyin, dataOffset + 16, argConst, 8, 5,
+ callID("syz_test$align0"), 1, argConst, ptrSize, dataOffset,
+ instrEOF,
+ },
+ },
+ {
+ "syz_test$align1(&(0x7f0000000000)={0x1, 0x2, 0x3, 0x4, 0x5})",
+ []uint64{
+ instrCopyin, dataOffset + 0, argConst, 2, 1,
instrCopyin, dataOffset + 2, argConst, 4, 2,
instrCopyin, dataOffset + 6, argConst, 1, 3,
instrCopyin, dataOffset + 7, argConst, 2, 4,
instrCopyin, dataOffset + 9, argConst, 8, 5,
- callID("syz_test$align0"), 1, argConst, ptrSize, dataOffset,
+ callID("syz_test$align1"), 1, argConst, ptrSize, dataOffset,
instrEOF,
},
},
@@ -88,6 +99,17 @@ func TestSerializeForExec(t *testing.T) {
instrEOF,
},
},
+ {
+ "syz_test$array0(&(0x7f0000000000)={0x1, [@f0=0x2, @f1=0x3], 0x4})",
+ []uint64{
+ instrCopyin, dataOffset + 0, argConst, 1, 1,
+ instrCopyin, dataOffset + 1, argConst, 2, 2,
+ instrCopyin, dataOffset + 3, argConst, 8, 3,
+ instrCopyin, dataOffset + 11, argConst, 8, 4,
+ callID("syz_test$array0"), 1, argConst, ptrSize, dataOffset,
+ instrEOF,
+ },
+ },
}
for i, test := range tests {