diff options
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/cxx11-thread-local.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx11-thread-local.cpp b/clang/test/CodeGenCXX/cxx11-thread-local.cpp index b96b027bb80..e00a881a660 100644 --- a/clang/test/CodeGenCXX/cxx11-thread-local.cpp +++ b/clang/test/CodeGenCXX/cxx11-thread-local.cpp @@ -20,6 +20,18 @@ struct U { static thread_local int m; }; // DARWIN: @_ZN1U1mE = internal thread_local global i32 0 thread_local int U::m = f(); +namespace MismatchedInitType { + // Check that we don't crash here when we're forced to create a new global + // variable (with a different type) when we add the initializer. + union U { + int a; + float f; + constexpr U() : f(0.0) {} + }; + static thread_local U u; + void *p = &u; +} + template<typename T> struct V { static thread_local int m; }; template<typename T> thread_local int V<T>::m = g(); |

