Skip to content

Commit cf9b9be

Browse files
committed
[llvm][EmbedBitcodePass] Pre-commit test for using WPD with FatLTO
This is a reduced test case from #139440.
1 parent 3315b84 commit cf9b9be

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; RUN: opt --mtriple x86_64-unknown-linux-gnu < %s -passes="embed-bitcode<thinlto>" -S | FileCheck %s
2+
3+
; CHECK-NOT: $_ZTV3Foo = comdat any
4+
$_ZTV3Foo = comdat any
5+
6+
$_ZTI3Foo = comdat any
7+
8+
; CHECK: @_ZTV3Foo = external hidden unnamed_addr constant { [5 x ptr] }, align 8
9+
; CHECK: @_ZTI3Foo = linkonce_odr hidden constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Foo, ptr @_ZTISt13runtime_error }, comdat, align 8
10+
; CHECK: @llvm.embedded.object = private constant {{.*}}, section ".llvm.lto", align 1
11+
; CHECK: @llvm.compiler.used = appending global [1 x ptr] [ptr @llvm.embedded.object], section "llvm.metadata"
12+
@_ZTV3Foo = linkonce_odr hidden unnamed_addr constant { [5 x ptr] } { [5 x ptr] [ptr null, ptr @_ZTI3Foo, ptr @_ZN3FooD2Ev, ptr @_ZN3FooD0Ev, ptr @_ZNKSt13runtime_error4whatEv] }, comdat, align 8, !type !0, !type !1, !type !2, !type !3, !type !4, !type !5
13+
@_ZTI3Foo = linkonce_odr hidden constant { ptr, ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr @_ZTS3Foo, ptr @_ZTISt13runtime_error }, comdat, align 8
14+
@_ZTVN10__cxxabiv120__si_class_type_infoE = external global [0 x ptr]
15+
@_ZTS3Foo = constant [5 x i8] c"3Foo\00"
16+
@_ZTISt13runtime_error = external constant ptr
17+
18+
declare void @_ZN3FooD2Ev()
19+
20+
declare void @_ZN3FooD0Ev()
21+
22+
declare ptr @_ZNKSt13runtime_error4whatEv()
23+
24+
!llvm.module.flags = !{!6}
25+
26+
!0 = !{i64 16, !"_ZTS3Foo"}
27+
!1 = !{i64 32, !"_ZTSM3FooKDoFPKcvE.virtual"}
28+
!2 = !{i64 16, !"_ZTSSt13runtime_error"}
29+
!3 = !{i64 32, !"_ZTSMSt13runtime_errorKDoFPKcvE.virtual"}
30+
!4 = !{i64 16, !"_ZTSSt9exception"}
31+
!5 = !{i64 32, !"_ZTSMSt9exceptionKDoFPKcvE.virtual"}
32+
!6 = !{i32 1, !"EnableSplitLTOUnit", i32 1}

0 commit comments

Comments
 (0)