brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · ee67535 Raw
64 lines · plain
1; RUN: opt < %s -passes=internalize -S | FileCheck %s2 3%struct.A = type { ptr }4%struct.B = type { ptr }5%struct.C = type { ptr }6 7; Class A has default visibility, so has no !vcall_visibility metadata before8; or after LTO.9; CHECK-NOT: @_ZTV1A = {{.*}}!vcall_visibility10@_ZTV1A = dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZN1A3fooEv] }, align 8, !type !0, !type !111 12; Class B has hidden visibility but public LTO visibility, so has no13; !vcall_visibility metadata before or after LTO.14; CHECK-NOT: @_ZTV1B = {{.*}}!vcall_visibility15@_ZTV1B = hidden unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZN1B3fooEv] }, align 8, !type !2, !type !316 17; Class C has hidden visibility, so the !vcall_visibility metadata is set to 118; (linkage unit) before LTO, and 2 (translation unit) after LTO.19; CHECK: @_ZTV1C ={{.*}}!vcall_visibility [[MD_TU_VIS:![0-9]+]]20@_ZTV1C = hidden unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZN1C3fooEv] }, align 8, !type !4, !type !5, !vcall_visibility !621 22; Class D has translation unit visibility before LTO, and this is not changed23; by LTO.24; CHECK: @_ZTVN12_GLOBAL__N_11DE = {{.*}}!vcall_visibility [[MD_TU_VIS:![0-9]+]]25@_ZTVN12_GLOBAL__N_11DE = internal unnamed_addr constant { [3 x ptr] } zeroinitializer, align 8, !type !7, !type !9, !vcall_visibility !1126 27define dso_local void @_ZN1A3fooEv(ptr nocapture %this) {28entry:29  ret void30}31 32define hidden void @_ZN1B3fooEv(ptr nocapture %this) {33entry:34  ret void35}36 37define hidden void @_ZN1C3fooEv(ptr nocapture %this) {38entry:39  ret void40}41 42define hidden noalias nonnull ptr @_Z6make_dv() {43entry:44  %call = tail call ptr @_Znwm(i64 8) #345  store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTVN12_GLOBAL__N_11DE, i64 0, i32 0, i64 2), ptr %call, align 846  ret ptr %call47}48 49declare dso_local noalias nonnull ptr @_Znwm(i64)50 51; CHECK: [[MD_TU_VIS]] = !{i64 2}52!0 = !{i64 16, !"_ZTS1A"}53!1 = !{i64 16, !"_ZTSM1AFvvE.virtual"}54!2 = !{i64 16, !"_ZTS1B"}55!3 = !{i64 16, !"_ZTSM1BFvvE.virtual"}56!4 = !{i64 16, !"_ZTS1C"}57!5 = !{i64 16, !"_ZTSM1CFvvE.virtual"}58!6 = !{i64 1}59!7 = !{i64 16, !8}60!8 = distinct !{}61!9 = !{i64 16, !10}62!10 = distinct !{}63!11 = !{i64 2}64