xref: /aosp_15_r20/external/llvm/test/CodeGen/Thumb/and_neg.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi -verify-machineinstrs
2*9880d681SAndroid Build Coastguard Worker; Just shouldn't crash, PR28348
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker%C = type { i8* }
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @repro(%C* %this, i32 %a) {
7*9880d681SAndroid Build Coastguard Worker  %a_align1 = and i32 %a, -4096
8*9880d681SAndroid Build Coastguard Worker  %a_and = and i32 %a, 4095
9*9880d681SAndroid Build Coastguard Worker  %a_align2 = or i32 %a_and, 4096
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker  call void @use(i32 %a_align1)
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker  %C_field = getelementptr inbounds %C, %C* %this, i32 0, i32 0
14*9880d681SAndroid Build Coastguard Worker  %addptr = getelementptr inbounds i8, i8* null, i32 %a_align2
15*9880d681SAndroid Build Coastguard Worker  store i8* %addptr, i8** %C_field, align 4
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdeclare void @use(i32)
21