mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 02:32:08 +00:00
0fc8c68b11
ARM symbol variants are written with parens instead of @ like this: .word __GLOBAL_I_a(target1) This commit adds support for parsing these symbol variants in expressions. We introduce a new flag to MCAsmInfo that indicates the parser should use parens to parse the symbol variant. The expression parser is modified to look for symbol variants using parens instead of @ when the corresponding MCAsmInfo flag is true. The MCAsmInfo parens flag is enabled only for ARM on ELF. By adding this flag to MCAsmInfo, we are able to get rid of redundant ARM-specific symbol variants and use the generic variants instead (e.g. VK_GOT instead of VK_ARM_GOT). We use the new UseParensForSymbolVariant attribute in MCAsmInfo to correctly print the symbol variants for arm. To achive this we need to keep a handle to the MCAsmInfo in the MCSymbolRefExpr class that we can check when printing the symbol variant. Updated Tests: Changed case of symbol variant to match the generic kind. test/CodeGen/ARM/tls-models.ll test/CodeGen/ARM/tls1.ll test/CodeGen/ARM/tls2.ll test/CodeGen/Thumb2/tls1.ll test/CodeGen/Thumb2/tls2.ll PR18080 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196424 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
706 B
LLVM
28 lines
706 B
LLVM
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
|
|
; RUN: | FileCheck %s -check-prefix=CHECK-NONPIC
|
|
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
|
|
; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECK-PIC
|
|
|
|
@i = external thread_local global i32 ; <i32*> [#uses=2]
|
|
|
|
define i32 @f() {
|
|
; CHECK-NONPIC-LABEL: f:
|
|
; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
|
|
; CHECK-NONPIC: i(GOTTPOFF)
|
|
; CHECK-PIC-LABEL: f:
|
|
; CHECK-PIC: __tls_get_addr
|
|
entry:
|
|
%tmp1 = load i32* @i ; <i32> [#uses=1]
|
|
ret i32 %tmp1
|
|
}
|
|
|
|
define i32* @g() {
|
|
; CHECK-NONPIC-LABEL: g:
|
|
; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
|
|
; CHECK-NONPIC: i(GOTTPOFF)
|
|
; CHECK-PIC-LABEL: g:
|
|
; CHECK-PIC: __tls_get_addr
|
|
entry:
|
|
ret i32* @i
|
|
}
|