From bf21057e7c36c72c1b46aa71bea8dc48509d4c40 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 29 Sep 2016 12:21:26 +0200 Subject: prog: add a test for union layout This is a retrospect tests for the union bug fixed in: 91eb1b922fd95bfaa5d8b0aad16902a73f3fe3d1 --- prog/encodingexec_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'prog/encodingexec_test.go') 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 { -- cgit mrf-deployment