1 ; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s
3 define i64 @_f0(i64* %p) {
5 ; CHECK: ldur x0, [x0, #-8]
7 %tmp = getelementptr inbounds i64, i64* %p, i64 -1
8 %ret = load i64, i64* %tmp, align 2
11 define i32 @_f1(i32* %p) {
13 ; CHECK: ldur w0, [x0, #-4]
15 %tmp = getelementptr inbounds i32, i32* %p, i64 -1
16 %ret = load i32, i32* %tmp, align 2
19 define i16 @_f2(i16* %p) {
21 ; CHECK: ldurh w0, [x0, #-2]
23 %tmp = getelementptr inbounds i16, i16* %p, i64 -1
24 %ret = load i16, i16* %tmp, align 2
27 define i8 @_f3(i8* %p) {
29 ; CHECK: ldurb w0, [x0, #-1]
31 %tmp = getelementptr inbounds i8, i8* %p, i64 -1
32 %ret = load i8, i8* %tmp, align 2
36 define i64 @zext32(i8* %a) nounwind ssp {
37 ; CHECK-LABEL: zext32:
38 ; CHECK: ldur w0, [x0, #-12]
40 %p = getelementptr inbounds i8, i8* %a, i64 -12
41 %tmp1 = bitcast i8* %p to i32*
42 %tmp2 = load i32, i32* %tmp1, align 4
43 %ret = zext i32 %tmp2 to i64
47 define i64 @zext16(i8* %a) nounwind ssp {
48 ; CHECK-LABEL: zext16:
49 ; CHECK: ldurh w0, [x0, #-12]
51 %p = getelementptr inbounds i8, i8* %a, i64 -12
52 %tmp1 = bitcast i8* %p to i16*
53 %tmp2 = load i16, i16* %tmp1, align 2
54 %ret = zext i16 %tmp2 to i64
58 define i64 @zext8(i8* %a) nounwind ssp {
60 ; CHECK: ldurb w0, [x0, #-12]
62 %p = getelementptr inbounds i8, i8* %a, i64 -12
63 %tmp2 = load i8, i8* %p, align 1
64 %ret = zext i8 %tmp2 to i64