xref: /aosp_15_r20/external/llvm/test/Transforms/MergeFunc/functions.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -mergefunc < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Be sure we don't merge cross-referenced functions of same type.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @left
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: entry-block
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: call void @right(i64 %p)
8*9880d681SAndroid Build Coastguard Workerdefine void @left(i64 %p) {
9*9880d681SAndroid Build Coastguard Workerentry-block:
10*9880d681SAndroid Build Coastguard Worker  call void @right(i64 %p)
11*9880d681SAndroid Build Coastguard Worker  call void @right(i64 %p)
12*9880d681SAndroid Build Coastguard Worker  call void @right(i64 %p)
13*9880d681SAndroid Build Coastguard Worker  call void @right(i64 %p)
14*9880d681SAndroid Build Coastguard Worker  ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @right
18*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: entry-block
19*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: call void @left(i64 %p)
20*9880d681SAndroid Build Coastguard Workerdefine void @right(i64 %p) {
21*9880d681SAndroid Build Coastguard Workerentry-block:
22*9880d681SAndroid Build Coastguard Worker  call void @left(i64 %p)
23*9880d681SAndroid Build Coastguard Worker  call void @left(i64 %p)
24*9880d681SAndroid Build Coastguard Worker  call void @left(i64 %p)
25*9880d681SAndroid Build Coastguard Worker  call void @left(i64 %p)
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28