[dart/fuzzer] Shard fuzzer support

Change-Id: I727498e5fbc321bbcd9546f43b25cf3c47209dd1
Reviewed-on: https://dart-review.googlesource.com/c/78180
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
diff --git a/runtime/tools/dartfuzz/dartfuzz_test.dart b/runtime/tools/dartfuzz/dartfuzz_test.dart
index 87af806..4645b05 100644
--- a/runtime/tools/dartfuzz/dartfuzz_test.dart
+++ b/runtime/tools/dartfuzz/dartfuzz_test.dart
@@ -403,11 +403,20 @@
         negatable: true, help: 'show session statistics', defaultsTo: true)
     ..addOption('dart-top', help: 'explicit value for \$DART_TOP')
     ..addOption('mode1', help: 'execution mode 1')
-    ..addOption('mode2', help: 'execution mode 2');
+    ..addOption('mode2', help: 'execution mode 2')
+    // Undocumented options for cluster runs.
+    ..addOption('shards',
+        help: 'number of shards used in cluster run', defaultsTo: '1')
+    ..addOption('shard', help: 'shard id in cluster run', defaultsTo: '1');
 
   // Starts fuzz testing session.
   try {
     final results = parser.parse(arguments);
+    final shards = int.parse(results['shards']);
+    final shard = int.parse(results['shard']);
+    if (shards > 1) {
+      print('\nSHARD $shard OF $shards');
+    }
     new DartFuzzTestSession(
             int.parse(results['isolates']),
             int.parse(results['repeat']),