llvm-project/clang/test/CodeGenCXX/dllexport-alias.cpp
Peter Collingbourne d914fd2163 IRgen: Mark aliases of ctors and dtors as unnamed_addr.
This is not only semantically correct but ensures that they will not
be marked as address-significant once D48155 lands.

Differential Revision: https://reviews.llvm.org/D48206

llvm-svn: 334982
2018-06-18 20:58:54 +00:00

19 lines
584 B
C++

// RUN: %clang_cc1 -triple x86_64-windows-gnu -mconstructor-aliases %s -S -emit-llvm -o - | FileCheck %s
// This test assumes that the C1 constructor will be aliased to the C2
// constructor, and the D1 destructor to the D2. It then checks that the aliases
// are dllexport'ed.
class __declspec(dllexport) A {
public:
A();
~A();
};
A::A() {}
A::~A() {}
// CHECK: @_ZN1AC1Ev = dso_local dllexport unnamed_addr alias void (%class.A*), void (%class.A*)* @_ZN1AC2Ev
// CHECK: @_ZN1AD1Ev = dso_local dllexport unnamed_addr alias void (%class.A*), void (%class.A*)* @_ZN1AD2Ev