xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/arm64-collect-loh-garbage-crash.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=arm64-apple-ios -O3 -aarch64-collect-loh -aarch64-collect-loh-bb-only=true -aarch64-collect-loh-pre-collect-register=false < %s -o - | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; Check that the LOH analysis does not crash when the analysed chained
3*9880d681SAndroid Build Coastguard Worker; contains instructions that are filtered out.
4*9880d681SAndroid Build Coastguard Worker;
5*9880d681SAndroid Build Coastguard Worker; Before the fix for <rdar://problem/16041712>, these cases were removed
6*9880d681SAndroid Build Coastguard Worker; from the main container. Now, the deterministic container does not allow
7*9880d681SAndroid Build Coastguard Worker; to remove arbitrary values, so we have to live with garbage values.
8*9880d681SAndroid Build Coastguard Worker; <rdar://problem/16041712>
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker%"class.H4ISP::H4ISPDevice" = type { i32 (%"class.H4ISP::H4ISPDevice"*, i32, i8*, i8*)*, i8*, i32*, %"class.H4ISP::H4ISPCameraManager"* }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker%"class.H4ISP::H4ISPCameraManager" = type opaque
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdeclare i32 @_ZN5H4ISP11H4ISPDevice32ISP_SelectBestMIPIFrequencyIndexEjPj(%"class.H4ISP::H4ISPDevice"*)
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker@pH4ISPDevice = hidden global %"class.H4ISP::H4ISPDevice"* null, align 8
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: _foo:
19*9880d681SAndroid Build Coastguard Worker; CHECK: ret
20*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: .loh AdrpLdrGotLdr
21*9880d681SAndroid Build Coastguard Workerdefine void @foo() {
22*9880d681SAndroid Build Coastguard Workerentry:
23*9880d681SAndroid Build Coastguard Worker  br label %if.then83
24*9880d681SAndroid Build Coastguard Workerif.then83:                                        ; preds = %if.end81
25*9880d681SAndroid Build Coastguard Worker  %tmp = load %"class.H4ISP::H4ISPDevice"*, %"class.H4ISP::H4ISPDevice"** @pH4ISPDevice, align 8
26*9880d681SAndroid Build Coastguard Worker  %call84 = call i32 @_ZN5H4ISP11H4ISPDevice32ISP_SelectBestMIPIFrequencyIndexEjPj(%"class.H4ISP::H4ISPDevice"* %tmp) #19
27*9880d681SAndroid Build Coastguard Worker  tail call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27}"()
28*9880d681SAndroid Build Coastguard Worker  %tmp2 = load %"class.H4ISP::H4ISPDevice"*, %"class.H4ISP::H4ISPDevice"** @pH4ISPDevice, align 8
29*9880d681SAndroid Build Coastguard Worker  tail call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x28}"()
30*9880d681SAndroid Build Coastguard Worker  %pCameraManager.i268 = getelementptr inbounds %"class.H4ISP::H4ISPDevice", %"class.H4ISP::H4ISPDevice"* %tmp2, i64 0, i32 3
31*9880d681SAndroid Build Coastguard Worker  %tmp3 = load %"class.H4ISP::H4ISPCameraManager"*, %"class.H4ISP::H4ISPCameraManager"** %pCameraManager.i268, align 8
32*9880d681SAndroid Build Coastguard Worker  %tobool.i269 = icmp eq %"class.H4ISP::H4ISPCameraManager"* %tmp3, null
33*9880d681SAndroid Build Coastguard Worker  br i1 %tobool.i269, label %if.then83, label %end
34*9880d681SAndroid Build Coastguard Workerend:
35*9880d681SAndroid Build Coastguard Worker  ret void
36*9880d681SAndroid Build Coastguard Worker}
37*9880d681SAndroid Build Coastguard Worker
38