xref: /aosp_15_r20/external/llvm/test/tools/llvm-split/scc-global2global.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; All of the functions and globals in this module must end up
2*9880d681SAndroid Build Coastguard Worker; in the same partition.
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 %struct.anon* @local0
9*9880d681SAndroid Build Coastguard Worker; CHECK0: declare i8** @local1
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; CHECK1: @bla
12*9880d681SAndroid Build Coastguard Worker; CHECK1: @ptr
13*9880d681SAndroid Build Coastguard Worker; CHECK1: define internal %struct.anon* @local0
14*9880d681SAndroid Build Coastguard Worker; CHECK1: define internal i8** @local1
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker%struct.anon = type { i64, i64 }
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker@bla = internal global %struct.anon { i64 1, i64 2 }, align 8
19*9880d681SAndroid Build Coastguard Worker@ptr = internal global i8* bitcast (%struct.anon* @bla to i8*), align 4
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerdefine internal %struct.anon* @local0() {
22*9880d681SAndroid Build Coastguard Worker  ret %struct.anon* @bla
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine internal i8** @local1() {
26*9880d681SAndroid Build Coastguard Worker  ret i8** @ptr
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29