You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.207
Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
parent
8e12397d70
commit
eb85e2fc17
32
external/llvm/unittests/ADT/ScopeExitTest.cpp
vendored
32
external/llvm/unittests/ADT/ScopeExitTest.cpp
vendored
@ -1,32 +0,0 @@
|
||||
//===- llvm/unittest/ADT/ScopeExit.cpp - Scope exit unit tests --*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/ScopeExit.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
TEST(ScopeExitTest, Basic) {
|
||||
struct Callable {
|
||||
bool &Called;
|
||||
Callable(bool &Called) : Called(Called) {}
|
||||
Callable(Callable &&RHS) : Called(RHS.Called) {}
|
||||
void operator()() { Called = true; }
|
||||
};
|
||||
bool Called = false;
|
||||
{
|
||||
auto g = make_scope_exit(Callable(Called));
|
||||
EXPECT_FALSE(Called);
|
||||
}
|
||||
EXPECT_TRUE(Called);
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
Reference in New Issue
Block a user