diff options
| author | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-05-01 10:24:46 +0000 |
|---|---|---|
| committer | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-05-01 10:24:46 +0000 |
| commit | d92a3fa212aa91e1466ad87768ffc08d7238e079 (patch) | |
| tree | 8fca56043048f4a5eb00b6b240353a96268bcaf5 /llvm/test | |
| parent | 88fbbcaa302a1889d0ca32004420a63f2a9f8f75 (diff) | |
| download | bcm5719-llvm-d92a3fa212aa91e1466ad87768ffc08d7238e079.tar.gz bcm5719-llvm-d92a3fa212aa91e1466ad87768ffc08d7238e079.zip | |
[mips] Move expansion of .cpsetup to target streamer.
Summary:
There are two functional changes:
1) The directive is not expanded for the ASM->ASM code path.
2) If PIC is not set, there's no expansion for the ASM->OBJ code path (same behaviour as GAS).
Reviewers: dsanders
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D3482
llvm-svn: 207741
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/MC/Mips/cpsetup.s | 64 |
1 files changed, 53 insertions, 11 deletions
diff --git a/llvm/test/MC/Mips/cpsetup.s b/llvm/test/MC/Mips/cpsetup.s index dbdcaab4ae3..a21a1e3b2a3 100644 --- a/llvm/test/MC/Mips/cpsetup.s +++ b/llvm/test/MC/Mips/cpsetup.s @@ -1,36 +1,78 @@ +# RUN: llvm-mc -triple mips64-unknown-unknown -mattr=-n64,+o32 -filetype=obj -o - %s | \ +# RUN: llvm-objdump -d -r -arch=mips64 - | \ +# RUN: FileCheck -check-prefix=O32 %s + # RUN: llvm-mc -triple mips64-unknown-unknown -mattr=-n64,+o32 %s | \ -# RUN: FileCheck -check-prefix=ANY -check-prefix=O32 %s +# RUN: FileCheck -check-prefix=ASM %s + +# RUN: llvm-mc -triple mips64-unknown-unknown -mattr=-n64,+n32 -filetype=obj -o - %s | \ +# RUN: llvm-objdump -d -r -arch=mips64 - | \ +# RUN: FileCheck -check-prefix=NXX -check-prefix=N32 %s + # RUN: llvm-mc -triple mips64-unknown-unknown -mattr=-n64,+n32 %s | \ -# RUN: FileCheck -check-prefix=ANY -check-prefix=NXX -check-prefix=N32 %s -# RUN: llvm-mc -triple mips64-unknown-unknown %s | \ -# RUN: FileCheck -check-prefix=ANY -check-prefix=NXX -check-prefix=N64 %s +# RUN: FileCheck -check-prefix=ASM %s -# TODO: !PIC -> no output +# RUN: llvm-mc -triple mips64-unknown-unknown %s -filetype=obj -o - | \ +# RUN: llvm-objdump -d -r -arch=mips64 - | \ +# RUN: FileCheck -check-prefix=NXX -check-prefix=N64 %s + +# RUN: llvm-mc -triple mips64-unknown-unknown %s | \ +# RUN: FileCheck -check-prefix=ASM %s .text .option pic2 t1: .cpsetup $25, 8, __cerror -# ANY-LABEL: t1: # O32-NOT: __cerror +# FIXME: Direct object emission for N32 is still under development. +# N32 doesn't allow 3 operations to be specified in the same relocation +# record like N64 does. + # NXX: sd $gp, 8($sp) -# NXX: lui $gp, %hi(%neg(%gp_rel(__cerror))) -# NXX: addiu $gp, $gp, %lo(%neg(%gp_rel(__cerror))) +# NXX: lui $gp, 0 +# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror +# NXX: addiu $gp, $gp, 0 +# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror # N32: addu $gp, $gp, $25 # N64: daddu $gp, $gp, $25 +# ASM: .cpsetup $25, 8, __cerror + t2: -# ANY-LABEL: t2: .cpsetup $25, $2, __cerror # O32-NOT: __cerror +# FIXME: Direct object emission for N32 is still under development. +# N32 doesn't allow 3 operations to be specified in the same relocation +# record like N64 does. + # NXX: move $2, $gp -# NXX: lui $gp, %hi(%neg(%gp_rel(__cerror))) -# NXX: addiu $gp, $gp, %lo(%neg(%gp_rel(__cerror))) +# NXX: lui $gp, 0 +# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror +# NXX: addiu $gp, $gp, 0 +# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror # N32: addu $gp, $gp, $25 # N64: daddu $gp, $gp, $25 + +# ASM: .cpsetup $25, $2, __cerror + +t3: + .option pic0 + nop + .cpsetup $25, 8, __cerror + nop + +# Testing that .cpsetup expands to nothing in this case +# by checking that the next instruction after the first +# nop is also a 'nop'. +# NXX: nop +# NXX-NEXT: nop + +# ASM: nop +# ASM: .cpsetup $25, 8, __cerror +# ASM: nop |

