var rnd *rand.Rand
if checkEnabled {
- rnd = rand.New(rand.NewSource(int64(crc32.ChecksumIEEE(([]byte)(f.Name)))))
+ seed := int64(crc32.ChecksumIEEE(([]byte)(f.Name))) ^ int64(checkRandSeed)
+ rnd = rand.New(rand.NewSource(seed))
}
// hook to print function & phase if panic happens
}
// Run consistency checker between each phase
-var checkEnabled = false
+var (
+ checkEnabled = false
+ checkRandSeed = 0
+)
// Debug output
var IntrinsicsDebug int
` + phasenames + `
- <flag> is one of:
- on, off, debug, mem, time, test, stats, dump
+ on, off, debug, mem, time, test, stats, dump, seed
- <value> defaults to 1
-d=ssa/check/on
enables checking after each phase
+ -d=ssa/check/seed=1234
+enables checking after each phase, using 1234 to seed the PRNG
+used for value order randomization
+
-d=ssa/all/time
enables time reporting for all phases
debugPoset = checkEnabled
return ""
}
+ if phase == "check" && flag == "seed" {
+ checkEnabled = true
+ checkRandSeed = val
+ debugPoset = checkEnabled
+ return ""
+ }
alltime := false
allmem := false