xref: /aosp_15_r20/external/llvm/test/tools/llvm-split/scc-comdat.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; All functions in the same comdat group must
2*9880d681SAndroid Build Coastguard Worker; be in the same module
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-split -j=2 -preserve-locals -o %t %s
5*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s
6*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; CHECK0: declare i32 @fun1
9*9880d681SAndroid Build Coastguard Worker; CHECK0: declare i32 @fun2
10*9880d681SAndroid Build Coastguard Worker; CHECK0: declare i32 @fun3
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; CHECK1: define internal i32 @fun1
13*9880d681SAndroid Build Coastguard Worker; CHECK1: define internal i32 @fun2
14*9880d681SAndroid Build Coastguard Worker; CHECK1: define i32 @fun3
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker$fun = comdat any
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine internal i32 @fun1() section ".text.funs" comdat($fun) {
19*9880d681SAndroid Build Coastguard Workerentry:
20*9880d681SAndroid Build Coastguard Worker  ret i32 0
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerdefine internal i32 @fun2() section ".text.funs" comdat($fun) {
24*9880d681SAndroid Build Coastguard Workerentry:
25*9880d681SAndroid Build Coastguard Worker  ret i32 0
26*9880d681SAndroid Build Coastguard Worker}
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdefine i32 @fun3() section ".text.funs" comdat($fun) {
29*9880d681SAndroid Build Coastguard Workerentry:
30*9880d681SAndroid Build Coastguard Worker  ret i32 0
31*9880d681SAndroid Build Coastguard Worker}
32*9880d681SAndroid Build Coastguard Worker
33