Use move semantics if possible to construct ConstantRanges.
[oota-llvm.git] / unittests / Support / FileOutputBufferTest.cpp
index 80d724536821fc3a5fb9a59b2cd9dc12612f74bf..5e873193f28868fbcc8a41665354cd16111cf4d3 100644 (file)
@@ -11,7 +11,7 @@
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
-#include "llvm/Support/PathV2.h"
+#include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
 
@@ -30,12 +30,8 @@ TEST(FileOutputBuffer, Test) {
   // Create unique temporary directory for these tests
   SmallString<128> TestDirectory;
   {
-    int fd;
     ASSERT_NO_ERROR(
-      fs::unique_file("FileOutputBuffer-test-%%-%%-%%-%%/dir", fd,
-                      TestDirectory));
-    ::close(fd);
-    TestDirectory = path::parent_path(TestDirectory);
+        fs::createUniqueDirectory("FileOutputBuffer-test", TestDirectory));
   }
 
   // TEST 1: Verify commit case.