2013-02-01 12:40:47 +01:00
|
|
|
;; RUN: llc -mtriple=aarch64-none-linux-gnu -filetype=obj %s -o - | \
|
2013-04-12 06:06:46 +02:00
|
|
|
;; RUN: llvm-readobj -h -r | FileCheck -check-prefix=OBJ %s
|
2013-01-31 13:12:40 +01:00
|
|
|
|
|
|
|
; Also take it on a round-trip through llvm-mc to stretch assembly-parsing's legs:
|
2013-02-01 12:40:47 +01:00
|
|
|
;; RUN: llc -mtriple=aarch64-none-linux-gnu %s -o - | \
|
2013-04-12 14:54:58 +02:00
|
|
|
;; RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj -o - | \
|
2013-04-12 06:06:46 +02:00
|
|
|
;; RUN: llvm-readobj -h -r | FileCheck -check-prefix=OBJ %s
|
2013-01-31 13:12:40 +01:00
|
|
|
|
|
|
|
@var8 = global i8 0
|
|
|
|
@var16 = global i16 0
|
|
|
|
@var32 = global i32 0
|
|
|
|
@var64 = global i64 0
|
|
|
|
|
|
|
|
define void @loadstore() {
|
|
|
|
%val8 = load i8* @var8
|
|
|
|
store volatile i8 %val8, i8* @var8
|
|
|
|
|
|
|
|
%val16 = load i16* @var16
|
|
|
|
store volatile i16 %val16, i16* @var16
|
|
|
|
|
|
|
|
%val32 = load i32* @var32
|
|
|
|
store volatile i32 %val32, i32* @var32
|
|
|
|
|
|
|
|
%val64 = load i64* @var64
|
|
|
|
store volatile i64 %val64, i64* @var64
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
@globaddr = global i64* null
|
|
|
|
|
|
|
|
define void @address() {
|
|
|
|
store i64* @var64, i64** @globaddr
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check we're using EM_AARCH64
|
2013-04-12 06:06:46 +02:00
|
|
|
; OBJ: ElfHeader {
|
|
|
|
; OBJ: Machine: EM_AARCH64
|
|
|
|
; OBJ: }
|
|
|
|
|
|
|
|
; OBJ: Relocations [
|
2013-05-30 05:05:14 +02:00
|
|
|
; OBJ: Section (2) .rela.text {
|
2013-04-12 06:06:46 +02:00
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 var8
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_LDST8_ABS_LO12_NC var8
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 var16
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_LDST16_ABS_LO12_NC var16
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 var32
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_LDST32_ABS_LO12_NC var32
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 var64
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_LDST64_ABS_LO12_NC var64
|
2013-01-31 13:12:40 +01:00
|
|
|
|
|
|
|
; This is on the store, so not really important, but it stops the next
|
|
|
|
; match working.
|
2013-04-12 06:06:46 +02:00
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_LDST64_ABS_LO12_NC var64
|
2013-01-31 13:12:40 +01:00
|
|
|
|
|
|
|
; Pure address-calculation against var64
|
2013-04-12 06:06:46 +02:00
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADR_PREL_PG_HI21 var64
|
|
|
|
; OBJ: 0x{{[0-9,A-F]+}} R_AARCH64_ADD_ABS_LO12_NC var64
|
2013-01-31 13:12:40 +01:00
|
|
|
|
2013-04-12 06:06:46 +02:00
|
|
|
; OBJ: }
|
|
|
|
; OBJ: ]
|