Files
clang-p2996/clang/test/CodeGenCXX/dllimport.cpp
Hans Wennborg b0f2f146bb Allow dllimport/dllexport on inline functions and adjust the linkage.
This is a step towards handling these attributes on classes (PR11170).

Differential Revision: http://reviews.llvm.org/D3772

llvm-svn: 208925
2014-05-15 22:07:49 +00:00

26 lines
720 B
C++

// RUN: %clang_cc1 -triple i686-pc-win32 -x c++ -O2 -disable-llvm-optzns -emit-llvm < %s | FileCheck %s
#define DLLIMPORT __declspec(dllimport)
void DLLIMPORT a();
// CHECK-DAG: declare dllimport void @"\01?a@@YAXXZ"()
inline void DLLIMPORT b() {}
// CHECK-DAG: define available_externally dllimport void @"\01?b@@YAXXZ"()
template <typename T> inline void c() {} // FIXME: MSVC accepts this without 'inline' too.
template void DLLIMPORT c<int>();
// CHECK-DAG: define available_externally dllimport void @"\01??$c@H@@YAXXZ"()
struct S {
void DLLIMPORT a() {}
// CHECK-DAG: define available_externally dllimport x86_thiscallcc void @"\01?a@S@@QAEXXZ"
};
void user(S* s) {
a();
b();
c<int>();
s->a();
}