From: NAKAMURA Takumi Date: Sat, 26 Jul 2014 00:45:30 +0000 (+0000) Subject: IR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e0b5c10bf61c04ae36a0a480e756230a670ea066;p=oota-llvm.git IR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213994 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/IR/UseTest.cpp b/unittests/IR/UseTest.cpp index edfef63a377..980175c3e8c 100644 --- a/unittests/IR/UseTest.cpp +++ b/unittests/IR/UseTest.cpp @@ -13,9 +13,9 @@ #include "llvm/IR/Module.h" #include "llvm/IR/User.h" #include "llvm/IR/Instructions.h" +#include "llvm/Support/Format.h" #include "llvm/Support/SourceMgr.h" #include "gtest/gtest.h" -#include using namespace llvm; @@ -37,6 +37,7 @@ TEST(UseTest, sort) { " ret void\n" "}\n"; SMDiagnostic Err; + char vnbuf[8]; Module *M = ParseAssemblyString(ModuleString, nullptr, Err, C); Function *F = M->getFunction("f"); ASSERT_TRUE(F); @@ -48,16 +49,20 @@ TEST(UseTest, sort) { return L.getUser()->getName() < R.getUser()->getName(); }); unsigned I = 0; - for (User *U : X.users()) - EXPECT_EQ("v" + std::to_string(I++), U->getName()); + for (User *U : X.users()) { + snprintf(vnbuf, sizeof(vnbuf), "v%u", I++); + EXPECT_EQ(vnbuf, U->getName()); + } ASSERT_EQ(8u, I); X.sortUseList([](const Use &L, const Use &R) { return L.getUser()->getName() > R.getUser()->getName(); }); I = 0; - for (User *U : X.users()) - EXPECT_EQ("v" + std::to_string((7 - I++)), U->getName()); + for (User *U : X.users()) { + snprintf(vnbuf, sizeof(vnbuf), "v%u", (7 - I++)); + EXPECT_EQ(vnbuf, U->getName()); + } ASSERT_EQ(8u, I); }