[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / CodeGenCXX / pr18635.cpp
blobc3e9e556155ab06520c551c651692bc8f0c84b4e
1 // RUN: %clang_cc1 -emit-llvm -std=c++11 -triple x86_64-pc-linux-gnu -o- %s | FileCheck %s
3 // Global @x:
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 {
13 F first;
14 S second;
16 pair<T *, int> data;
17 public:
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)); }