diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-05-07 21:19:06 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-05-07 21:19:06 +0000 |
commit | ec8e54bbefec9932cb0e26b020550d7c371acfb1 (patch) | |
tree | e7a299717afc16b9b3196b03254590de055e5d78 /clang/test | |
parent | 8d062ad560647fc0031735cb688cce5304f41046 (diff) | |
download | bcm5719-llvm-ec8e54bbefec9932cb0e26b020550d7c371acfb1.tar.gz bcm5719-llvm-ec8e54bbefec9932cb0e26b020550d7c371acfb1.zip |
[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
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; +} |