summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-10-09 07:53:49 +0000
committerTim Northover <tnorthover@apple.com>2013-10-09 07:53:49 +0000
commitccb06ae8f3ef0135d4bddf4f0f61f619c3ce3f1e (patch)
treed2308fbad810e29a8c05be4394790d822ea5a4f8
parent5747f946ec810d22d36260a4b18114d5673fd55f (diff)
AArch64: migrate ADRP relaxation test to be llvm-mc only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192281 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/AArch64/adrp-relocation.ll27
-rw-r--r--test/MC/AArch64/adrp-relocation.s18
2 files changed, 18 insertions, 27 deletions
diff --git a/test/CodeGen/AArch64/adrp-relocation.ll b/test/CodeGen/AArch64/adrp-relocation.ll
deleted file mode 100644
index 1e12d69b76f..00000000000
--- a/test/CodeGen/AArch64/adrp-relocation.ll
+++ /dev/null
@@ -1,27 +0,0 @@
-; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -filetype=obj < %s | llvm-readobj -s -r | FileCheck %s
-
-define i64 @testfn() nounwind {
-entry:
- ret i64 0
-}
-
-define i64 @foo() nounwind {
-entry:
- %bar = alloca i64 ()*, align 8
- store i64 ()* @testfn, i64 ()** %bar, align 8
- %call = call i64 @testfn()
- ret i64 %call
-}
-
-; The above should produce an ADRP/ADD pair to calculate the address of
-; testfn. The important point is that LLVM shouldn't think it can deal with the
-; relocation on the ADRP itself (even though it knows everything about the
-; relative offsets of testfn and foo) because its value depends on where this
-; object file's .text section gets relocated in memory.
-
-; CHECK: Relocations [
-; CHECK-NEXT: Section (2) .rela.text {
-; CHECK-NEXT: 0x10 R_AARCH64_ADR_PREL_PG_HI21 testfn 0x0
-; CHECK-NEXT: 0x14 R_AARCH64_ADD_ABS_LO12_NC testfn 0x0
-; CHECK-NEXT: }
-; CHECK-NEXT: ]
diff --git a/test/MC/AArch64/adrp-relocation.s b/test/MC/AArch64/adrp-relocation.s
new file mode 100644
index 00000000000..3bcef34e4f5
--- /dev/null
+++ b/test/MC/AArch64/adrp-relocation.s
@@ -0,0 +1,18 @@
+// RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj -o - %s| llvm-readobj -r - | FileCheck %s
+ .text
+// These should produce an ADRP/ADD pair to calculate the address of
+// testfn. The important point is that LLVM shouldn't think it can deal with the
+// relocation on the ADRP itself (even though it knows everything about the
+// relative offsets of testfn and foo) because its value depends on where this
+// object file's .text section gets relocated in memory.
+ adrp x0, sym
+ adrp x0, :got:sym
+ adrp x0, :gottprel:sym
+ adrp x0, :tlsdesc:sym
+
+ .global sym
+sym:
+// CHECK: R_AARCH64_ADR_PREL_PG_HI21 sym
+// CHECK: R_AARCH64_ADR_GOT_PAGE sym
+// CHECK: R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 sym
+// CHECK: R_AARCH64_TLSDESC_ADR_PAGE sym