| //===- llvm/unittest/Support/ThreadLocalTest.cpp - ThreadLocal tests ------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| #include "llvm/Support/ThreadLocal.h" |
| class ThreadLocalTest : public ::testing::Test { |
| TEST_F(ThreadLocalTest, Basics) { |
| std::is_const<std::remove_pointer<decltype(x.get())>::type>::value, |
| "ThreadLocal::get didn't return a pointer to const object"); |
| EXPECT_EQ(nullptr, x.get()); |
| EXPECT_EQ(nullptr, x.get()); |
| !std::is_const<std::remove_pointer<decltype(y.get())>::type>::value, |
| "ThreadLocal::get returned a pointer to const object"); |
| EXPECT_EQ(nullptr, y.get()); |
| EXPECT_EQ(nullptr, y.get()); |