xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/i128-align.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=arm64-apple-ios7.0 -verify-machineinstrs -o - %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker%struct = type { i32, i128, i8 }
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker@var = global %struct zeroinitializer
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine i64 @check_size() {
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: check_size:
9*9880d681SAndroid Build Coastguard Worker  %starti = ptrtoint %struct* @var to i64
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker  %endp = getelementptr %struct, %struct* @var, i64 1
12*9880d681SAndroid Build Coastguard Worker  %endi = ptrtoint %struct* %endp to i64
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker  %diff = sub i64 %endi, %starti
15*9880d681SAndroid Build Coastguard Worker  ret i64 %diff
16*9880d681SAndroid Build Coastguard Worker; CHECK: {{movz x0, #48|orr w0, wzr, #0x30}}
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdefine i64 @check_field() {
20*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: check_field:
21*9880d681SAndroid Build Coastguard Worker  %starti = ptrtoint %struct* @var to i64
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker  %endp = getelementptr %struct, %struct* @var, i64 0, i32 1
24*9880d681SAndroid Build Coastguard Worker  %endi = ptrtoint i128* %endp to i64
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker  %diff = sub i64 %endi, %starti
27*9880d681SAndroid Build Coastguard Worker  ret i64 %diff
28*9880d681SAndroid Build Coastguard Worker; CHECK: {{movz x0, #16|orr w0, wzr, #0x10}}
29*9880d681SAndroid Build Coastguard Worker}
30