1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/MC/Mips/mips_gprel16.s
Francis Visoiu Mistrih 30264d4391 [CodeGen] Unify MBB reference format in both MIR and debug output
As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

Differential Revision: https://reviews.llvm.org/D40422

llvm-svn: 319665
2017-12-04 17:18:51 +00:00

72 lines
1.6 KiB
ArmAsm

// This addresses bug 14456. We were not writing
// out the addend to the gprel16 relocation. The
// addend is stored in the instruction immediate
// field.
// RUN: llvm-mc -mcpu=mips32r2 -triple=mipsel-pc-linux -filetype=obj %s -o - \
// RUN: | llvm-objdump -disassemble - | FileCheck %s
// RUN: llvm-mc -mcpu=mips32r2 -triple=mips-pc-linux -filetype=obj %s -o - \
// RUN: | llvm-objdump -disassemble - | FileCheck %s
.text
.abicalls
.option pic0
.section .mdebug.abi32,"",@progbits
.file "/home/espindola/llvm/llvm/test/MC/Mips/mips_gprel16.ll"
.text
.globl testvar1
.align 2
.type testvar1,@function
.set nomips16
.ent testvar1
testvar1: # @testvar1
.frame $sp,0,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
# %bb.0: # %entry
// CHECK: lw ${{[0-9]+}}, 0($gp)
lw $1, %gp_rel(var1)($gp)
jr $ra
sltu $2, $zero, $1
.set at
.set macro
.set reorder
.end testvar1
$tmp0:
.size testvar1, ($tmp0)-testvar1
.globl testvar2
.align 2
.type testvar2,@function
.set nomips16
.ent testvar2
testvar2: # @testvar2
.frame $sp,0,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
# %bb.0: # %entry
// CHECK: lw ${{[0-9]+}}, 4($gp)
lw $1, %gp_rel(var2)($gp)
jr $ra
sltu $2, $zero, $1
.set at
.set macro
.set reorder
.end testvar2
$tmp1:
.size testvar2, ($tmp1)-testvar2
.type var1,@object # @var1
.local var1
.comm var1,4,4
.type var2,@object # @var2
.local var2
.comm var2,4,4