2014-09-25 00:28:40 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-unknown-unknown -fms-extensions | FileCheck %s
|
|
|
|
// rdar://17784718
|
|
|
|
|
|
|
|
typedef struct _GUID
|
|
|
|
{
|
|
|
|
unsigned int Data1;
|
|
|
|
unsigned short Data2;
|
|
|
|
unsigned short Data3;
|
|
|
|
unsigned char Data4[ 8 ];
|
|
|
|
} GUID;
|
|
|
|
|
|
|
|
|
|
|
|
template < typename T, const GUID & T_iid = __uuidof(T)>
|
|
|
|
class UUIDTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
UUIDTest() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __declspec(uuid("EAFA1952-66F8-438B-8FBA-AF1BBAE42191")) TestStruct
|
|
|
|
{
|
|
|
|
int foo;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class T> void test_uuidofType(void *arg[sizeof(__uuidof(T))] = 0) {}
|
|
|
|
|
2019-10-04 09:25:59 +08:00
|
|
|
template <class T> void test_uuidofExpr(void *arg[sizeof(__uuidof(typename T::member))] = 0) {}
|
2014-09-25 00:28:40 +08:00
|
|
|
|
|
|
|
struct HasMember { typedef TestStruct member; };
|
|
|
|
|
|
|
|
int main(int argc, const char * argv[])
|
|
|
|
{
|
|
|
|
|
|
|
|
UUIDTest<TestStruct> uuidof_test;
|
|
|
|
test_uuidofType<TestStruct>();
|
|
|
|
test_uuidofExpr<HasMember>();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK: define dso_local i32 @main
|
2014-09-25 00:28:40 +08:00
|
|
|
// CHECK: call void @_ZN8UUIDTestI10TestStructXu8__uuidoftS0_EEC1Ev
|
|
|
|
// CHECK: call void @_Z15test_uuidofTypeI10TestStructEvPPv(i8** null)
|
|
|
|
// CHECK: call void @_Z15test_uuidofExprI9HasMemberEvPPv(i8** null)
|
|
|
|
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK: define linkonce_odr dso_local void @_ZN8UUIDTestI10TestStructXu8__uuidoftS0_EEC1Ev
|
|
|
|
// CHECK: define linkonce_odr dso_local void @_Z15test_uuidofTypeI10TestStructEvPPv
|
|
|
|
// CHECK: define linkonce_odr dso_local void @_Z15test_uuidofExprI9HasMemberEvPPv
|
|
|
|
// CHECK: define linkonce_odr dso_local void @_ZN8UUIDTestI10TestStructXu8__uuidoftS0_EEC2Ev
|