brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 765a775 Raw
61 lines · plain
1;; Test comdat functions.2; RUN: opt < %s -mtriple=x86_64-linux -passes=pgo-instr-gen,instrprof -S | FileCheck %s --check-prefixes=ELF3; RUN: opt < %s -mtriple=x86_64-windows -passes=pgo-instr-gen,instrprof -S | FileCheck %s --check-prefixes=COFF4 5$linkonceodr = comdat any6$weakodr = comdat any7$weak = comdat any8$linkonce = comdat any9 10;; profc/profd have hash suffixes. This definition doesn't have value profiling,11;; so definitions with the same name in other modules must have the same CFG and12;; cannot have value profiling, either. profd can be made private for ELF.13; ELF:   @__profc_linkonceodr.[[#]] = linkonce_odr hidden global {{.*}} comdat, align 814; ELF:   @__profd_linkonceodr.[[#]] = private global {{.*}} comdat($__profc_linkonceodr.[[#]]), align 815; COFF:  @__profc_linkonceodr.[[#]] = linkonce_odr hidden global {{.*}} comdat, align 816; COFF:  @__profd_linkonceodr.[[#]] = linkonce_odr hidden global {{.*}} comdat, align 817define linkonce_odr void @linkonceodr() comdat {18  ret void19}20 21;; weakodr in a comdat is not renamed. There is no guarantee that definitions in22;; other modules don't have value profiling. profd should be conservatively23;; non-private to prevent a caller from referencing a non-prevailing profd,24;; causing a linker error.25; ELF:   @__profc_weakodr = weak_odr hidden global {{.*}} comdat, align 826; ELF:   @__profd_weakodr = weak_odr hidden global {{.*}} comdat($__profc_weakodr), align 827; COFF:  @__profc_weakodr = weak_odr hidden global {{.*}} comdat, align 828; COFF:  @__profd_weakodr = weak_odr hidden global {{.*}} comdat, align 829define weak_odr void @weakodr() comdat {30  ret void31}32 33;; weak in a comdat is not renamed. There is no guarantee that definitions in34;; other modules don't have value profiling. profd should be conservatively35;; non-private to prevent a caller from referencing a non-prevailing profd,36;; causing a linker error.37; ELF:   @__profc_weak = weak hidden global {{.*}} comdat, align 838; ELF:   @__profd_weak = weak hidden global {{.*}} comdat($__profc_weak), align 839; COFF:  @__profc_weak = weak hidden global {{.*}} comdat, align 840; COFF:  @__profd_weak = weak hidden global {{.*}} comdat, align 841define weak void @weak() comdat {42  ret void43}44 45;; profc/profd have hash suffixes. This definition doesn't have value profiling,46;; so definitions with the same name in other modules must have the same CFG and47;; cannot have value profiling, either. profd can be made private for ELF.48; ELF:   @__profc_linkonce.[[#]] = linkonce hidden global {{.*}} comdat, align 849; ELF:   @__profd_linkonce.[[#]] = private global {{.*}} comdat($__profc_linkonce.[[#]]), align 850; COFF:  @__profc_linkonce.[[#]] = linkonce hidden global {{.*}} comdat, align 851; COFF:  @__profd_linkonce.[[#]] = linkonce hidden global {{.*}} comdat, align 852define linkonce void @linkonce() comdat {53  ret void54}55 56; Check that comdat aliases are hidden for all linkage types57; ELF:   @linkonceodr.local = linkonce_odr hidden alias void (), ptr @linkonceodr58; ELF:   @weakodr.local = weak_odr hidden alias void (), ptr @weakodr59; ELF:   @weak.local = weak hidden alias void (), ptr @weak60; ELF:   @linkonce.local = linkonce hidden alias void (), ptr @linkonce61