diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
tree | 4def12e759965de927d963ac65840d663ef9d1ea /unittests/IR/WaymarkTest.cpp | |
parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) |
Diffstat (limited to 'unittests/IR/WaymarkTest.cpp')
-rw-r--r-- | unittests/IR/WaymarkTest.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/unittests/IR/WaymarkTest.cpp b/unittests/IR/WaymarkTest.cpp index a8924efed3f5f..4d2671c06c1d9 100644 --- a/unittests/IR/WaymarkTest.cpp +++ b/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)); |