summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/dllimport.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-06-18 15:55:13 +0000
committerHans Wennborg <hans@hanshq.net>2014-06-18 15:55:13 +0000
commitef2272c49e1da9ef22b142ea4a8dca86a9cf80e5 (patch)
tree0e5d398de6a617ade8213438b547087ac3e1ab5e /clang/test/CodeGenCXX/dllimport.cpp
parentdbb3e3e64f40098a74e1d337cfbc1212959fe832 (diff)
downloadbcm5719-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.cpp9
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);
+
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud