xref: /llvm-project/llvm/test/Assembler/thinlto-vtable-summary2.ll (revision 071855dc2c4939c0b7c51da63e84bd956e49c74a)
1;; Test to ensure that the summary is correctly printed when there is both a
2;; global variable summary and a vtable typeid summary entry for the same
3;; symbol.
4
5; RUN: opt %s -S -module-summary | FileCheck %s
6;; Make sure it round trips correctly.
7; RUN: opt %s -S -module-summary -o - | llvm-as -o - | llvm-dis -o - | FileCheck %s
8
9;; These summary entries should get numbered differently.
10; CHECK: ^2 = gv: (name: "_ZTS1A"
11; CHECK: ^6 = typeidCompatibleVTable: (name: "_ZTS1A"
12
13; ModuleID = 'thinlto-vtable-summary2.cc'
14source_filename = "thinlto-vtable-summary2.cc"
15target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
16target triple = "x86_64-unknown-linux-gnu"
17
18@_ZTV1A = dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr @_ZTI1A, ptr @_ZN1A3fooEv] }, align 8, !type !0, !type !1
19@_ZTVN10__cxxabiv117__class_type_infoE = external global [0 x ptr]
20@_ZTS1A = dso_local constant [3 x i8] c"1A\00", align 1
21@_ZTI1A = dso_local constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 2), ptr @_ZTS1A }, align 8
22
23define dso_local noundef i32 @_ZN1A3fooEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr align 2 {
24entry:
25  %this.addr = alloca ptr, align 8
26  store ptr %this, ptr %this.addr, align 8
27  %this1 = load ptr, ptr %this.addr, align 8
28  ret i32 1
29}
30
31!0 = !{i64 16, !"_ZTS1A"}
32!1 = !{i64 16, !"_ZTSM1AFivE.virtual"}
33