[libFuzzer] implement -focus_function=auto, to be used with Data Flow Traces

llvm-svn: 360378
diff --git a/compiler-rt/test/fuzzer/OnlySomeBytesTest.cpp b/compiler-rt/test/fuzzer/OnlySomeBytesTest.cpp
index 60de710..bf10df8 100644
--- a/compiler-rt/test/fuzzer/OnlySomeBytesTest.cpp
+++ b/compiler-rt/test/fuzzer/OnlySomeBytesTest.cpp
@@ -24,8 +24,16 @@
 
 __attribute__((noinline)) void f0(IN in) {
   uint32_t x = in[5] + 251 * in[7] + 251 * 251 * in[9];
-  if (x == 'F' + 251 * 'U' + 251 * 251 * 'Z')
+  if (x == 'F' + 251 * 'U' + 251 * 251 * 'Z') {
+    // artificially inflate uncovered control in f0
+    // so that auto-focus is more likely to chose this function.
+    if (one == -1) {
+      if (one == 2) one = 1;    if (one == 3) one = 1;    if (one == 4) one = 1;
+      if (one == 5) one = 1;    if (one == 6) one = 1;    if (one == 7) one = 1;
+      if (one == 8) one = 1;    if (one == 9) one = 1;    if (one == 0) one = 1;
+    }
     bad();
+  }
 }
 
 __attribute__((noinline)) void fC(IN in) { if (in[2] == 'C') f0(in); }