1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/MC/Mips/cplocal-bad.s
Simon Atanasyan f709c58051 [mips] Implement .cplocal directive
This directive forces to use the alternate register for context pointer.
For example, this code:
  .cplocal $4
  jal foo
expands to:
  ld    $25, %call16(foo)($4)
  jalr  $25

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

llvm-svn: 366300
2019-07-17 08:11:31 +00:00

21 lines
1.0 KiB
ArmAsm

# RUN: not llvm-mc -triple=mips-unknown-linux-gnu %s 2>&1 \
# RUN: | FileCheck -check-prefix=O32 %s
# RUN: not llvm-mc -triple=mips64-unknown-linux-gnuabin32 %s 2>&1 \
# RUN: | FileCheck -check-prefix=NABI %s
# RUN: not llvm-mc -triple=mips64-unknown-linux-gnu %s 2>&1 \
# RUN: | FileCheck -check-prefix=NABI %s
.text
.cplocal $32
# O32: :[[@LINE-1]]:{{[0-9]+}}: error: .cplocal is allowed only in N32 or N64 mode
# NABI: :[[@LINE-2]]:{{[0-9]+}}: error: invalid register
.cplocal $foo
# O32: :[[@LINE-1]]:{{[0-9]+}}: error: .cplocal is allowed only in N32 or N64 mode
# NABI: :[[@LINE-2]]:{{[0-9]+}}: error: expected register containing global pointer
.cplocal bar
# O32: :[[@LINE-1]]:{{[0-9]+}}: error: .cplocal is allowed only in N32 or N64 mode
# NABI: :[[@LINE-2]]:{{[0-9]+}}: error: expected register containing global pointer
.cplocal $25 foobar
# O32: :[[@LINE-1]]:{{[0-9]+}}: error: .cplocal is allowed only in N32 or N64 mode
# NABI: :[[@LINE-2]]:{{[0-9]+}}: error: unexpected token, expected end of statement