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