xref: /llvm-project-15.0.7/llvm/test/MC/RISCV/hilo-constaddr-expr.s (revision b30bc8cc)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=+relax %s -o /dev/null 2>&1 | FileCheck %s
2# RUN: not llvm-mc -filetype=obj -triple=riscv32 -mattr=-relax %s -o /dev/null 2>&1 | FileCheck %s
3
4# Check the assembler rejects hi and lo expressions with constant expressions
5# involving labels when diff expressions are emitted as relocation pairs.
6# Test case derived from test/MC/Mips/hilo-addressing.s
7
8tmp1:
9tmp2:
10# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
11  lui t0, %hi(tmp3-tmp1)
12# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
13  lw ra, %lo(tmp3-tmp1)(t0)
14
15tmp3:
16# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
17  lui t1, %hi(tmp2-tmp3)
18# CHECK: :[[#@LINE+1]]:[[#]]: error: expected relocatable expression
19  lw sp, %lo(tmp2-tmp3)(t1)
20

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026