annotate clang/test/CodeGenCXX/pr18635.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -emit-llvm -std=c++11 -triple x86_64-pc-linux-gnu -o- %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // Global @x:
anatofuz
parents:
diff changeset
4 // CHECK: [[X_GLOBAL:@[^ ]+]]{{.*}}thread_local global
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // returned somewhere in TLS wrapper:
anatofuz
parents:
diff changeset
7 // CHECK: ret{{.*}}[[X_GLOBAL]]
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 template <typename T> class unique_ptr {
anatofuz
parents:
diff changeset
10 template <typename F, typename S> struct pair {
anatofuz
parents:
diff changeset
11 F first;
anatofuz
parents:
diff changeset
12 S second;
anatofuz
parents:
diff changeset
13 };
anatofuz
parents:
diff changeset
14 pair<T *, int> data;
anatofuz
parents:
diff changeset
15 public:
anatofuz
parents:
diff changeset
16 constexpr unique_ptr() noexcept : data() {}
anatofuz
parents:
diff changeset
17 explicit unique_ptr(T *p) noexcept : data() {}
anatofuz
parents:
diff changeset
18 };
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 thread_local unique_ptr<int> x;
anatofuz
parents:
diff changeset
21 int main() { x = unique_ptr<int>(new int(5)); }
anatofuz
parents:
diff changeset
22