diff options
author | Derek Schuff <dschuff@chromium.org> | 2013-01-09 16:55:43 -0800 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2013-01-11 13:47:37 -0800 |
commit | b770d0e0636a4b5ad61b1ca661caee67576c05fc (patch) | |
tree | c486ce032d41f97313c50629bd5b879f53e6ccbf /unittests/Support/FileOutputBufferTest.cpp | |
parent | b835840cf112a6178506d834b58aa625f59a8994 (diff) | |
parent | 1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410 (diff) |
Merge commit '1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410'
deplib features commented out due to removal upstream;
will add back as a localmod
Conflicts:
include/llvm/ADT/Triple.h
include/llvm/MC/MCAssembler.h
include/llvm/Target/TargetFrameLowering.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/BranchFolding.cpp
lib/LLVMBuild.txt
lib/Linker/LinkArchives.cpp
lib/MC/MCAssembler.cpp
lib/MC/MCELFStreamer.cpp
lib/Makefile
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMSubtarget.h
lib/Target/ARM/ARMTargetObjectFile.cpp
lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
lib/Target/Mips/MipsInstrFPU.td
lib/Target/Mips/MipsInstrInfo.td
lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86Subtarget.h
lib/VMCore/Module.cpp
test/MC/MachO/ARM/nop-armv4-padding.s
tools/Makefile
tools/llc/llc.cpp
tools/lto/LTOModule.cpp
tools/lto/lto.cpp
Diffstat (limited to 'unittests/Support/FileOutputBufferTest.cpp')
-rw-r--r-- | unittests/Support/FileOutputBufferTest.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/unittests/Support/FileOutputBufferTest.cpp b/unittests/Support/FileOutputBufferTest.cpp index edd350afcf..80d7245368 100644 --- a/unittests/Support/FileOutputBufferTest.cpp +++ b/unittests/Support/FileOutputBufferTest.cpp @@ -7,13 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Support/FileOutputBuffer.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/PathV2.h" #include "llvm/Support/raw_ostream.h" - #include "gtest/gtest.h" using namespace llvm; @@ -27,13 +26,6 @@ using namespace llvm::sys; } else {} namespace { - - -// NOTE: Temporarily run this test on unix only. Once the file mapping -// routines are ported to Windows, this conditional can be removed. -#if LLVM_ON_UNIX - - TEST(FileOutputBuffer, Test) { // Create unique temporary directory for these tests SmallString<128> TestDirectory; @@ -45,7 +37,7 @@ TEST(FileOutputBuffer, Test) { ::close(fd); TestDirectory = path::parent_path(TestDirectory); } - + // TEST 1: Verify commit case. SmallString<128> File1(TestDirectory); File1.append("/file1"); @@ -61,7 +53,7 @@ TEST(FileOutputBuffer, Test) { } // Verify file exists and starts with special header. bool MagicMatches = false; - ASSERT_NO_ERROR(fs::has_magic(Twine(File1), Twine("AABBCCDDEEFFGGHHIIJJ"), + ASSERT_NO_ERROR(fs::has_magic(Twine(File1), Twine("AABBCCDDEEFFGGHHIIJJ"), MagicMatches)); EXPECT_TRUE(MagicMatches); // Verify file is correct size. @@ -82,8 +74,7 @@ TEST(FileOutputBuffer, Test) { // Verify file does not exist (because buffer not commited). bool Exists = false; ASSERT_NO_ERROR(fs::exists(Twine(File2), Exists)); - EXPECT_FALSE(Exists); - + EXPECT_FALSE(Exists); // TEST 3: Verify sizing down case. SmallString<128> File3(TestDirectory); @@ -100,7 +91,7 @@ TEST(FileOutputBuffer, Test) { } // Verify file exists and starts with special header. bool MagicMatches3 = false; - ASSERT_NO_ERROR(fs::has_magic(Twine(File3), Twine("AABBCCDDEEFFGGHHIIJJ"), + ASSERT_NO_ERROR(fs::has_magic(Twine(File3), Twine("AABBCCDDEEFFGGHHIIJJ"), MagicMatches3)); EXPECT_TRUE(MagicMatches3); // Verify file is correct size. @@ -108,13 +99,12 @@ TEST(FileOutputBuffer, Test) { ASSERT_NO_ERROR(fs::file_size(Twine(File3), File3Size)); ASSERT_EQ(File3Size, 5000ULL); - // TEST 4: Verify file can be made executable. SmallString<128> File4(TestDirectory); File4.append("/file4"); { OwningPtr<FileOutputBuffer> Buffer; - ASSERT_NO_ERROR(FileOutputBuffer::create(File4, 8192, Buffer, + ASSERT_NO_ERROR(FileOutputBuffer::create(File4, 8192, Buffer, FileOutputBuffer::F_executable)); // Start buffer with special header. memcpy(Buffer->getBufferStart(), "AABBCCDDEEFFGGHHIIJJ", 20); @@ -131,7 +121,4 @@ TEST(FileOutputBuffer, Test) { uint32_t RemovedCount; ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), RemovedCount)); } - -#endif // LLVM_ON_UNIX - } // anonymous namespace |