llvm-project/clang/test/CodeGenCXX/vtable-key-function-win-comdat.cpp
Rafael Espindola 922f2aa9b2 Bring r325915 back.
The tests that failed on a windows host have been fixed.

Original message:

Start setting dso_local for COFF.

With this there are still some GVs where we don't set dso_local
because setGVProperties is never called. I intend to fix that in
followup commits. This is just the bare minimum to teach
shouldAssumeDSOLocal what it should do for COFF.

llvm-svn: 325940
2018-02-23 19:30:48 +00:00

26 lines
848 B
C++

// RUN: %clang_cc1 %s -triple=x86_64-pc-windows-gnu -emit-llvm -o - | FileCheck %s
namespace std { class type_info; }
extern void use(const std::type_info &rtti);
struct Test1a {
Test1a();
virtual void foo();
virtual void bar();
};
// V-table needs to be defined weakly.
Test1a::Test1a() { use(typeid(Test1a)); }
// This defines the key function.
inline void Test1a::foo() {}
// CHECK: $_ZTV6Test1a = comdat any
// CHECK: $_ZTS6Test1a = comdat any
// CHECK: $_ZTI6Test1a = comdat any
// CHECK-NOT: $_ZTS6Test1a.1 = comdat any
// CHECK-NOT: $_ZTI6Test1a.1 = comdat any
// CHECK: @_ZTV6Test1a = linkonce_odr dso_local unnamed_addr constant {{.*}} ({ i8*, i8* }* @_ZTI6Test1a to i8*)
// CHECK: @_ZTS6Test1a = linkonce_odr dso_local constant
// CHECK: @_ZTI6Test1a = linkonce_odr dso_local constant {{.*}} [8 x i8]* @_ZTS6Test1a