diff options
| author | 2017-10-04 20:27:34 +0000 | |
|---|---|---|
| committer | 2017-10-04 20:27:34 +0000 | |
| commit | 31eb748944903b7f4f38afda9851951ca9dfc1ae (patch) | |
| tree | 9b95b6ea45d0874d75eb05b90c0840e191416439 /gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp | |
| parent | Don't try to handle IPv4-compatible IPv6 addresses (diff) | |
| download | wireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.tar.xz wireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.zip | |
Import LLVM 5.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp')
| -rw-r--r-- | gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp b/gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp index ac847039d9f..ed425449784 100644 --- a/gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp +++ b/gnu/llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h" #include "OrcTestCommon.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h" #include "gtest/gtest.h" using namespace llvm; @@ -20,17 +20,15 @@ TEST(IndirectionUtilsTest, MakeStub) { LLVMContext Context; ModuleBuilder MB(Context, "x86_64-apple-macosx10.10", ""); Function *F = MB.createFunctionDecl<void(DummyStruct, DummyStruct)>(""); - SmallVector<AttributeSet, 4> Attrs; - Attrs.push_back( - AttributeSet::get(MB.getModule()->getContext(), 1U, - AttrBuilder().addAttribute(Attribute::StructRet))); - Attrs.push_back( - AttributeSet::get(MB.getModule()->getContext(), 2U, - AttrBuilder().addAttribute(Attribute::ByVal))); - Attrs.push_back( - AttributeSet::get(MB.getModule()->getContext(), ~0U, - AttrBuilder().addAttribute(Attribute::NoUnwind))); - F->setAttributes(AttributeSet::get(MB.getModule()->getContext(), Attrs)); + AttributeSet FnAttrs = AttributeSet::get( + Context, AttrBuilder().addAttribute(Attribute::NoUnwind)); + AttributeSet RetAttrs; // None + AttributeSet ArgAttrs[2] = { + AttributeSet::get(Context, + AttrBuilder().addAttribute(Attribute::StructRet)), + AttributeSet::get(Context, AttrBuilder().addAttribute(Attribute::ByVal)), + }; + F->setAttributes(AttributeList::get(Context, FnAttrs, RetAttrs, ArgAttrs)); auto ImplPtr = orc::createImplPointer(*F->getType(), *MB.getModule(), "", nullptr); orc::makeStub(*F, *ImplPtr); @@ -42,7 +40,7 @@ TEST(IndirectionUtilsTest, MakeStub) { EXPECT_TRUE(Call->isTailCall()) << "Indirect call from stub should be tail call."; EXPECT_TRUE(Call->hasStructRetAttr()) << "makeStub should propagate sret attr on 1st argument."; - EXPECT_TRUE(Call->paramHasAttr(2U, Attribute::ByVal)) + EXPECT_TRUE(Call->paramHasAttr(1U, Attribute::ByVal)) << "makeStub should propagate byval attr on 2nd argument."; } |
