1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64_be -o - %s | FileCheck %s --check-prefix CHECK-BE
3 ; RUN: llc -mtriple=aarch64 -o - %s | FileCheck %s --check-prefix CHECK-LE
5 define i8 @test1(i32 %a, i8* %pa) {
6 ; CHECK-BE-LABEL: test1:
8 ; CHECK-BE-NEXT: str w0, [x1]
9 ; CHECK-BE-NEXT: ldrb w0, [x1]
12 ; CHECK-LE-LABEL: test1:
14 ; CHECK-LE-NEXT: str w0, [x1]
16 %p32 = bitcast i8* %pa to i32*
17 %p8 = getelementptr i8, i8* %pa, i32 0
18 store i32 %a, i32* %p32
19 %res = load i8, i8* %p8
23 define i8 @test2(i32 %a, i8* %pa) {
24 ; CHECK-BE-LABEL: test2:
26 ; CHECK-BE-NEXT: str w0, [x1]
27 ; CHECK-BE-NEXT: ldrb w0, [x1, #1]
30 ; CHECK-LE-LABEL: test2:
32 ; CHECK-LE-NEXT: str w0, [x1]
33 ; CHECK-LE-NEXT: ubfx w0, w0, #8, #8
35 %p32 = bitcast i8* %pa to i32*
36 %p8 = getelementptr i8, i8* %pa, i32 1
37 store i32 %a, i32* %p32
38 %res = load i8, i8* %p8
42 define i8 @test3(i32 %a, i8* %pa) {
43 ; CHECK-BE-LABEL: test3:
45 ; CHECK-BE-NEXT: str w0, [x1]
46 ; CHECK-BE-NEXT: ldrb w0, [x1, #2]
49 ; CHECK-LE-LABEL: test3:
51 ; CHECK-LE-NEXT: str w0, [x1]
52 ; CHECK-LE-NEXT: ubfx w0, w0, #16, #8
54 %p32 = bitcast i8* %pa to i32*
55 %p8 = getelementptr i8, i8* %pa, i32 2
56 store i32 %a, i32* %p32
57 %res = load i8, i8* %p8
61 define i8 @test4(i32 %a, i8* %pa) {
62 ; CHECK-BE-LABEL: test4:
64 ; CHECK-BE-NEXT: str w0, [x1]
67 ; CHECK-LE-LABEL: test4:
69 ; CHECK-LE-NEXT: str w0, [x1]
70 ; CHECK-LE-NEXT: lsr w0, w0, #24
72 %p32 = bitcast i8* %pa to i32*
73 %p8 = getelementptr i8, i8* %pa, i32 3
74 store i32 %a, i32* %p32
75 %res = load i8, i8* %p8