aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/aarch64/pr27217.d15
-rw-r--r--gas/testsuite/gas/aarch64/pr27217.s16
2 files changed, 31 insertions, 0 deletions
diff --git a/gas/testsuite/gas/aarch64/pr27217.d b/gas/testsuite/gas/aarch64/pr27217.d
new file mode 100644
index 0000000..4645ff5
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pr27217.d
@@ -0,0 +1,15 @@
+# Check that expressions that generate relocations work when the symbol is a constant.
+#name: PR27212
+#objdump: -rd
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+000 <.*>:
+[ ]+0:[ ]+90000000[ ]+adrp[ ]+x0, 12345678[ ]+<bar>
+[ ]+0:[ ]+R_AARCH64_ADR_PREL_PG_HI21[ ]+bar
+[ ]+4:[ ]+91000000[ ]+add[ ]+x0, x0, #0x0
+[ ]+4:[ ]+R_AARCH64_ADD_ABS_LO12_NC[ ]+bar
+[ ]+8:[ ]+d65f03c0[ ]+ret
+#pass
diff --git a/gas/testsuite/gas/aarch64/pr27217.s b/gas/testsuite/gas/aarch64/pr27217.s
new file mode 100644
index 0000000..8cb9230
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/pr27217.s
@@ -0,0 +1,16 @@
+ .arch armv8-a
+ .file "set.c"
+ .text
+ // Start of user assembly
+ .set bar, 0x12345678
+ // End of user assembly
+ .align 2
+ .p2align 4,,11
+ .global foo
+ .type foo, %function
+foo:
+ adrp x0, bar
+ add x0, x0, :lo12:bar
+ ret
+ .size foo, .-foo
+ .ident "GCC: (GNU) 10.2.1 20201030 (RTEMS 6, RSB "