1 // RUN: %clang_cc1 -emit-llvm -std=c++11 -triple x86_64-pc-linux-gnu -o- %s | FileCheck %s 2 3 // Global @x: 4 // CHECK: [[X_GLOBAL:@[^ ]+]]{{.*}}thread_local global 5 6 // returned somewhere in TLS wrapper: 7 // CHECK: ret{{.*}}[[X_GLOBAL]] 8 9 template <typename T> class unique_ptr { 10 template <typename F, typename S> struct pair { 11 F first; 12 S second; 13 }; 14 pair<T *, int> data; 15 public: 16 constexpr unique_ptr() noexcept : data() {} 17 explicit unique_ptr(T *p) noexcept : data() {} 18 }; 19 20 thread_local unique_ptr<int> x; 21 int main() { x = unique_ptr<int>(new int(5)); } 22 23