1 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-GD 2 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -ftls-model=global-dynamic -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-GD 3 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -ftls-model=local-dynamic -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-LD 4 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -ftls-model=initial-exec -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-IE 5 // RUN: %clang_cc1 %s -triple x86_64-pc-linux-gnu -ftls-model=local-exec -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-LE 6 7 int __thread x; 8 int f() { 9 static int __thread y; 10 return y++; 11 } 12 int __thread __attribute__((tls_model("initial-exec"))) z; 13 14 // CHECK-GD: @f.y = internal thread_local global i32 0 15 // CHECK-GD: @x = thread_local global i32 0 16 // CHECK-GD: @z = thread_local(initialexec) global i32 0 17 18 // CHECK-LD: @f.y = internal thread_local(localdynamic) global i32 0 19 // CHECK-LD: @x = thread_local(localdynamic) global i32 0 20 // CHECK-LD: @z = thread_local(initialexec) global i32 0 21 22 // CHECK-IE: @f.y = internal thread_local(initialexec) global i32 0 23 // CHECK-IE: @x = thread_local(initialexec) global i32 0 24 // CHECK-IE: @z = thread_local(initialexec) global i32 0 25 26 // CHECK-LE: @f.y = internal thread_local(localexec) global i32 0 27 // CHECK-LE: @x = thread_local(localexec) global i32 0 28 // CHECK-LE: @z = thread_local(initialexec) global i32 0 29