Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / vtable-key-function-win-comdat.cpp
blobdd4fd9f8754a8d309ba726041743ff8b55eb6c3b
1 // RUN: %clang_cc1 %s -triple=x86_64-pc-windows-gnu -emit-llvm -o - | FileCheck %s
3 namespace std { class type_info; }
4 extern void use(const std::type_info &rtti);
6 struct Test1a {
7 Test1a();
8 virtual void foo();
9 virtual void bar();
12 // V-table needs to be defined weakly.
13 Test1a::Test1a() { use(typeid(Test1a)); }
14 // This defines the key function.
15 inline void Test1a::foo() {}
17 // CHECK: $_ZTV6Test1a = comdat any
18 // CHECK: $_ZTS6Test1a = comdat any
19 // CHECK: $_ZTI6Test1a = comdat any
20 // CHECK-NOT: $_ZTS6Test1a.1 = comdat any
21 // CHECK-NOT: $_ZTI6Test1a.1 = comdat any
23 // CHECK: @_ZTV6Test1a = linkonce_odr dso_local unnamed_addr constant {{.*}} ptr @_ZTI6Test1a
24 // CHECK: @_ZTS6Test1a = linkonce_odr dso_local constant
25 // CHECK: @_ZTI6Test1a = linkonce_odr dso_local constant {{.*}} ptr @_ZTS6Test1a