diff options
| author | Cliff Click <cliffc@acm.org> | 2026-11-01 10:33:55 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-11-01 10:33:55 -0800 |
| commit | f4bd723d929e53475f7990374dca7b7dfcbbdc42 (patch) | |
| tree | 7bb080119e7b88ad4ac9b30af019fe6a5e4ba9dd /chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java | |
| parent | 0ac0c9e10287972ac3af5a4ee43d26f0d5b318fe (diff) | |
| download | Simple-main.tar.gz Simple-main.zip | |
Add Chapter 29 for tech debt cleanup with the parser splitmain
Keep Chapter 28b intact and carry the grammar-oriented parser package, Var move, IterPeeps move, and parser regression tests into Chapter 29. Defer privacy and exclude its experimental tests and fixture changes.
Register the chapter in the indexes, IntelliJ modules and run configurations, Maven reactor, roadmap, and linear-history publisher. Windows and Linux each pass 573 tests, release builds, 199 allocation replays, and 29 native checks.
Diffstat (limited to 'chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java')
| -rw-r--r-- | chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java b/chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java new file mode 100644 index 00000000..68bbe918 --- /dev/null +++ b/chapter29/src/test/java/com/seaofnodes/simple/FuzzerWrap.java @@ -0,0 +1,78 @@ +package com.seaofnodes.simple; + +import com.seaofnodes.simple.fuzzer.Fuzzer; +import java.util.Random; +import org.junit.Ignore; +import org.junit.Test; +import static org.junit.Assert.assertTrue; + +/** + * To use the fuzzer run the <code>fuzzPeeps</code> methods. + * This can be done from IntelliJ Gui or remove the `@Ignore` annotation and start the test case from the command line + * via <code>mvn clean test -Dtest=com.seaofnodes.simple.Fuzzer08Test#fuzzPeeps</code> + */ +public class FuzzerWrap { + + private static final long[] REGRESSION_SEEDS = { + 375135762521757909L, // bad LCA + -148471672577312953L, // bulk mem + -5037182906211190034L, // dead Guard control + -6359653295501938199L, // monotonicity, escape is dead + 6506797708065910879L, // required field without a user constructor + 650692970082394944L, // recursive bulk mem split + 8335100609598232836L, // ternary result killed by region cleanup + 2520958273643234516L, // nested guard merge + -3772838984504063325L, // fuzzer regression + -4628356252269023530L, // idepth cache version wrap + -4022199781524079249L, // fuzzer regression + 8824787517620928178L, // unknown-mode unary minus during SCCP + -673501011619761901L, // peephole killed self + -8212834489697770130L, // bad keep/unkeep in parser + 478567486335112458L, // dying escape node + -5114548365532699915L, // dominate flags dependencies + -4710931876754133070L, // Tests monotonic phi widening + }; + + private static final long[] OPEN_FAILING_SEEDS = { + }; + + + @Test public void fuzzPeepsRegression () { fuzzPeepsSeeds( REGRESSION_SEEDS); } + @Test @Ignore public void fuzzPeepsOpenFailures() { fuzzPeepsSeeds(OPEN_FAILING_SEEDS); } + + private static void fuzzPeepsSeeds(long... seeds) { + var fuzzer = new Fuzzer(); + for (long seed : seeds) + fuzzer.fuzzPeepsRegression(seed); + } + + @Ignore + @Test + public void fuzzPeepsRandom() { + Random R = new Random(System.currentTimeMillis()); + var fuzzer = new Fuzzer(); + for (int i=0; i<100; i++) + fuzzer.fuzzPeeps(R.nextLong()); + assertTrue(fuzzer.noExceptions()); + } + + + @Ignore + @Test + public void fuzzPeepsLarge() { + var fuzzer = new Fuzzer(); + for (int i=0; i<1000000; i++) + fuzzer.fuzzPeeps(i); + assertTrue(fuzzer.noExceptions()); + } + + @Ignore + @Test + public void fuzzPeepTiming() { + var fuzzer = new Fuzzer(); + int max_nid=0; + for (int i=0; i<1000000; i++) + max_nid = fuzzer.fuzzPeepTiming(i, max_nid); + } + +} |
