From ec8e54bbefec9932cb0e26b020550d7c371acfb1 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 7 May 2015 21:19:06 +0000 Subject: [MS ABI] Make sure we number thread_local statics seperately The thread_local variables need their own numbers, they can't share with the other static local variables. llvm-svn: 236774 --- clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'clang/test') diff --git a/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp b/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp index 76583d0c6f9..5f6849dde03 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fms-extensions -fms-compatibility -fms-compatibility-version=19 -std=c++11 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s +// REQUIRES: asserts + struct S { S(); ~S(); @@ -9,6 +11,10 @@ struct S { // CHECK-DAG: @"\01?s@?1??g@@YAAAUS@@XZ@4U2@A" = linkonce_odr global %struct.S zeroinitializer // CHECK-DAG: @"\01?$TSS0@?1??g@@YAAAUS@@XZ" = linkonce_odr global i32 0 // CHECK-DAG: @_Init_thread_epoch = external thread_local global i32, align 4 +// CHECK-DAG: @"\01?j@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr thread_local global %struct.S zeroinitializer +// CHECK-DAG: @"\01??__J?1??h@@YAAAUS@@_N@Z@51" = linkonce_odr thread_local global i32 0 +// CHECK-DAG: @"\01?i@?1??h@@YAAAUS@@_N@Z@4U2@A" = linkonce_odr global %struct.S zeroinitializer +// CHECK-DAG: @"\01?$TSS0@?1??h@@YAAAUS@@_N@Z" = linkonce_odr global i32 0 // CHECK-LABEL: define {{.*}} @"\01?f@@YAAAUS@@XZ"() extern inline S &f() { @@ -80,4 +86,8 @@ extern inline S &g() { return s; } -// REQUIRES: asserts +extern inline S&h(bool b) { + static thread_local S j; + static S i; + return b ? j : i; +} -- cgit v1.2.3