diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-06-18 15:55:13 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-06-18 15:55:13 +0000 |
commit | ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5 (patch) | |
tree | 0e5d398de6a617ade8213438b547087ac3e1ab5e /clang/test/CodeGenCXX/dllimport.cpp | |
parent | dbb3e3e64f40098a74e1d337cfbc1212959fe832 (diff) | |
download | bcm5719-llvm-ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5.tar.gz bcm5719-llvm-ef2272c49e1da9ef22b142ea4a8dca86a9cf80e5.zip |
Inherit dll attributes to static locals
This makes us handle static locals in exported/imported functions correctly.
Differential Revision: http://reviews.llvm.org/D4136
llvm-svn: 211173
Diffstat (limited to 'clang/test/CodeGenCXX/dllimport.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/dllimport.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/dllimport.cpp b/clang/test/CodeGenCXX/dllimport.cpp index 78a15b518e8..6d293998851 100644 --- a/clang/test/CodeGenCXX/dllimport.cpp +++ b/clang/test/CodeGenCXX/dllimport.cpp @@ -85,6 +85,15 @@ USEVAR(GlobalRedecl3) namespace ns { __declspec(dllimport) int ExternalGlobal; } USEVAR(ns::ExternalGlobal) +int f(); +// MO1-DAG: @"\01?x@?1??inlineStaticLocalsFunc@@YAHXZ@4HA" = available_externally dllimport global i32 0 +// MO1-DAG: @"\01??_B?1??inlineStaticLocalsFunc@@YAHXZ@51" = available_externally dllimport global i32 0 +inline int __declspec(dllimport) inlineStaticLocalsFunc() { + static int x = f(); + return x++; +}; +USE(inlineStaticLocalsFunc); + //===----------------------------------------------------------------------===// |