1 // RUN: %clang_cc1 -emit-llvm -std=c++11 -triple x86_64-pc-linux-gnu -o- %s | FileCheck %s
4 // CHECK: [[X_GLOBAL:@[^ ]+]]{{.*}}thread_local global
6 // returned somewhere in TLS wrapper:
7 // CHECK: define {{.+}} ptr @_ZTW1x(
8 // CHECK: [[X_GLOBAL_ADDR:%[^ ]+]] = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 [[X_GLOBAL]])
9 // CHECK: ret{{.*}}[[X_GLOBAL_ADDR]]
11 template <typename T
> class unique_ptr
{
12 template <typename F
, typename S
> struct pair
{
18 constexpr unique_ptr() noexcept
: data() {}
19 explicit unique_ptr(T
*p
) noexcept
: data() {}
22 thread_local unique_ptr
<int> x
;
23 int main() { x
= unique_ptr
<int>(new int(5)); }