xref: /aosp_15_r20/external/llvm/test/tools/llvm-split/blockaddress.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test that blockaddress target is in the same partition.
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-split -j5 -o %t %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1234 %s
5*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK1234 %s
6*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t3 | FileCheck --check-prefix=CHECK1234 %s
7*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis -o - %t4 | FileCheck --check-prefix=CHECK1234 %s
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; CHECK0:    @xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
10*9880d681SAndroid Build Coastguard Worker; CHECK1234: @xxx = external global [2 x i8*]
11*9880d681SAndroid Build Coastguard Worker; CHECK1234-NOT: blockaddress
12*9880d681SAndroid Build Coastguard Worker@xxx = global [2 x i8*] [i8* blockaddress(@f, %exit), i8* blockaddress(@g, %exit)]
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; CHECK0:    define i32 @f()
15*9880d681SAndroid Build Coastguard Worker; CHECK1234: declare i32 @f()
16*9880d681SAndroid Build Coastguard Workerdefine i32 @f(){
17*9880d681SAndroid Build Coastguard Workerentry:
18*9880d681SAndroid Build Coastguard Worker  br label %exit
19*9880d681SAndroid Build Coastguard Workerexit:
20*9880d681SAndroid Build Coastguard Worker  ret i32 0
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker; CHECK0:    define i32 @g()
24*9880d681SAndroid Build Coastguard Worker; CHECK1234: declare i32 @g()
25*9880d681SAndroid Build Coastguard Workerdefine i32 @g(){
26*9880d681SAndroid Build Coastguard Workerentry:
27*9880d681SAndroid Build Coastguard Worker  br label %exit
28*9880d681SAndroid Build Coastguard Workerexit:
29*9880d681SAndroid Build Coastguard Worker  ret i32 0
30*9880d681SAndroid Build Coastguard Worker}
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker; CHECK0:    define i8* @h()
33*9880d681SAndroid Build Coastguard Worker; CHECK1234: declare i8* @h()
34*9880d681SAndroid Build Coastguard Workerdefine i8* @h(){
35*9880d681SAndroid Build Coastguard Workerentry:
36*9880d681SAndroid Build Coastguard Worker  ret i8* blockaddress(@f, %exit)
37*9880d681SAndroid Build Coastguard Worker}
38