xref: /aosp_15_r20/external/llvm/test/tools/llvm-split/comdat.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-split -o %t %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker$foo = comdat any
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; CHECK0: define void @foo()
8*9880d681SAndroid Build Coastguard Worker; CHECK1: declare void @foo()
9*9880d681SAndroid Build Coastguard Workerdefine void @foo() comdat {
10*9880d681SAndroid Build Coastguard Worker  call void @bar()
11*9880d681SAndroid Build Coastguard Worker  ret void
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; CHECK0: define void @bar()
15*9880d681SAndroid Build Coastguard Worker; CHECK1: declare void @bar()
16*9880d681SAndroid Build Coastguard Workerdefine void @bar() comdat($foo) {
17*9880d681SAndroid Build Coastguard Worker  call void @foo()
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker}
20