1 ; RUN: llc -mtriple=aarch64-apple-darwin -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s | FileCheck %s
3 %struct.foo = type { i32, i64, float, double }
5 define double* @test_struct(%struct.foo* %f) {
6 ; CHECK-LABEL: test_struct
7 ; CHECK: add x0, x0, #24
8 %1 = getelementptr inbounds %struct.foo, %struct.foo* %f, i64 0, i32 3
12 define i32* @test_array1(i32* %a, i64 %i) {
13 ; CHECK-LABEL: test_array1
14 ; CHECK: mov [[REG:x[0-9]+]], #4
15 ; CHECK-NEXT: madd x0, x1, [[REG]], x0
16 %1 = getelementptr inbounds i32, i32* %a, i64 %i
20 define i32* @test_array2(i32* %a) {
21 ; CHECK-LABEL: test_array2
22 ; CHECK: add x0, x0, #16
23 %1 = getelementptr inbounds i32, i32* %a, i64 4
27 define i32* @test_array3(i32* %a) {
28 ; CHECK-LABEL: test_array3
29 ; CHECK: add x0, x0, #1, lsl #12
30 %1 = getelementptr inbounds i32, i32* %a, i64 1024
34 define i32* @test_array4(i32* %a) {
35 ; CHECK-LABEL: test_array4
36 ; CHECK: mov [[REG:x[0-9]+]], #4104
37 ; CHECK-NEXT: add x0, x0, [[REG]]
38 %1 = getelementptr inbounds i32, i32* %a, i64 1026
42 define i32* @test_array5(i32* %a, i32 %i) {
43 ; CHECK-LABEL: test_array5
44 ; CHECK: sxtw [[REG1:x[0-9]+]], w1
45 ; CHECK-NEXT: mov [[REG2:x[0-9]+]], #4
46 ; CHECK-NEXT: madd {{x[0-9]+}}, [[REG1]], [[REG2]], x0
47 %1 = getelementptr inbounds i32, i32* %a, i32 %i