summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR/WaymarkTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/IR/WaymarkTest.cpp')
-rw-r--r--llvm/unittests/IR/WaymarkTest.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/unittests/IR/WaymarkTest.cpp b/llvm/unittests/IR/WaymarkTest.cpp
index a8924efed3f..4d2671c06c1 100644
--- a/llvm/unittests/IR/WaymarkTest.cpp
+++ b/llvm/unittests/IR/WaymarkTest.cpp
@@ -19,16 +19,14 @@
namespace llvm {
namespace {
-Constant *char2constant(char c) {
- return ConstantInt::get(Type::getInt8Ty(getGlobalContext()), c);
-}
-
-
TEST(WaymarkTest, NativeArray) {
+ LLVMContext Context;
static uint8_t tail[22] = "s02s33s30y2y0s1x0syxS";
Value * values[22];
- std::transform(tail, tail + 22, values, char2constant);
- FunctionType *FT = FunctionType::get(Type::getVoidTy(getGlobalContext()), true);
+ std::transform(tail, tail + 22, values, [&](char c) {
+ return ConstantInt::get(Type::getInt8Ty(Context), c);
+ });
+ FunctionType *FT = FunctionType::get(Type::getVoidTy(Context), true);
std::unique_ptr<Function> F(
Function::Create(FT, GlobalValue::ExternalLinkage));
const CallInst *A = CallInst::Create(F.get(), makeArrayRef(values));
OpenPOWER on IntegriCloud