1 # RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj -o %t %s
2 # RUN: llvm-rtdyld -triple=arm64-none-linux-gnu -verify -dummy-extern f=0x0123456789abcdef -dummy-extern symbol=0xf00f -check=%s %t
14 # R_AARCH64_MOVW_UABS_G3
16 # R_AARCH64_MOVW_UABS_G2_NC
17 movk x0
, #:abs_g2_nc:f
18 # R_AARCH64_MOVW_UABS_G1_NC
19 movk x0
, #:abs_g1_nc:f
20 # R_AARCH64_MOVW_UABS_G0_NC
21 movk x0
, #:abs_g0_nc:f
23 # R_AARCH64_LDST8_ABS_LO12_NC
24 ldrsb x4
, [x5
, :lo12
:a+
1]
25 # R_AARCH64_LDST16_ABS_LO12_NC
26 ldrh w4
, [x5
, :lo12
:a+
2]
27 # R_AARCH64_LDST32_ABS_LO12_NC
29 # R_AARCH64_LDST64_ABS_LO12_NC
31 # R_AARCH64_LDST128_ABS_LO12_NC
34 # R_AARCH64_ADR_PREL_PG_HI21
35 # Test both low and high immediate values
36 adrp x4
, a + 20480 // 16384 + 4096
37 # Align next label to 16 bytes, so that LDST immediate
38 # fields will be non-zero
41 # R_AARCH64_ADD_ABS_LO12_NC
45 .size g, .Lfunc_end0-g
55 # R_AARCH64_PREL32: use Q instead of f to fit in 32 bits.
61 # rtdyld-check: *{4}(g) = 0xd2e02460
62 # rtdyld-check: *{4}(g + 4) = 0xf2c8ace0
63 # rtdyld-check: *{4}(g + 8) = 0xf2b13560
64 # rtdyld-check: *{4}(g + 12) = 0xf299bde0
66 ## Check LDSTXX_ABS_LO12_NC
67 # rtdyld-check: (*{4}l)[21:10] = (a+1)[11:0]
68 # rtdyld-check: (*{4}(l+4))[21:10] = (a+2)[11:1]
69 # rtdyld-check: (*{4}(l+8))[21:10] = a[11:2]
70 # rtdyld-check: (*{4}(l+12))[21:10] = a[11:3]
71 # rtdyld-check: (*{4}(l+16))[21:10] = a[11:4]
73 ## Check ADR_PREL_PG_HI21. Low order bits of immediate value
74 ## go to bits 30:29. High order bits go to bits 23:5
75 # rtdyld-check: (*{4}p)[30:29] = (a - p + 20480)[13:12]
76 # rtdyld-check: (*{4}p)[23:5] = (a - p + 20480)[32:14]
78 # rtdyld-check: *{8}k = f
79 # rtdyld-check: *{4}r = (Q - r)[31:0]
80 # rtdyld-check: *{8}(r + 8) = f - r - 8
82 ## f & 0xFFF = 0xdef (bits 11:0 of f)
83 ## 0xdef << 10 = 0x37bc00
84 # rtdyld-check: *{4}(a) = 0x9137bc00
89 # rtdyld-check: (*{2}ABS16) = symbol[15:0]
92 # rtdyld-check: (*{4}ABS32) = symbol[31:0]
95 # rtdyld-check: (*{8}ABS64) = symbol