From 6b731486d4460e5f1088a6066c0081af048c1e45 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 28 Nov 2012 19:00:02 +0000 Subject: Add backreference matching capabilities to Support/Regex, with appropriate unit tests. This change in itself is not expected to affect any functionality at this point, but it will serve as a stepping stone to improve FileCheck's variable matching capabilities. Luckily, our regex implementation already supports backreferences, although a bit of hacking is required to enable it. It supports both Basic Regular Expressions (BREs) and Extended Regular Expressions (EREs), without supporting backrefs for EREs, following POSIX strictly in this respect. And EREs is what we actually use (rightly). This is contrary to many implementations (including the default on Linux) of POSIX regexes, that do allow backrefs in EREs. Adding backref support to our EREs is a very simple change in the regcomp parsing code. I fail to think of significant cases where it would clash with existing things, and can bring more versatility to the regexes we write. There's always the danger of a backref in a specially crafted regex causing exponential matching times, but since we mainly use them for testing purposes I don't think it's a big problem. [it can also be placed behind a flag specific to FileCheck, if needed]. For more details, see: * http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/055840.html * http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/156878.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168802 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/RegexTest.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'unittests/Support/RegexTest.cpp') diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp index 65b66c3eee..38d95955f8 100644 --- a/unittests/Support/RegexTest.cpp +++ b/unittests/Support/RegexTest.cpp @@ -51,7 +51,6 @@ TEST_F(RegexTest, Basics) { EXPECT_EQ(1u, Matches.size()); EXPECT_EQ(String, Matches[0].str()); - std::string NulPattern="X[0-9]+X([a-f])?:([0-9]+)"; String="YX99a:513b"; NulPattern[7] = '\0'; @@ -62,6 +61,28 @@ TEST_F(RegexTest, Basics) { EXPECT_TRUE(r5.match(String)); } +TEST_F(RegexTest, Backreferences) { + Regex r1("([a-z]+)_\\1"); + SmallVector Matches; + EXPECT_TRUE(r1.match("abc_abc", &Matches)); + EXPECT_EQ(2u, Matches.size()); + EXPECT_FALSE(r1.match("abc_ab", &Matches)); + + Regex r2("a([0-9])b\\1c\\1"); + EXPECT_TRUE(r2.match("a4b4c4", &Matches)); + EXPECT_EQ(2u, Matches.size()); + EXPECT_EQ("4", Matches[1].str()); + EXPECT_FALSE(r2.match("a2b2c3")); + + Regex r3("a([0-9])([a-z])b\\1\\2"); + EXPECT_TRUE(r3.match("a6zb6z", &Matches)); + EXPECT_EQ(3u, Matches.size()); + EXPECT_EQ("6", Matches[1].str()); + EXPECT_EQ("z", Matches[2].str()); + EXPECT_FALSE(r3.match("a6zb6y")); + EXPECT_FALSE(r3.match("a6zb7z")); +} + TEST_F(RegexTest, Substitution) { std::string Error; -- cgit v1.2.3-70-g09d2 From 5a88dda4be791426ab4d20a6a6c9c65d66614a27 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 4 Dec 2012 10:23:08 +0000 Subject: Sort the #include lines for unittest/... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ADT/APFloatTest.cpp | 8 +++---- unittests/ADT/APIntTest.cpp | 4 ++-- unittests/ADT/SCCIteratorTest.cpp | 4 ++-- unittests/ADT/SmallStringTest.cpp | 4 ++-- unittests/ADT/SmallVectorTest.cpp | 4 ++-- unittests/ADT/StringRefTest.cpp | 2 +- unittests/ADT/TinyPtrVectorTest.cpp | 6 +++--- unittests/ADT/TwineTest.cpp | 2 +- unittests/ADT/ilistTest.cpp | 4 ++-- unittests/Analysis/ScalarEvolutionTest.cpp | 4 ++-- unittests/ExecutionEngine/ExecutionEngineTest.cpp | 4 ++-- .../ExecutionEngine/JIT/JITEventListenerTest.cpp | 9 ++++---- .../JIT/JITEventListenerTestCommon.h | 14 ++++++------ .../ExecutionEngine/JIT/JITMemoryManagerTest.cpp | 6 +++--- unittests/ExecutionEngine/JIT/JITTest.cpp | 17 +++++++-------- unittests/ExecutionEngine/JIT/MultiJITTest.cpp | 8 +++---- .../JIT/OProfileJITEventListenerTest.cpp | 5 ++--- .../MCJIT/MCJITMemoryManagerTest.cpp | 4 ++-- unittests/ExecutionEngine/MCJIT/MCJITTest.cpp | 2 +- unittests/ExecutionEngine/MCJIT/MCJITTestBase.h | 2 +- unittests/Support/AlignOfTest.cpp | 1 - unittests/Support/AllocatorTest.cpp | 1 - unittests/Support/BlockFrequencyTest.cpp | 3 +-- unittests/Support/Casting.cpp | 1 - unittests/Support/CommandLineTest.cpp | 4 +--- unittests/Support/ConstantRangeTest.cpp | 1 - unittests/Support/EndianTest.cpp | 2 +- unittests/Support/FileOutputBufferTest.cpp | 2 -- unittests/Support/IntegersSubsetTest.cpp | 4 +--- unittests/Support/ManagedStatic.cpp | 2 +- unittests/Support/MemoryBufferTest.cpp | 1 - unittests/Support/MemoryTest.cpp | 1 - unittests/Support/Path.cpp | 3 +-- unittests/Support/RegexTest.cpp | 2 +- unittests/Support/ValueHandleTest.cpp | 5 +---- unittests/Support/formatted_raw_ostream_test.cpp | 4 ++-- unittests/Transforms/Utils/Cloning.cpp | 8 +++---- unittests/Transforms/Utils/IntegerDivision.cpp | 6 +++--- unittests/Transforms/Utils/Local.cpp | 3 +-- unittests/VMCore/ConstantsTest.cpp | 4 ++-- unittests/VMCore/DominatorTreeTest.cpp | 4 ++-- unittests/VMCore/IRBuilderTest.cpp | 5 ++--- unittests/VMCore/InstructionsTest.cpp | 6 +++--- unittests/VMCore/MDBuilderTest.cpp | 3 +-- unittests/VMCore/MetadataTest.cpp | 8 +++---- unittests/VMCore/PassManagerTest.cpp | 25 +++++++++++----------- unittests/VMCore/TypeBuilderTest.cpp | 3 +-- unittests/VMCore/ValueMapTest.cpp | 5 ++--- unittests/VMCore/VerifierTest.cpp | 4 ++-- 49 files changed, 103 insertions(+), 131 deletions(-) (limited to 'unittests/Support/RegexTest.cpp') diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp index 117b8204b9..ff350a7872 100644 --- a/unittests/ADT/APFloatTest.cpp +++ b/unittests/ADT/APFloatTest.cpp @@ -7,14 +7,14 @@ // //===----------------------------------------------------------------------===// -#include -#include -#include "llvm/Support/raw_ostream.h" -#include "gtest/gtest.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/raw_ostream.h" +#include "gtest/gtest.h" +#include +#include using namespace llvm; diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp index 49d7e703de..2a4c5b4c49 100644 --- a/unittests/ADT/APIntTest.cpp +++ b/unittests/ADT/APIntTest.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include -#include "gtest/gtest.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallString.h" +#include "gtest/gtest.h" +#include using namespace llvm; diff --git a/unittests/ADT/SCCIteratorTest.cpp b/unittests/ADT/SCCIteratorTest.cpp index 00fa0665dd..92b4b317cf 100644 --- a/unittests/ADT/SCCIteratorTest.cpp +++ b/unittests/ADT/SCCIteratorTest.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include -#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/GraphTraits.h" #include "gtest/gtest.h" +#include using namespace llvm; diff --git a/unittests/ADT/SmallStringTest.cpp b/unittests/ADT/SmallStringTest.cpp index 660ac44a8b..9398e99c91 100644 --- a/unittests/ADT/SmallStringTest.cpp +++ b/unittests/ADT/SmallStringTest.cpp @@ -11,11 +11,11 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ADT/SmallString.h" -#include +#include "gtest/gtest.h" #include #include +#include using namespace llvm; diff --git a/unittests/ADT/SmallVectorTest.cpp b/unittests/ADT/SmallVectorTest.cpp index 7fd71f5eb0..90c7982699 100644 --- a/unittests/ADT/SmallVectorTest.cpp +++ b/unittests/ADT/SmallVectorTest.cpp @@ -11,11 +11,11 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" -#include +#include "gtest/gtest.h" #include +#include using namespace llvm; diff --git a/unittests/ADT/StringRefTest.cpp b/unittests/ADT/StringRefTest.cpp index ead372f365..fa87cd0e2c 100644 --- a/unittests/ADT/StringRefTest.cpp +++ b/unittests/ADT/StringRefTest.cpp @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/raw_ostream.h" +#include "gtest/gtest.h" using namespace llvm; namespace llvm { diff --git a/unittests/ADT/TinyPtrVectorTest.cpp b/unittests/ADT/TinyPtrVectorTest.cpp index 15d5532125..a4f92ffbe3 100644 --- a/unittests/ADT/TinyPtrVectorTest.cpp +++ b/unittests/ADT/TinyPtrVectorTest.cpp @@ -11,12 +11,12 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/TinyPtrVector.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/type_traits.h" +#include "gtest/gtest.h" #include #include #include diff --git a/unittests/ADT/TwineTest.cpp b/unittests/ADT/TwineTest.cpp index e9cc41d13f..39d3b561b6 100644 --- a/unittests/ADT/TwineTest.cpp +++ b/unittests/ADT/TwineTest.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ADT/Twine.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" +#include "gtest/gtest.h" using namespace llvm; namespace { diff --git a/unittests/ADT/ilistTest.cpp b/unittests/ADT/ilistTest.cpp index 09a699a962..83eaa31981 100644 --- a/unittests/ADT/ilistTest.cpp +++ b/unittests/ADT/ilistTest.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include -#include "gtest/gtest.h" #include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist_node.h" +#include "gtest/gtest.h" +#include using namespace llvm; diff --git a/unittests/Analysis/ScalarEvolutionTest.cpp b/unittests/Analysis/ScalarEvolutionTest.cpp index c30492a5f0..1820345f85 100644 --- a/unittests/Analysis/ScalarEvolutionTest.cpp +++ b/unittests/Analysis/ScalarEvolutionTest.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/ScalarEvolutionExpressions.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/GlobalVariable.h" #include "llvm/Constants.h" +#include "llvm/GlobalVariable.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/ADT/SmallVector.h" #include "gtest/gtest.h" namespace llvm { diff --git a/unittests/ExecutionEngine/ExecutionEngineTest.cpp b/unittests/ExecutionEngine/ExecutionEngineTest.cpp index 74a2ccdd06..04fbb7e39b 100644 --- a/unittests/ExecutionEngine/ExecutionEngineTest.cpp +++ b/unittests/ExecutionEngine/ExecutionEngineTest.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ExecutionEngine/Interpreter.h" #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp index 333888a565..edaf4ba1d1 100644 --- a/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp @@ -8,15 +8,14 @@ //===----------------------------------------------------------------------===// #include "llvm/ExecutionEngine/JITEventListener.h" - -#include "llvm/LLVMContext.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" -#include "llvm/TypeBuilder.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/CodeGen/MachineCodeInfo.h" #include "llvm/ExecutionEngine/JIT.h" +#include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/TypeBuilder.h" #include "gtest/gtest.h" #include diff --git a/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h b/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h index 5f02b38847..815164678b 100644 --- a/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h +++ b/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h @@ -10,24 +10,22 @@ #ifndef JIT_EVENT_LISTENER_TEST_COMMON_H #define JIT_EVENT_LISTENER_TEST_COMMON_H +#include "llvm/CodeGen/MachineCodeInfo.h" +#include "llvm/Config/config.h" #include "llvm/DIBuilder.h" #include "llvm/DebugInfo.h" +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/IRBuilder.h" #include "llvm/Instructions.h" #include "llvm/Module.h" -#include "llvm/TypeBuilder.h" -#include "llvm/CodeGen/MachineCodeInfo.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/TargetSelect.h" -#include "llvm/Config/config.h" - +#include "llvm/TypeBuilder.h" #include "gtest/gtest.h" - -#include #include #include +#include typedef std::vector > SourceLocations; typedef std::map NativeCodeMap; diff --git a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp index be5d152c1c..2741e02b37 100644 --- a/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp @@ -7,14 +7,14 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ExecutionEngine/JITMemoryManager.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/GlobalValue.h" #include "llvm/LLVMContext.h" -#include "llvm/ADT/ArrayRef.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/ExecutionEngine/JIT/JITTest.cpp b/unittests/ExecutionEngine/JIT/JITTest.cpp index 6e54449beb..3e883ddb26 100644 --- a/unittests/ExecutionEngine/JIT/JITTest.cpp +++ b/unittests/ExecutionEngine/JIT/JITTest.cpp @@ -7,28 +7,27 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/Assembly/Parser.h" #include "llvm/BasicBlock.h" +#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Constant.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/Function.h" #include "llvm/GlobalValue.h" #include "llvm/GlobalVariable.h" #include "llvm/IRBuilder.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/Type.h" -#include "llvm/TypeBuilder.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/Assembly/Parser.h" -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetSelect.h" - +#include "llvm/Type.h" +#include "llvm/TypeBuilder.h" #include "gtest/gtest.h" #include diff --git a/unittests/ExecutionEngine/JIT/MultiJITTest.cpp b/unittests/ExecutionEngine/JIT/MultiJITTest.cpp index 4a22e2f641..0b5190cb39 100644 --- a/unittests/ExecutionEngine/JIT/MultiJITTest.cpp +++ b/unittests/ExecutionEngine/JIT/MultiJITTest.cpp @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/ExecutionEngine/JIT.h" #include "llvm/Assembly/Parser.h" #include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" #include "llvm/Support/SourceMgr.h" +#include "gtest/gtest.h" #include using namespace llvm; diff --git a/unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp b/unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp index 9b0ee60992..7057fcaf1d 100644 --- a/unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp +++ b/unittests/ExecutionEngine/JIT/OProfileJITEventListenerTest.cpp @@ -7,12 +7,11 @@ // //===--------------------------------------------------------------------------------------===// -#include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/ExecutionEngine/OProfileWrapper.h" #include "JITEventListenerTestCommon.h" - -#include +#include "llvm/ExecutionEngine/JITEventListener.h" #include +#include using namespace llvm; diff --git a/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp index eeea9d7652..ab09acad0d 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ExecutionEngine/JIT.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp index 92230f3f5e..e9cf904b18 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp @@ -12,9 +12,9 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/ExecutionEngine/MCJIT.h" #include "MCJITTestBase.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h index e34074b2e0..006bbbe528 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h +++ b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h @@ -17,8 +17,8 @@ #ifndef MCJIT_TEST_BASE_H #define MCJIT_TEST_BASE_H -#include "llvm/ADT/Triple.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Triple.h" #include "llvm/Config/config.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" diff --git a/unittests/Support/AlignOfTest.cpp b/unittests/Support/AlignOfTest.cpp index a9be1c8415..b518f3b861 100644 --- a/unittests/Support/AlignOfTest.cpp +++ b/unittests/Support/AlignOfTest.cpp @@ -9,7 +9,6 @@ #include "llvm/Support/AlignOf.h" #include "llvm/Support/Compiler.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Support/AllocatorTest.cpp b/unittests/Support/AllocatorTest.cpp index 8b463c11df..cb9fa43036 100644 --- a/unittests/Support/AllocatorTest.cpp +++ b/unittests/Support/AllocatorTest.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/Allocator.h" - #include "gtest/gtest.h" #include diff --git a/unittests/Support/BlockFrequencyTest.cpp b/unittests/Support/BlockFrequencyTest.cpp index 9c5bd7b893..ff66bc4e45 100644 --- a/unittests/Support/BlockFrequencyTest.cpp +++ b/unittests/Support/BlockFrequencyTest.cpp @@ -1,7 +1,6 @@ -#include "llvm/Support/DataTypes.h" #include "llvm/Support/BlockFrequency.h" #include "llvm/Support/BranchProbability.h" - +#include "llvm/Support/DataTypes.h" #include "gtest/gtest.h" #include diff --git a/unittests/Support/Casting.cpp b/unittests/Support/Casting.cpp index ad564aa366..01583e43e2 100644 --- a/unittests/Support/Casting.cpp +++ b/unittests/Support/Casting.cpp @@ -10,7 +10,6 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" - #include "gtest/gtest.h" #include diff --git a/unittests/Support/CommandLineTest.cpp b/unittests/Support/CommandLineTest.cpp index 13e903858a..43c8cbd123 100644 --- a/unittests/Support/CommandLineTest.cpp +++ b/unittests/Support/CommandLineTest.cpp @@ -9,11 +9,9 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Config/config.h" - #include "gtest/gtest.h" - -#include #include +#include using namespace llvm; diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp index 263f93c9ff..2c9a1f832e 100644 --- a/unittests/Support/ConstantRangeTest.cpp +++ b/unittests/Support/ConstantRangeTest.cpp @@ -9,7 +9,6 @@ #include "llvm/Support/ConstantRange.h" #include "llvm/Instructions.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Support/EndianTest.cpp b/unittests/Support/EndianTest.cpp index 6fe0247d46..00ea2ae5d9 100644 --- a/unittests/Support/EndianTest.cpp +++ b/unittests/Support/EndianTest.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/Support/Endian.h" #include "llvm/Support/DataTypes.h" +#include "gtest/gtest.h" #include #include using namespace llvm; diff --git a/unittests/Support/FileOutputBufferTest.cpp b/unittests/Support/FileOutputBufferTest.cpp index 4c0d57b845..80d7245368 100644 --- a/unittests/Support/FileOutputBufferTest.cpp +++ b/unittests/Support/FileOutputBufferTest.cpp @@ -8,13 +8,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/FileOutputBuffer.h" - #include "llvm/ADT/OwningPtr.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/PathV2.h" #include "llvm/Support/raw_ostream.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Support/IntegersSubsetTest.cpp b/unittests/Support/IntegersSubsetTest.cpp index 5d1dde4c37..f4298bf595 100644 --- a/unittests/Support/IntegersSubsetTest.cpp +++ b/unittests/Support/IntegersSubsetTest.cpp @@ -7,12 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/APInt.h" #include "llvm/Support/IntegersSubset.h" +#include "llvm/ADT/APInt.h" #include "llvm/Support/IntegersSubsetMapping.h" - #include "gtest/gtest.h" - #include using namespace llvm; diff --git a/unittests/Support/ManagedStatic.cpp b/unittests/Support/ManagedStatic.cpp index bfeb0a7b6f..79eb098e56 100644 --- a/unittests/Support/ManagedStatic.cpp +++ b/unittests/Support/ManagedStatic.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// #include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/Threading.h" #include "llvm/Config/config.h" +#include "llvm/Support/Threading.h" #ifdef HAVE_PTHREAD_H #include #endif diff --git a/unittests/Support/MemoryBufferTest.cpp b/unittests/Support/MemoryBufferTest.cpp index 6c78cd80e8..1d9f482c51 100644 --- a/unittests/Support/MemoryBufferTest.cpp +++ b/unittests/Support/MemoryBufferTest.cpp @@ -13,7 +13,6 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/ADT/OwningPtr.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Support/MemoryTest.cpp b/unittests/Support/MemoryTest.cpp index fcf9aebad2..f4e4f15785 100644 --- a/unittests/Support/MemoryTest.cpp +++ b/unittests/Support/MemoryTest.cpp @@ -9,7 +9,6 @@ #include "llvm/Support/Memory.h" #include "llvm/Support/Process.h" - #include "gtest/gtest.h" #include diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp index 38bad8fb59..878c22796a 100644 --- a/unittests/Support/Path.cpp +++ b/unittests/Support/Path.cpp @@ -7,11 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/FileSystem.h" #include "llvm/Support/PathV2.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/raw_ostream.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp index 38d95955f8..3577d1015e 100644 --- a/unittests/Support/RegexTest.cpp +++ b/unittests/Support/RegexTest.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" #include "llvm/Support/Regex.h" #include "llvm/ADT/SmallVector.h" +#include "gtest/gtest.h" #include using namespace llvm; diff --git a/unittests/Support/ValueHandleTest.cpp b/unittests/Support/ValueHandleTest.cpp index 2e5e5b167c..af03e1bb35 100644 --- a/unittests/Support/ValueHandleTest.cpp +++ b/unittests/Support/ValueHandleTest.cpp @@ -8,14 +8,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/ValueHandle.h" - +#include "llvm/ADT/OwningPtr.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/ADT/OwningPtr.h" - #include "gtest/gtest.h" - #include using namespace llvm; diff --git a/unittests/Support/formatted_raw_ostream_test.cpp b/unittests/Support/formatted_raw_ostream_test.cpp index 4725cedc21..9bb8046913 100644 --- a/unittests/Support/formatted_raw_ostream_test.cpp +++ b/unittests/Support/formatted_raw_ostream_test.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" +#include "llvm/Support/FormattedStream.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/FormattedStream.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Transforms/Utils/Cloning.cpp b/unittests/Transforms/Utils/Cloning.cpp index ea3d5bee78..9df5787028 100644 --- a/unittests/Transforms/Utils/Cloning.cpp +++ b/unittests/Transforms/Utils/Cloning.cpp @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" +#include "llvm/Instructions.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Argument.h" #include "llvm/Constant.h" -#include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/STLExtras.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Transforms/Utils/IntegerDivision.cpp b/unittests/Transforms/Utils/IntegerDivision.cpp index a3211391d6..ecc997c771 100644 --- a/unittests/Transforms/Utils/IntegerDivision.cpp +++ b/unittests/Transforms/Utils/IntegerDivision.cpp @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" +#include "llvm/Transforms/Utils/IntegerDivision.h" #include "llvm/BasicBlock.h" -#include "llvm/GlobalValue.h" #include "llvm/Function.h" +#include "llvm/GlobalValue.h" #include "llvm/IRBuilder.h" #include "llvm/Module.h" -#include "llvm/Transforms/Utils/IntegerDivision.h" +#include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Transforms/Utils/Local.cpp b/unittests/Transforms/Utils/Local.cpp index 727f5ea525..cb9232cae5 100644 --- a/unittests/Transforms/Utils/Local.cpp +++ b/unittests/Transforms/Utils/Local.cpp @@ -7,12 +7,11 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Transforms/Utils/Local.h" #include "llvm/BasicBlock.h" #include "llvm/IRBuilder.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/Transforms/Utils/Local.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/ConstantsTest.cpp b/unittests/VMCore/ConstantsTest.cpp index 25d61cc6ca..5cbd0ce298 100644 --- a/unittests/VMCore/ConstantsTest.cpp +++ b/unittests/VMCore/ConstantsTest.cpp @@ -8,9 +8,9 @@ //===----------------------------------------------------------------------===// #include "llvm/Constants.h" -#include "llvm/Instruction.h" -#include "llvm/InstrTypes.h" #include "llvm/DerivedTypes.h" +#include "llvm/InstrTypes.h" +#include "llvm/Instruction.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "gtest/gtest.h" diff --git a/unittests/VMCore/DominatorTreeTest.cpp b/unittests/VMCore/DominatorTreeTest.cpp index f6a90605a7..77449308a4 100644 --- a/unittests/VMCore/DominatorTreeTest.cpp +++ b/unittests/VMCore/DominatorTreeTest.cpp @@ -1,9 +1,9 @@ +#include "llvm/Analysis/Dominators.h" +#include "llvm/Assembly/Parser.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Analysis/Dominators.h" -#include "llvm/Assembly/Parser.h" #include "llvm/Support/SourceMgr.h" #include "gtest/gtest.h" diff --git a/unittests/VMCore/IRBuilderTest.cpp b/unittests/VMCore/IRBuilderTest.cpp index 665cfb3f13..86482fa056 100644 --- a/unittests/VMCore/IRBuilderTest.cpp +++ b/unittests/VMCore/IRBuilderTest.cpp @@ -7,16 +7,15 @@ // //===----------------------------------------------------------------------===// +#include "llvm/IRBuilder.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/BasicBlock.h" #include "llvm/DataLayout.h" #include "llvm/Function.h" -#include "llvm/IRBuilder.h" #include "llvm/IntrinsicInst.h" #include "llvm/LLVMContext.h" #include "llvm/MDBuilder.h" #include "llvm/Module.h" -#include "llvm/ADT/OwningPtr.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/InstructionsTest.cpp b/unittests/VMCore/InstructionsTest.cpp index a3b13ce92d..f812812de4 100644 --- a/unittests/VMCore/InstructionsTest.cpp +++ b/unittests/VMCore/InstructionsTest.cpp @@ -7,17 +7,17 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Instructions.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/BasicBlock.h" #include "llvm/Constants.h" #include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/IRBuilder.h" -#include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/MDBuilder.h" #include "llvm/Operator.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Analysis/ValueTracking.h" #include "gtest/gtest.h" namespace llvm { diff --git a/unittests/VMCore/MDBuilderTest.cpp b/unittests/VMCore/MDBuilderTest.cpp index 847039b837..11d9872bf0 100644 --- a/unittests/VMCore/MDBuilderTest.cpp +++ b/unittests/VMCore/MDBuilderTest.cpp @@ -7,10 +7,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IRBuilder.h" #include "llvm/MDBuilder.h" +#include "llvm/IRBuilder.h" #include "llvm/Operator.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp index 08927a2ff5..a740d5330a 100644 --- a/unittests/VMCore/MetadataTest.cpp +++ b/unittests/VMCore/MetadataTest.cpp @@ -7,15 +7,15 @@ // //===----------------------------------------------------------------------===// -#include "gtest/gtest.h" +#include "llvm/Metadata.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" #include "llvm/Module.h" -#include "llvm/Type.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/ValueHandle.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Type.h" +#include "gtest/gtest.h" using namespace llvm; namespace { diff --git a/unittests/VMCore/PassManagerTest.cpp b/unittests/VMCore/PassManagerTest.cpp index b5015d16ce..26030125d9 100644 --- a/unittests/VMCore/PassManagerTest.cpp +++ b/unittests/VMCore/PassManagerTest.cpp @@ -7,29 +7,28 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Module.h" -#include "llvm/LLVMContext.h" #include "llvm/PassManager.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/Pass.h" #include "llvm/Analysis/LoopPass.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/Assembly/PrintModulePass.h" +#include "llvm/BasicBlock.h" #include "llvm/CallGraphSCCPass.h" +#include "llvm/CallingConv.h" +#include "llvm/Constants.h" #include "llvm/DataLayout.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/DerivedTypes.h" -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" #include "llvm/Function.h" -#include "llvm/CallingConv.h" -#include "llvm/BasicBlock.h" -#include "llvm/Instructions.h" +#include "llvm/GlobalVariable.h" #include "llvm/InlineAsm.h" +#include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" +#include "llvm/Pass.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/PassManager.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Assembly/PrintModulePass.h" +#include "llvm/Support/raw_ostream.h" #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/TypeBuilderTest.cpp b/unittests/VMCore/TypeBuilderTest.cpp index a746b1f738..51face076d 100644 --- a/unittests/VMCore/TypeBuilderTest.cpp +++ b/unittests/VMCore/TypeBuilderTest.cpp @@ -8,9 +8,8 @@ //===----------------------------------------------------------------------===// #include "llvm/TypeBuilder.h" -#include "llvm/LLVMContext.h" #include "llvm/ADT/ArrayRef.h" - +#include "llvm/LLVMContext.h" #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/ValueMapTest.cpp b/unittests/VMCore/ValueMapTest.cpp index 9bed37dff3..36d371305e 100644 --- a/unittests/VMCore/ValueMapTest.cpp +++ b/unittests/VMCore/ValueMapTest.cpp @@ -8,12 +8,11 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/ValueMap.h" +#include "llvm/ADT/OwningPtr.h" +#include "llvm/Config/llvm-config.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/Config/llvm-config.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/VMCore/VerifierTest.cpp b/unittests/VMCore/VerifierTest.cpp index 324b4e193b..872c7a4a81 100644 --- a/unittests/VMCore/VerifierTest.cpp +++ b/unittests/VMCore/VerifierTest.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Analysis/Verifier.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" @@ -15,8 +17,6 @@ #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/Analysis/Verifier.h" #include "gtest/gtest.h" namespace llvm { -- cgit v1.2.3-70-g09d2