From 82b1b39b3670805cd03f0c175816ec051b5946e3 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 16 Oct 2019 19:41:04 +0300 Subject: [PATCH] [mips] Reformat `la / dla` expansion test cases. NFC --- llvm/test/MC/Mips/macro-dla-pic.s | 116 ++++++++++++++++----------- llvm/test/MC/Mips/macro-la-pic.s | 129 ++++++++++++++++++------------ 2 files changed, 149 insertions(+), 96 deletions(-) diff --git a/llvm/test/MC/Mips/macro-dla-pic.s b/llvm/test/MC/Mips/macro-dla-pic.s index ed5aa202618e..be91a6543791 100644 --- a/llvm/test/MC/Mips/macro-dla-pic.s +++ b/llvm/test/MC/Mips/macro-dla-pic.s @@ -1,50 +1,76 @@ -# RUN: llvm-mc %s -triple=mips64-unknown-linux -show-encoding -mcpu=mips3 | \ -# RUN: FileCheck %s +# RUN: llvm-mc %s -triple=mips64-unknown-linux -show-encoding \ +# RUN: -mcpu=mips3 | FileCheck -check-prefix=N64 %s .option pic2 -dla $5, symbol # CHECK: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP -dla $5, symbol($6) # CHECK: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d] -dla $6, symbol($6) # CHECK: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d] -dla $5, symbol+8 # CHECK: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08] -dla $5, symbol+8($6) # CHECK: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08] - # CHECK: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d] -dla $6, symbol+8($6) # CHECK: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08] - # CHECK: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d] -dla $5, 1f # CHECK: ld $5, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_Mips_GOT_DISP +dla $5, symbol +# N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP + +dla $5, symbol($6) +# N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d] + +dla $6, symbol($6) +# N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d] + +dla $5, symbol+8 +# N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08] + +dla $5, symbol+8($6) +# N64: ld $5, %got_disp(symbol)($gp) # encoding: [0xdf,0x85,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $5, $5, 8 # encoding: [0x64,0xa5,0x00,0x08] +# N64: daddu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x2d] + +dla $6, symbol+8($6) +# N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08] +# N64: daddu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x2d] + +dla $5, 1f +# N64: ld $5, %got_disp(.Ltmp0)($gp) # encoding: [0xdf,0x85,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(.Ltmp0), kind: fixup_Mips_GOT_DISP 1: # PIC expansions involving $25 are special. -dla $25, symbol # CHECK: ld $25, %call16(symbol)($gp) # encoding: [0xdf,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16 -dla $25, symbol($6) # CHECK: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d] -dla $25, symbol($25) # CHECK: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d] -dla $25, symbol+8 # CHECK: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08] -dla $25, symbol+8($6) # CHECK: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08] - # CHECK: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d] -dla $25, symbol+8($25)# CHECK: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP - # CHECK: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08] - # CHECK: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d] -dla $25, 1f # CHECK: ld $25, %got_disp(.Ltmp1)($gp) # encoding: [0xdf,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got_disp(.Ltmp1), kind: fixup_Mips_GOT_DISP -1: +dla $25, symbol +# N64: ld $25, %call16(symbol)($gp) # encoding: [0xdf,0x99,A,A] +# N64: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16 + +dla $25, symbol($6) +# N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d] + +dla $25, symbol($25) +# N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d] + +dla $25, symbol+8 +# N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08] + +dla $25, symbol+8($6) +# N64: ld $25, %got_disp(symbol)($gp) # encoding: [0xdf,0x99,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08] +# N64: daddu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x2d] + +dla $25, symbol+8($25) +# N64: ld $1, %got_disp(symbol)($gp) # encoding: [0xdf,0x81,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP +# N64: daddiu $1, $1, 8 # encoding: [0x64,0x21,0x00,0x08] +# N64: daddu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x2d] + +dla $25, 2f +# N64: ld $25, %got_disp(.Ltmp1)($gp) # encoding: [0xdf,0x99,A,A] +# N64: # fixup A - offset: 0, value: %got_disp(.Ltmp1), kind: fixup_Mips_GOT_DISP +2: diff --git a/llvm/test/MC/Mips/macro-la-pic.s b/llvm/test/MC/Mips/macro-la-pic.s index da8cbde08715..d003cb6aa7f7 100644 --- a/llvm/test/MC/Mips/macro-la-pic.s +++ b/llvm/test/MC/Mips/macro-la-pic.s @@ -1,58 +1,85 @@ -# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \ -# RUN: FileCheck %s -# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r6 | \ -# RUN: FileCheck %s +# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding \ +# RUN: -mcpu=mips32r2 | FileCheck -check-prefix=O32 %s +# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding \ +# RUN: -mcpu=mips32r6 | FileCheck -check-prefix=O32 %s + # N32 should be acceptable too but it currently errors out. # N64 should be acceptable too but we cannot convert la to dla yet. .option pic2 -la $5, symbol # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT -la $5, symbol($6) # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21] -la $6, symbol($6) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21] -la $5, symbol+8 # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08] -la $5, symbol+8($6) # CHECK: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08] - # CHECK: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21] -la $6, symbol+8($6) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] - # CHECK: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21] -la $5, 1f # CHECK: lw $5, %got($tmp0)($gp) # encoding: [0x8f,0x85,A,A] - # CHECK: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_Mips_GOT - # CHECK: addiu $5, $5, %lo($tmp0) # encoding: [0x24,0xa5,A,A] - # CHECK: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16 +la $5, symbol +# O32: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT + +la $5, symbol($6) +# O32: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21] + +la $6, symbol($6) +# O32: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21] + +la $5, symbol+8 +# O32: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08] + +la $5, symbol+8($6) +# O32: lw $5, %got(symbol)($gp) # encoding: [0x8f,0x85,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $5, $5, 8 # encoding: [0x24,0xa5,0x00,0x08] +# O32: addu $5, $5, $6 # encoding: [0x00,0xa6,0x28,0x21] + +la $6, symbol+8($6) +# O32: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] +# O32: addu $6, $1, $6 # encoding: [0x00,0x26,0x30,0x21] + +la $5, 1f +# O32: lw $5, %got($tmp0)($gp) # encoding: [0x8f,0x85,A,A] +# O32: # fixup A - offset: 0, value: %got($tmp0), kind: fixup_Mips_GOT +# O32: addiu $5, $5, %lo($tmp0) # encoding: [0x24,0xa5,A,A] +# O32: # fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16 1: # PIC expansions involving $25 are special. -la $25, symbol # CHECK: lw $25, %call16(symbol)($gp) # encoding: [0x8f,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16 -la $25, symbol($6) # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] -la $25, symbol($25) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] -la $25, symbol+8 # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08] -la $25, symbol+8($6) # CHECK: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08] - # CHECK: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] -la $25, symbol+8($25) # CHECK: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] - # CHECK: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT - # CHECK: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] - # CHECK: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] -la $25, 1f # CHECK: lw $25, %got($tmp1)($gp) # encoding: [0x8f,0x99,A,A] - # CHECK: # fixup A - offset: 0, value: %got($tmp1), kind: fixup_Mips_GOT - # CHECK: addiu $25, $25, %lo($tmp1) # encoding: [0x27,0x39,A,A] - # CHECK: # fixup A - offset: 0, value: %lo($tmp1), kind: fixup_Mips_LO16 -1: +la $25, symbol +# O32: lw $25, %call16(symbol)($gp) # encoding: [0x8f,0x99,A,A] +# O32: # fixup A - offset: 0, value: %call16(symbol), kind: fixup_Mips_CALL16 + +la $25, symbol($6) +# O32: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] + +la $25, symbol($25) +# O32: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] + +la $25, symbol+8 +# O32: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08] + +la $25, symbol+8($6) +# O32: lw $25, %got(symbol)($gp) # encoding: [0x8f,0x99,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08] +# O32: addu $25, $25, $6 # encoding: [0x03,0x26,0xc8,0x21] + +la $25, symbol+8($25) +# O32: lw $1, %got(symbol)($gp) # encoding: [0x8f,0x81,A,A] +# O32: # fixup A - offset: 0, value: %got(symbol), kind: fixup_Mips_GOT +# O32: addiu $1, $1, 8 # encoding: [0x24,0x21,0x00,0x08] +# O32: addu $25, $1, $25 # encoding: [0x00,0x39,0xc8,0x21] + +la $25, 2f +# O32: lw $25, %got($tmp1)($gp) # encoding: [0x8f,0x99,A,A] +# O32: # fixup A - offset: 0, value: %got($tmp1), kind: fixup_Mips_GOT +# O32: addiu $25, $25, %lo($tmp1) # encoding: [0x27,0x39,A,A] +# O32: # fixup A - offset: 0, value: %lo($tmp1), kind: fixup_Mips_LO16 +2: