1// RUN: llvm-mc -triple aarch64-darwin -filetype=obj %s -o - | llvm-objdump -r -d - | FileCheck %s 2// RUN: llvm-mc -triple aarch64-ios -filetype=obj %s -o - | llvm-objdump -r -d - | FileCheck %s 3 4visible: 5 .space 8 6Lstart: 7 .space 8 8Lend: 9 adds w0, w1, #(Lend - Lstart) 10 adds x0, x1, #(Lend - Lstart) 11 add w0, w1, #(Lend - Lstart) 12 add x0, x1, #(Lend - Lstart) 13 cmp w0, #(Lend - Lstart) 14 cmp x0, #(Lend - Lstart) 15 sub w0, w1, #(Lend - Lstart) 16 sub x0, x1, #(Lend - Lstart) 17 // CHECK: adds w0, w1, #8 18 // CHECK: adds x0, x1, #8 19 // CHECK: add w0, w1, #8 20 // CHECK: add x0, x1, #8 21 // CHECK: cmp w0, #8 22 // CHECK: cmp x0, #8 23 // CHECK: sub w0, w1, #8 24 // CHECK: sub x0, x1, #8 25 26 add w0, w1, #(Lend - Lstart), lsl #12 27 cmp w0, #(Lend - Lstart), lsl #12 28 // CHECK: add w0, w1, #8, lsl #12 29 // CHECK: cmp w0, #8, lsl #12 30 31 add w0, w1, #((Lend - Lstart) >> 2) 32 cmp w0, #((Lend - Lstart) >> 2) 33 // CHECK: add w0, w1, #2 34 // CHECK: cmp w0, #2 35 36 add w0, w1, #(Lend - Lstart + 12) 37 cmp w0, #(Lend - Lstart + 12) 38 // CHECK: add w0, w1, #20 39 // CHECK: cmp w0, #20 40 41 add w0, w1, #(Lforward - Lend) 42 cmp w0, #(Lforward - Lend) 43 // CHECK: add w0, w1, #320 44 // CHECK: cmp w0, #320 45 46 add w0, w1, #(Lstart - visible) 47 cmp w0, #(Lstart - visible) 48 // CHECK: add w0, w1, #8 49 // CHECK: cmp w0, #8 50 51// Add some filler so we don't have to modify #(Lforward - Lend) if we add more 52// instructions above 53Lfiller: 54 .space 320 - (Lfiller - Lend) 55 56Lforward: 57 .space 4 58 add w0, w1, #(. - Lforward) 59 cmp w0, #(. - Lforward) 60 // CHECK: add w0, w1, #4 61 // CHECK: cmp w0, #8 62