blob: 94b5e4599956d93dd17a31f0bbeb5aaa609e3ea7 [file] [log] [blame]
Alexander Musmanf94c3182014-09-26 06:28:25 +00001// 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