[llvm] r213994 - IR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot.
NAKAMURA Takumi
geek4civic at gmail.com
Fri Jul 25 17:45:30 PDT 2014
Author: chapuni
Date: Fri Jul 25 19:45:30 2014
New Revision: 213994
URL: http://llvm.org/viewvc/llvm-project?rev=213994&view=rev
Log:
IR/UseTest.cpp: Avoid std::to_string() to appease mingw32 bot.
Modified:
llvm/trunk/unittests/IR/UseTest.cpp
Modified: llvm/trunk/unittests/IR/UseTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/UseTest.cpp?rev=213994&r1=213993&r2=213994&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/UseTest.cpp (original)
+++ llvm/trunk/unittests/IR/UseTest.cpp Fri Jul 25 19:45:30 2014
@@ -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 <string>
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);
}
More information about the llvm-commits
mailing list