From cf49ed5769e95e2146c56883ebc957b22713381a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 26 Jul 2019 10:29:11 +0200 Subject: prog: don't minimize ProcType to 0 Default value for ProcType is 0 (same for all PID's). Usually 0 either does not make sense at all or make different PIDs collide (since we use ProcType to separate value ranges for different PIDs). So don't change ProcType to 0 unless the type is explicitly marked as opt (in that case we will also generate 0 anyway). --- sys/test/gen/64.go | 7 ++++++- sys/test/test.txt | 4 ++++ sys/test/test_64.const | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go index 00cba243f..b6f1b0bee 100644 --- a/sys/test/gen/64.go +++ b/sys/test/gen/64.go @@ -637,6 +637,10 @@ var syscalls_64 = []*Syscall{ {Name: "foo$fmt5", CallName: "foo", MissingArgs: 1, Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "struct$fmt0"}}}, }}, + {Name: "minimize$0", CallName: "minimize", Args: []Type{ + &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "a0", TypeSize: 8}}, ValuesStart: 10, ValuesPerProc: 2}, + &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "a1", TypeSize: 8, IsOptional: true}}, ValuesStart: 10, ValuesPerProc: 2}, + }}, {Name: "mutate0", CallName: "mutate0"}, {Name: "mutate1", CallName: "mutate1"}, {Name: "mutate2", CallName: "mutate2"}, @@ -1018,6 +1022,7 @@ var consts_64 = []ConstValue{ {Name: "IPPROTO_UDP", Value: 17}, {Name: "SYS_fallback"}, {Name: "SYS_foo"}, + {Name: "SYS_minimize"}, {Name: "SYS_mutate0"}, {Name: "SYS_mutate1"}, {Name: "SYS_mutate2"}, @@ -1034,4 +1039,4 @@ var consts_64 = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64 = "74c87d08a1f72c38c85e889813b60823a1e5755c" +const revision_64 = "8c0a50a6c63e5bd297e9f6421864685e1fd7dc96" diff --git a/sys/test/test.txt b/sys/test/test.txt index a087dd47f..51be5d49b 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -736,6 +736,10 @@ mutate8(a0 proc[100, 4, opt]) open_flags = 0xabababababababab, 0xcdcdcdcdcdcdcdcd +# Minimization tests. + +minimize$0(a0 proc[10, 2], a1 proc[10, 2, opt]) + # Serialization tests. serialize0(a ptr[in, serialize0_struct]) diff --git a/sys/test/test_64.const b/sys/test/test_64.const index 97e3a80b8..f5ed8a6a6 100644 --- a/sys/test/test_64.const +++ b/sys/test/test_64.const @@ -8,6 +8,7 @@ SYS_mutate5 = 0 SYS_mutate6 = 0 SYS_mutate7 = 0 SYS_mutate8 = 0 +SYS_minimize = 0 SYS_serialize0 = 0 SYS_serialize1 = 0 SYS_test = 0 -- cgit mrf-deployment