Mercurial > hg > CbC > CbC_llvm
view unittests/Support/ThreadLocalTest.cpp @ 77:54457678186b LLVM3.6
LLVM 3.6
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Sep 2014 22:06:00 +0900 |
parents | |
children | 60c9769439b8 |
line wrap: on
line source
//===- llvm/unittest/Support/ThreadLocalTest.cpp - Therad Local tests ---===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "llvm/Support/ThreadLocal.h" #include "gtest/gtest.h" using namespace llvm; using namespace sys; namespace { class ThreadLocalTest : public ::testing::Test { }; struct S { int i; }; TEST_F(ThreadLocalTest, Basics) { ThreadLocal<const S> x; EXPECT_EQ(nullptr, x.get()); S s; x.set(&s); EXPECT_EQ(&s, x.get()); x.erase(); EXPECT_EQ(nullptr, x.get()); } }