1 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -passes=pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s
3 ; RUN: opt < %s -mtriple=x86_64-pc-win32-coff -pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s
4 ; RUN: opt < %s -mtriple=x86_64-pc-win32-coff -passes=pgo-instr-gen -do-comdat-renaming=true -S | FileCheck %s
6 ; Rename Comdat group and its function.
8 ; CHECK: $f.[[SINGLEBB_HASH:[0-9]+]] = comdat any
9 define linkonce_odr void @f() comdat($f) {
13 ; Not rename Comdat with right linkage.
15 ; CHECK: $nf = comdat any
16 define void @nf() comdat($nf) {
20 ; Not rename Comdat with variable members.
21 $f_with_var = comdat any
22 ; CHECK: $f_with_var = comdat any
23 @var = global i32 0, comdat($f_with_var)
24 define linkonce_odr void @f_with_var() comdat($f_with_var) {
25 %tmp = load i32, i32* @var, align 4
26 %inc = add nsw i32 %tmp, 1
27 store i32 %inc, i32* @var, align 4
31 ; Not rename Comdat with multiple functions.
33 ; CHECK: $tf = comdat any
34 define linkonce void @tf() comdat($tf) {
37 define linkonce void @tf2() comdat($tf) {
41 ; Rename AvailableExternallyLinkage functions
42 ; CHECK-DAG: $aef.[[SINGLEBB_HASH]] = comdat any
44 ; CHECK: @f = weak alias void (), void ()* @f.[[SINGLEBB_HASH]]
45 ; CHECK: @aef = weak alias void (), void ()* @aef.[[SINGLEBB_HASH]]
47 define available_externally void @aef() {
48 ; CHECK: define linkonce_odr void @aef.[[SINGLEBB_HASH]]() comdat {