aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-09-29 12:21:26 +0200
committerDmitry Vyukov <dvyukov@google.com>2016-09-29 12:21:26 +0200
commitbf21057e7c36c72c1b46aa71bea8dc48509d4c40 (patch)
tree81c7c3e87305b00500af94b11ebabf5816d9b824 /prog/encodingexec_test.go
parent11a690d2752b590cadebe982ae4b66bf5c0cccef (diff)
prog: add a test for union layout
This is a retrospect tests for the union bug fixed in: 91eb1b922fd95bfaa5d8b0aad16902a73f3fe3d1
Diffstat (limited to 'prog/encodingexec_test.go')
-rw-r--r--prog/encodingexec_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go
index cf259e89c..651352fd6 100644
--- a/prog/encodingexec_test.go
+++ b/prog/encodingexec_test.go
@@ -67,6 +67,7 @@ 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,
@@ -78,6 +79,15 @@ func TestSerializeForExec(t *testing.T) {
instrEOF,
},
},
+ {
+ "syz_test$union0(&(0x7f0000000000)={0x1, @f2=0x2})",
+ []uint64{
+ instrCopyin, dataOffset + 0, argConst, 8, 1,
+ instrCopyin, dataOffset + 8, argConst, 1, 2,
+ callID("syz_test$union0"), 1, argConst, ptrSize, dataOffset,
+ instrEOF,
+ },
+ },
}
for i, test := range tests {