diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/unittests/IR/WaymarkTest.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/unittests/IR/WaymarkTest.cpp')
| -rw-r--r-- | gnu/llvm/unittests/IR/WaymarkTest.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/gnu/llvm/unittests/IR/WaymarkTest.cpp b/gnu/llvm/unittests/IR/WaymarkTest.cpp deleted file mode 100644 index 4d2671c06c1..00000000000 --- a/gnu/llvm/unittests/IR/WaymarkTest.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//===- llvm/unittest/IR/WaymarkTest.cpp - getUser() unit tests ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// we perform white-box tests -// -#include "llvm/IR/Constants.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/LLVMContext.h" -#include "gtest/gtest.h" -#include <algorithm> - -namespace llvm { -namespace { - -TEST(WaymarkTest, NativeArray) { - LLVMContext Context; - static uint8_t tail[22] = "s02s33s30y2y0s1x0syxS"; - Value * values[22]; - 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)); - ASSERT_NE(A, (const CallInst*)nullptr); - ASSERT_EQ(1U + 22, A->getNumOperands()); - const Use *U = &A->getOperandUse(0); - const Use *Ue = &A->getOperandUse(22); - for (; U != Ue; ++U) - { - EXPECT_EQ(A, U->getUser()); - } - delete A; -} - -TEST(WaymarkTest, TwoBit) { - Use* many = (Use*)calloc(sizeof(Use), 8212 + 1); - ASSERT_TRUE(many); - Use::initTags(many, many + 8212); - for (Use *U = many, *Ue = many + 8212 - 1; U != Ue; ++U) - { - EXPECT_EQ(reinterpret_cast<User *>(Ue + 1), U->getUser()); - } - free(many); -} - -} // end anonymous namespace -} // end namespace llvm |
