summaryrefslogtreecommitdiff
path: root/lib/Fuzzer/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:06 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:06 +0000
commit7ab83427af0f77b59941ceba41d509d7d097b065 (patch)
treecc41c05b1db454e3d802f34df75e636ee922ad87 /lib/Fuzzer/test
parentd288ef4c1788d3a951a7558c68312c2d320612b1 (diff)
Diffstat (limited to 'lib/Fuzzer/test')
-rw-r--r--lib/Fuzzer/test/AFLDriverTest.cpp2
-rw-r--r--lib/Fuzzer/test/AbsNegAndConstant64Test.cpp6
-rw-r--r--lib/Fuzzer/test/AbsNegAndConstantTest.cpp6
-rw-r--r--lib/Fuzzer/test/AccumulateAllocationsTest.cpp2
-rw-r--r--lib/Fuzzer/test/BadStrcmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/BufferOverflowOnInput.cpp2
-rw-r--r--lib/Fuzzer/test/CallerCalleeTest.cpp2
-rw-r--r--lib/Fuzzer/test/CleanseTest.cpp2
-rw-r--r--lib/Fuzzer/test/CustomMutatorTest.cpp2
-rw-r--r--lib/Fuzzer/test/CxxStringEqTest.cpp4
-rw-r--r--lib/Fuzzer/test/DSOTestMain.cpp2
-rw-r--r--lib/Fuzzer/test/DivTest.cpp2
-rw-r--r--lib/Fuzzer/test/FourIndependentBranchesTest.cpp2
-rw-r--r--lib/Fuzzer/test/FullCoverageSetTest.cpp2
-rw-r--r--lib/Fuzzer/test/FuzzerUnittest.cpp4
-rw-r--r--lib/Fuzzer/test/LeakTest.cpp2
-rw-r--r--lib/Fuzzer/test/LeakTimeoutTest.cpp2
-rw-r--r--lib/Fuzzer/test/LoadTest.cpp2
-rw-r--r--lib/Fuzzer/test/Memcmp64BytesTest.cpp2
-rw-r--r--lib/Fuzzer/test/MemcmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/NotinstrumentedTest.cpp2
-rw-r--r--lib/Fuzzer/test/NthRunCrashTest.cpp2
-rw-r--r--lib/Fuzzer/test/NullDerefOnEmptyTest.cpp2
-rw-r--r--lib/Fuzzer/test/NullDerefTest.cpp2
-rw-r--r--lib/Fuzzer/test/OneHugeAllocTest.cpp2
-rw-r--r--lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp2
-rw-r--r--lib/Fuzzer/test/OutOfMemoryTest.cpp2
-rw-r--r--lib/Fuzzer/test/RepeatedBytesTest.cpp2
-rw-r--r--lib/Fuzzer/test/RepeatedMemcmp.cpp3
-rw-r--r--lib/Fuzzer/test/ShrinkControlFlowTest.cpp4
-rw-r--r--lib/Fuzzer/test/ShrinkValueProfileTest.cpp4
-rw-r--r--lib/Fuzzer/test/SignedIntOverflowTest.cpp4
-rw-r--r--lib/Fuzzer/test/SimpleCmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/SimpleDictionaryTest.cpp2
-rw-r--r--lib/Fuzzer/test/SimpleHashTest.cpp2
-rw-r--r--lib/Fuzzer/test/SimpleTest.cpp2
-rw-r--r--lib/Fuzzer/test/SimpleThreadedTest.cpp2
-rw-r--r--lib/Fuzzer/test/SingleByteInputTest.cpp4
-rw-r--r--lib/Fuzzer/test/SingleMemcmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/SingleStrcmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/SingleStrncmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/SpamyTest.cpp2
-rw-r--r--lib/Fuzzer/test/StrcmpTest.cpp4
-rw-r--r--lib/Fuzzer/test/StrncmpOOBTest.cpp4
-rw-r--r--lib/Fuzzer/test/StrncmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/StrstrTest.cpp4
-rw-r--r--lib/Fuzzer/test/SwapCmpTest.cpp2
-rw-r--r--lib/Fuzzer/test/Switch2Test.cpp4
-rw-r--r--lib/Fuzzer/test/SwitchTest.cpp4
-rw-r--r--lib/Fuzzer/test/TableLookupTest.cpp4
-rw-r--r--lib/Fuzzer/test/ThreadedLeakTest.cpp2
-rw-r--r--lib/Fuzzer/test/ThreadedTest.cpp2
-rw-r--r--lib/Fuzzer/test/TimeoutEmptyTest.cpp2
-rw-r--r--lib/Fuzzer/test/TimeoutTest.cpp2
-rw-r--r--lib/Fuzzer/test/TraceMallocTest.cpp2
-rw-r--r--lib/Fuzzer/test/TwoDifferentBugsTest.cpp2
56 files changed, 72 insertions, 73 deletions
diff --git a/lib/Fuzzer/test/AFLDriverTest.cpp b/lib/Fuzzer/test/AFLDriverTest.cpp
index e3f5f7100883..b949adc7de15 100644
--- a/lib/Fuzzer/test/AFLDriverTest.cpp
+++ b/lib/Fuzzer/test/AFLDriverTest.cpp
@@ -3,8 +3,8 @@
// Contains dummy functions used to avoid dependency on AFL.
#include <stdint.h>
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
extern "C" void __afl_manual_init() {}
diff --git a/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp b/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp
index 69b0d59fb8ef..dfb6007b7970 100644
--- a/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp
+++ b/lib/Fuzzer/test/AbsNegAndConstant64Test.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// abs(x) < 0 and y == Const puzzle, 64-bit variant.
-#include <cstring>
-#include <cstdint>
-#include <cstdlib>
#include <cstddef>
+#include <cstdint>
#include <cstdio>
+#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 16) return 0;
diff --git a/lib/Fuzzer/test/AbsNegAndConstantTest.cpp b/lib/Fuzzer/test/AbsNegAndConstantTest.cpp
index 69075a454c99..e9d983ff1ebf 100644
--- a/lib/Fuzzer/test/AbsNegAndConstantTest.cpp
+++ b/lib/Fuzzer/test/AbsNegAndConstantTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// abs(x) < 0 and y == Const puzzle.
-#include <cstring>
-#include <cstdint>
-#include <cstdlib>
#include <cstddef>
+#include <cstdint>
#include <cstdio>
+#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 8) return 0;
diff --git a/lib/Fuzzer/test/AccumulateAllocationsTest.cpp b/lib/Fuzzer/test/AccumulateAllocationsTest.cpp
index 604d8fa299ae..e9acd7ccbd30 100644
--- a/lib/Fuzzer/test/AccumulateAllocationsTest.cpp
+++ b/lib/Fuzzer/test/AccumulateAllocationsTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// Test with a more mallocs than frees, but no leak.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
const int kAllocatedPointersSize = 10000;
int NumAllocatedPointers = 0;
diff --git a/lib/Fuzzer/test/BadStrcmpTest.cpp b/lib/Fuzzer/test/BadStrcmpTest.cpp
index 159cd7ea5f70..ba2b068f741d 100644
--- a/lib/Fuzzer/test/BadStrcmpTest.cpp
+++ b/lib/Fuzzer/test/BadStrcmpTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Test that we don't creash in case of bad strcmp params.
+#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <cstddef>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/BufferOverflowOnInput.cpp b/lib/Fuzzer/test/BufferOverflowOnInput.cpp
index b9d14052aee4..75e1fb90a19a 100644
--- a/lib/Fuzzer/test/BufferOverflowOnInput.cpp
+++ b/lib/Fuzzer/test/BufferOverflowOnInput.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile bool SeedLargeBuffer;
diff --git a/lib/Fuzzer/test/CallerCalleeTest.cpp b/lib/Fuzzer/test/CallerCalleeTest.cpp
index 3ec025d02301..ed9f37cc1521 100644
--- a/lib/Fuzzer/test/CallerCalleeTest.cpp
+++ b/lib/Fuzzer/test/CallerCalleeTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer.
// Try to find the target using the indirect caller-callee pairs.
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <iostream>
diff --git a/lib/Fuzzer/test/CleanseTest.cpp b/lib/Fuzzer/test/CleanseTest.cpp
index faea8dcb3c30..ee1845701269 100644
--- a/lib/Fuzzer/test/CleanseTest.cpp
+++ b/lib/Fuzzer/test/CleanseTest.cpp
@@ -3,9 +3,9 @@
// Test the the fuzzer is able to 'cleanse' the reproducer
// by replacing all irrelevant bytes with garbage.
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size >= 20 && Data[1] == '1' && Data[5] == '5' && Data[10] == 'A' &&
diff --git a/lib/Fuzzer/test/CustomMutatorTest.cpp b/lib/Fuzzer/test/CustomMutatorTest.cpp
index 4f84519a90e6..521d7f506b4d 100644
--- a/lib/Fuzzer/test/CustomMutatorTest.cpp
+++ b/lib/Fuzzer/test/CustomMutatorTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a cutom mutator.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
#include "FuzzerInterface.h"
diff --git a/lib/Fuzzer/test/CxxStringEqTest.cpp b/lib/Fuzzer/test/CxxStringEqTest.cpp
index e0e23c972ccb..924851c5ad53 100644
--- a/lib/Fuzzer/test/CxxStringEqTest.cpp
+++ b/lib/Fuzzer/test/CxxStringEqTest.cpp
@@ -3,11 +3,11 @@
// Simple test for a fuzzer. Must find a specific string
// used in std::string operator ==.
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
-#include <string>
#include <iostream>
+#include <string>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/DSOTestMain.cpp b/lib/Fuzzer/test/DSOTestMain.cpp
index 3e225d886128..e0c857d4fdec 100644
--- a/lib/Fuzzer/test/DSOTestMain.cpp
+++ b/lib/Fuzzer/test/DSOTestMain.cpp
@@ -4,9 +4,9 @@
// Source code for a simple DSO.
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
extern int DSO1(int a);
extern int DSO2(int a);
extern int DSOTestExtra(int a);
diff --git a/lib/Fuzzer/test/DivTest.cpp b/lib/Fuzzer/test/DivTest.cpp
index 63f6960f4e90..bce13feb790f 100644
--- a/lib/Fuzzer/test/DivTest.cpp
+++ b/lib/Fuzzer/test/DivTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer: find the interesting argument for div.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <cstddef>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/FourIndependentBranchesTest.cpp b/lib/Fuzzer/test/FourIndependentBranchesTest.cpp
index 62b3be76e3aa..bbf5ea235c7a 100644
--- a/lib/Fuzzer/test/FourIndependentBranchesTest.cpp
+++ b/lib/Fuzzer/test/FourIndependentBranchesTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the string "FUZZ".
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
diff --git a/lib/Fuzzer/test/FullCoverageSetTest.cpp b/lib/Fuzzer/test/FullCoverageSetTest.cpp
index 415e0b4760c5..6d7e48fe51f8 100644
--- a/lib/Fuzzer/test/FullCoverageSetTest.cpp
+++ b/lib/Fuzzer/test/FullCoverageSetTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the string "FUZZER".
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
diff --git a/lib/Fuzzer/test/FuzzerUnittest.cpp b/lib/Fuzzer/test/FuzzerUnittest.cpp
index 78ea874f2ce2..c8beb4331bfa 100644
--- a/lib/Fuzzer/test/FuzzerUnittest.cpp
+++ b/lib/Fuzzer/test/FuzzerUnittest.cpp
@@ -6,12 +6,12 @@
#define _LIBCPP_HAS_NO_ASAN
#include "FuzzerCorpus.h"
-#include "FuzzerInternal.h"
#include "FuzzerDictionary.h"
+#include "FuzzerInternal.h"
#include "FuzzerMerge.h"
#include "FuzzerMutate.h"
-#include "FuzzerTracePC.h"
#include "FuzzerRandom.h"
+#include "FuzzerTracePC.h"
#include "gtest/gtest.h"
#include <memory>
#include <set>
diff --git a/lib/Fuzzer/test/LeakTest.cpp b/lib/Fuzzer/test/LeakTest.cpp
index 22e5164050e5..ea89e3901057 100644
--- a/lib/Fuzzer/test/LeakTest.cpp
+++ b/lib/Fuzzer/test/LeakTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// Test with a leak.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
static volatile void *Sink;
diff --git a/lib/Fuzzer/test/LeakTimeoutTest.cpp b/lib/Fuzzer/test/LeakTimeoutTest.cpp
index 4f31b3e52c16..92526194a508 100644
--- a/lib/Fuzzer/test/LeakTimeoutTest.cpp
+++ b/lib/Fuzzer/test/LeakTimeoutTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// Test with a leak.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
static volatile int *Sink;
diff --git a/lib/Fuzzer/test/LoadTest.cpp b/lib/Fuzzer/test/LoadTest.cpp
index eef16c7be51e..67a28c7cb22f 100644
--- a/lib/Fuzzer/test/LoadTest.cpp
+++ b/lib/Fuzzer/test/LoadTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer: find interesting value of array index.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <cstddef>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/Memcmp64BytesTest.cpp b/lib/Fuzzer/test/Memcmp64BytesTest.cpp
index e81526b578a3..5b6cb707173f 100644
--- a/lib/Fuzzer/test/Memcmp64BytesTest.cpp
+++ b/lib/Fuzzer/test/Memcmp64BytesTest.cpp
@@ -3,10 +3,10 @@
// Simple test for a fuzzer. The fuzzer must find a particular string.
#include <cassert>
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
const char kString64Bytes[] =
diff --git a/lib/Fuzzer/test/MemcmpTest.cpp b/lib/Fuzzer/test/MemcmpTest.cpp
index fdbf94683f76..8dbb7d84fbba 100644
--- a/lib/Fuzzer/test/MemcmpTest.cpp
+++ b/lib/Fuzzer/test/MemcmpTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find a particular string.
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
// TODO: check other sizes.
diff --git a/lib/Fuzzer/test/NotinstrumentedTest.cpp b/lib/Fuzzer/test/NotinstrumentedTest.cpp
index ffe952c749d2..91418990b192 100644
--- a/lib/Fuzzer/test/NotinstrumentedTest.cpp
+++ b/lib/Fuzzer/test/NotinstrumentedTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// This test should not be instrumented.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
return 0;
diff --git a/lib/Fuzzer/test/NthRunCrashTest.cpp b/lib/Fuzzer/test/NthRunCrashTest.cpp
index b43e69e51b25..da5fbd33e962 100644
--- a/lib/Fuzzer/test/NthRunCrashTest.cpp
+++ b/lib/Fuzzer/test/NthRunCrashTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// Crash on the N-th execution.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
#include <iostream>
static int Counter;
diff --git a/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp b/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp
index 153710920a5f..459db51f8a3b 100644
--- a/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp
+++ b/lib/Fuzzer/test/NullDerefOnEmptyTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the empty string.
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile int *Null = 0;
diff --git a/lib/Fuzzer/test/NullDerefTest.cpp b/lib/Fuzzer/test/NullDerefTest.cpp
index 3f03d2498197..1b44b682ace6 100644
--- a/lib/Fuzzer/test/NullDerefTest.cpp
+++ b/lib/Fuzzer/test/NullDerefTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/OneHugeAllocTest.cpp b/lib/Fuzzer/test/OneHugeAllocTest.cpp
index 8d3d1d6d302d..32a557871000 100644
--- a/lib/Fuzzer/test/OneHugeAllocTest.cpp
+++ b/lib/Fuzzer/test/OneHugeAllocTest.cpp
@@ -3,9 +3,9 @@
// Tests OOM handling when there is a single large allocation.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <iostream>
diff --git a/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp b/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
index 316b7682b8e6..a07795a08dff 100644
--- a/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
+++ b/lib/Fuzzer/test/OutOfMemorySingleLargeMallocTest.cpp
@@ -3,9 +3,9 @@
// Tests OOM handling.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <iostream>
diff --git a/lib/Fuzzer/test/OutOfMemoryTest.cpp b/lib/Fuzzer/test/OutOfMemoryTest.cpp
index 078a39ee1fe9..5e59bde09853 100644
--- a/lib/Fuzzer/test/OutOfMemoryTest.cpp
+++ b/lib/Fuzzer/test/OutOfMemoryTest.cpp
@@ -3,9 +3,9 @@
// Tests OOM handling.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <iostream>
#include <thread>
diff --git a/lib/Fuzzer/test/RepeatedBytesTest.cpp b/lib/Fuzzer/test/RepeatedBytesTest.cpp
index 2fa6c78c26d8..14222f284747 100644
--- a/lib/Fuzzer/test/RepeatedBytesTest.cpp
+++ b/lib/Fuzzer/test/RepeatedBytesTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer. The fuzzer must find repeated bytes.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
diff --git a/lib/Fuzzer/test/RepeatedMemcmp.cpp b/lib/Fuzzer/test/RepeatedMemcmp.cpp
index 7377f65ed76d..18369deac3b0 100644
--- a/lib/Fuzzer/test/RepeatedMemcmp.cpp
+++ b/lib/Fuzzer/test/RepeatedMemcmp.cpp
@@ -1,11 +1,10 @@
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
-
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
int Matches1 = 0;
diff --git a/lib/Fuzzer/test/ShrinkControlFlowTest.cpp b/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
index 0fd7c5e9a1fb..d09542963626 100644
--- a/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
+++ b/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Test that we can find the minimal item in the corpus (3 bytes: "FUZ").
+#include <cstddef>
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
-#include <cstdio>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/ShrinkValueProfileTest.cpp b/lib/Fuzzer/test/ShrinkValueProfileTest.cpp
index 026b8ce26591..86e4e3cb0d9a 100644
--- a/lib/Fuzzer/test/ShrinkValueProfileTest.cpp
+++ b/lib/Fuzzer/test/ShrinkValueProfileTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Test that we can find the minimal item in the corpus (3 bytes: "FUZ").
+#include <cstddef>
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
-#include <cstdio>
static volatile uint32_t Sink;
diff --git a/lib/Fuzzer/test/SignedIntOverflowTest.cpp b/lib/Fuzzer/test/SignedIntOverflowTest.cpp
index 7df32ad57933..d80060207dee 100644
--- a/lib/Fuzzer/test/SignedIntOverflowTest.cpp
+++ b/lib/Fuzzer/test/SignedIntOverflowTest.cpp
@@ -3,11 +3,11 @@
// Test for signed-integer-overflow.
#include <assert.h>
+#include <climits>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
-#include <climits>
static volatile int Sink;
static int Large = INT_MAX;
diff --git a/lib/Fuzzer/test/SimpleCmpTest.cpp b/lib/Fuzzer/test/SimpleCmpTest.cpp
index 12b5cdda0660..8acad4ac77e8 100644
--- a/lib/Fuzzer/test/SimpleCmpTest.cpp
+++ b/lib/Fuzzer/test/SimpleCmpTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer. The fuzzer must find several narrow ranges.
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
extern int AllLines[];
diff --git a/lib/Fuzzer/test/SimpleDictionaryTest.cpp b/lib/Fuzzer/test/SimpleDictionaryTest.cpp
index cd7292bd006c..a1cd20047224 100644
--- a/lib/Fuzzer/test/SimpleDictionaryTest.cpp
+++ b/lib/Fuzzer/test/SimpleDictionaryTest.cpp
@@ -5,9 +5,9 @@
// The fuzzer must find a string based on dictionary words:
// "Elvis"
// "Presley"
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <cstring>
#include <iostream>
diff --git a/lib/Fuzzer/test/SimpleHashTest.cpp b/lib/Fuzzer/test/SimpleHashTest.cpp
index 00599de78ebe..99e96cb25dcd 100644
--- a/lib/Fuzzer/test/SimpleHashTest.cpp
+++ b/lib/Fuzzer/test/SimpleHashTest.cpp
@@ -5,9 +5,9 @@
// and then compares the last 4 bytes with the computed value.
// A fuzzer with cmp traces is expected to defeat this check.
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
// A modified jenkins_one_at_a_time_hash initialized by non-zero,
// so that simple_hash(0) != 0. See also
diff --git a/lib/Fuzzer/test/SimpleTest.cpp b/lib/Fuzzer/test/SimpleTest.cpp
index e53ea160ed8f..a8b4988dff10 100644
--- a/lib/Fuzzer/test/SimpleTest.cpp
+++ b/lib/Fuzzer/test/SimpleTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/SimpleThreadedTest.cpp b/lib/Fuzzer/test/SimpleThreadedTest.cpp
index 5f02d3f8457c..1abdc3fc6d6b 100644
--- a/lib/Fuzzer/test/SimpleThreadedTest.cpp
+++ b/lib/Fuzzer/test/SimpleThreadedTest.cpp
@@ -3,8 +3,8 @@
// Threaded test for a fuzzer. The fuzzer should find "H"
#include <assert.h>
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
#include <cstring>
#include <iostream>
#include <thread>
diff --git a/lib/Fuzzer/test/SingleByteInputTest.cpp b/lib/Fuzzer/test/SingleByteInputTest.cpp
index 4ce819d230ce..72b58ba912eb 100644
--- a/lib/Fuzzer/test/SingleByteInputTest.cpp
+++ b/lib/Fuzzer/test/SingleByteInputTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer, need just one byte to crash.
-#include <cstdint>
-#include <cstdlib>
#include <cstddef>
+#include <cstdint>
#include <cstdio>
+#include <cstdlib>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size > 0 && Data[Size/2] == 42) {
diff --git a/lib/Fuzzer/test/SingleMemcmpTest.cpp b/lib/Fuzzer/test/SingleMemcmpTest.cpp
index c73f68a7ee6e..83c09e0428ec 100644
--- a/lib/Fuzzer/test/SingleMemcmpTest.cpp
+++ b/lib/Fuzzer/test/SingleMemcmpTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find a particular string.
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
char *S = (char*)Data;
diff --git a/lib/Fuzzer/test/SingleStrcmpTest.cpp b/lib/Fuzzer/test/SingleStrcmpTest.cpp
index 48f481dfc51a..149073444c9c 100644
--- a/lib/Fuzzer/test/SingleStrcmpTest.cpp
+++ b/lib/Fuzzer/test/SingleStrcmpTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find a particular string.
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size >= 7) {
diff --git a/lib/Fuzzer/test/SingleStrncmpTest.cpp b/lib/Fuzzer/test/SingleStrncmpTest.cpp
index e5601da86329..b302670fb743 100644
--- a/lib/Fuzzer/test/SingleStrncmpTest.cpp
+++ b/lib/Fuzzer/test/SingleStrncmpTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find a particular string.
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
char *S = (char*)Data;
diff --git a/lib/Fuzzer/test/SpamyTest.cpp b/lib/Fuzzer/test/SpamyTest.cpp
index d294d4dc53e0..721134e1841c 100644
--- a/lib/Fuzzer/test/SpamyTest.cpp
+++ b/lib/Fuzzer/test/SpamyTest.cpp
@@ -3,9 +3,9 @@
// The test spams to stderr and stdout.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdio>
-#include <cstddef>
#include <iostream>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
diff --git a/lib/Fuzzer/test/StrcmpTest.cpp b/lib/Fuzzer/test/StrcmpTest.cpp
index cd91dda76f30..e7636e8812fc 100644
--- a/lib/Fuzzer/test/StrcmpTest.cpp
+++ b/lib/Fuzzer/test/StrcmpTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Break through a series of strcmp.
-#include <cstring>
+#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
-#include <cassert>
+#include <cstring>
bool Eq(const uint8_t *Data, size_t Size, const char *Str) {
char Buff[1024];
diff --git a/lib/Fuzzer/test/StrncmpOOBTest.cpp b/lib/Fuzzer/test/StrncmpOOBTest.cpp
index f70b003afad6..4ed71d9d021d 100644
--- a/lib/Fuzzer/test/StrncmpOOBTest.cpp
+++ b/lib/Fuzzer/test/StrncmpOOBTest.cpp
@@ -3,10 +3,10 @@
// Test that libFuzzer itself does not read out of bounds.
#include <assert.h>
+#include <cstddef>
#include <cstdint>
-#include <cstring>
#include <cstdlib>
-#include <cstddef>
+#include <cstring>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/StrncmpTest.cpp b/lib/Fuzzer/test/StrncmpTest.cpp
index 5ffd011dcdff..f71f01ee3098 100644
--- a/lib/Fuzzer/test/StrncmpTest.cpp
+++ b/lib/Fuzzer/test/StrncmpTest.cpp
@@ -2,10 +2,10 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find a particular string.
-#include <cstring>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <cstring>
static volatile int sink;
diff --git a/lib/Fuzzer/test/StrstrTest.cpp b/lib/Fuzzer/test/StrstrTest.cpp
index f021e75ec0fd..a3ea4e03b3d2 100644
--- a/lib/Fuzzer/test/StrstrTest.cpp
+++ b/lib/Fuzzer/test/StrstrTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Test strstr and strcasestr hooks.
-#include <string>
-#include <string.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
+#include <string.h>
+#include <string>
// Windows does not have strcasestr and memmem, so we are not testing them.
#ifdef _WIN32
diff --git a/lib/Fuzzer/test/SwapCmpTest.cpp b/lib/Fuzzer/test/SwapCmpTest.cpp
index b90ac72c22c4..bbfbefe6ab71 100644
--- a/lib/Fuzzer/test/SwapCmpTest.cpp
+++ b/lib/Fuzzer/test/SwapCmpTest.cpp
@@ -3,9 +3,9 @@
// The fuzzer must find several constants with swapped bytes.
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 14) return 0;
diff --git a/lib/Fuzzer/test/Switch2Test.cpp b/lib/Fuzzer/test/Switch2Test.cpp
index 3c6a3004907e..5f66ac8b499e 100644
--- a/lib/Fuzzer/test/Switch2Test.cpp
+++ b/lib/Fuzzer/test/Switch2Test.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the interesting switch value.
+#include <cstddef>
#include <cstdint>
-#include <cstdlib>
#include <cstdio>
+#include <cstdlib>
#include <cstring>
-#include <cstddef>
int Switch(int a) {
switch(a) {
diff --git a/lib/Fuzzer/test/SwitchTest.cpp b/lib/Fuzzer/test/SwitchTest.cpp
index 3dc051ff7b5b..86944cad21c5 100644
--- a/lib/Fuzzer/test/SwitchTest.cpp
+++ b/lib/Fuzzer/test/SwitchTest.cpp
@@ -2,11 +2,11 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the interesting switch value.
+#include <cstddef>
#include <cstdint>
-#include <cstdlib>
#include <cstdio>
+#include <cstdlib>
#include <cstring>
-#include <cstddef>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/TableLookupTest.cpp b/lib/Fuzzer/test/TableLookupTest.cpp
index f9d5610820ff..8126eeabaf42 100644
--- a/lib/Fuzzer/test/TableLookupTest.cpp
+++ b/lib/Fuzzer/test/TableLookupTest.cpp
@@ -3,11 +3,11 @@
// Make sure the fuzzer eventually finds all possible values of a variable
// within a range.
-#include <cstring>
+#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
-#include <cassert>
+#include <cstring>
#include <set>
const size_t N = 1 << 12;
diff --git a/lib/Fuzzer/test/ThreadedLeakTest.cpp b/lib/Fuzzer/test/ThreadedLeakTest.cpp
index 751107110871..538d3b434808 100644
--- a/lib/Fuzzer/test/ThreadedLeakTest.cpp
+++ b/lib/Fuzzer/test/ThreadedLeakTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// The fuzzer should find a leak in a non-main thread.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
#include <thread>
static volatile int *Sink;
diff --git a/lib/Fuzzer/test/ThreadedTest.cpp b/lib/Fuzzer/test/ThreadedTest.cpp
index 09137a9a70c1..bb51ba764eba 100644
--- a/lib/Fuzzer/test/ThreadedTest.cpp
+++ b/lib/Fuzzer/test/ThreadedTest.cpp
@@ -3,8 +3,8 @@
// Threaded test for a fuzzer. The fuzzer should not crash.
#include <assert.h>
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
#include <cstring>
#include <thread>
diff --git a/lib/Fuzzer/test/TimeoutEmptyTest.cpp b/lib/Fuzzer/test/TimeoutEmptyTest.cpp
index 8066f480b655..1ddf1fa34589 100644
--- a/lib/Fuzzer/test/TimeoutEmptyTest.cpp
+++ b/lib/Fuzzer/test/TimeoutEmptyTest.cpp
@@ -2,8 +2,8 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the empty string.
-#include <cstdint>
#include <cstddef>
+#include <cstdint>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
static volatile int Zero = 0;
diff --git a/lib/Fuzzer/test/TimeoutTest.cpp b/lib/Fuzzer/test/TimeoutTest.cpp
index f8107012c841..e3cdba3eec38 100644
--- a/lib/Fuzzer/test/TimeoutTest.cpp
+++ b/lib/Fuzzer/test/TimeoutTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile int Sink;
diff --git a/lib/Fuzzer/test/TraceMallocTest.cpp b/lib/Fuzzer/test/TraceMallocTest.cpp
index 43e6950e185f..af9975603aa1 100644
--- a/lib/Fuzzer/test/TraceMallocTest.cpp
+++ b/lib/Fuzzer/test/TraceMallocTest.cpp
@@ -3,9 +3,9 @@
// Tests -trace_malloc
#include <assert.h>
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
int *Ptr;
diff --git a/lib/Fuzzer/test/TwoDifferentBugsTest.cpp b/lib/Fuzzer/test/TwoDifferentBugsTest.cpp
index 42c0d192ba86..77d2cb1a25f9 100644
--- a/lib/Fuzzer/test/TwoDifferentBugsTest.cpp
+++ b/lib/Fuzzer/test/TwoDifferentBugsTest.cpp
@@ -2,9 +2,9 @@
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. This test may trigger two different bugs.
+#include <cstddef>
#include <cstdint>
#include <cstdlib>
-#include <cstddef>
#include <iostream>
static volatile int *Null = 0;