pr18635.cpp revision 176edba5311f6eff0cad2631449885ddf4fbc9ea
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
9template <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;
15public:
16  constexpr unique_ptr() noexcept : data() {}
17  explicit unique_ptr(T *p) noexcept : data() {}
18};
19
20thread_local unique_ptr<int> x;
21int main() { x = unique_ptr<int>(new int(5)); }
22
23