diff options
author | Reid Kleckner <rnk@google.com> | 2016-03-02 01:21:48 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-03-02 01:21:48 +0000 |
commit | ef36b882224929daeffb5f28659d784f694e3008 (patch) | |
tree | 6915e163ddc5e402edcb24faeeb8024c89d5df4e /test/CodeGenCXX/dllimport.cpp | |
parent | 73383157c534bbad9c2089919cc8a8ef0ebc0aa7 (diff) |
Add a few dllimport/dllexport tests. NFC
Summary:
This change just adds tests for some corner cases of dllimport/dllexport,
primarily for some static methods.
We plan to enable dllimport/dllexport support for the PS4, and these
additional tests are for points we previously were testing internally.
-Warren Ristow
SN Systems - Sony Computer Entertainment Group
Reviewers: rnk
Subscribers: silvas
Differential Revision: http://reviews.llvm.org/D17775
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/dllimport.cpp')
-rw-r--r-- | test/CodeGenCXX/dllimport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGenCXX/dllimport.cpp b/test/CodeGenCXX/dllimport.cpp index e336bfb692..433628f9c2 100644 --- a/test/CodeGenCXX/dllimport.cpp +++ b/test/CodeGenCXX/dllimport.cpp @@ -27,6 +27,7 @@ struct ExplicitSpec_NotImported {}; #define USEVAR(var) USEVARTYPE(int, var) #define USE(func) void UNIQ(use)() { func(); } #define USEMEMFUNC(class, func) void (class::*UNIQ(use)())() { return &class::func; } +#define USESTATICMEMFUNC(class, func) void (*UNIQ(use)())() { return &class::func; } #define USECLASS(class) void UNIQ(USE)() { class x; } #define USECOPYASSIGN(class) class& (class::*UNIQ(use)())(class&) { return &class::operator=; } #define USEMOVEASSIGN(class) class& (class::*UNIQ(use)())(class&&) { return &class::operator=; } @@ -590,6 +591,10 @@ struct __declspec(dllimport) T { void a() {} // MO1-DAG: define available_externally dllimport x86_thiscallcc void @"\01?a@T@@QAEXXZ" + static void StaticMethod(); + // MSC-DAG: declare dllimport void @"\01?StaticMethod@T@@SAXXZ"() + // GNU-DAG: declare dllimport void @_ZN1T12StaticMethodEv() + static int b; // MO1-DAG: @"\01?b@T@@2HA" = external dllimport global i32 @@ -602,6 +607,7 @@ struct __declspec(dllimport) T { // M19-DAG: define available_externally dllimport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.T* @"\01??4T@@QAEAAU0@$$QAU0@@Z" }; USEMEMFUNC(T, a) +USESTATICMEMFUNC(T, StaticMethod) USEVAR(T::b) USECOPYASSIGN(T) USEMOVEASSIGN(T) |