49 lines · plain
1# RUN: llvm-mc -triple=riscv64 -filetype=obj %s | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,RV642# RUN: llvm-mc -triple=riscv32 -filetype=obj %s | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,RV323 4# RUN: not llvm-mc -triple=riscv64 -filetype=obj %s --defsym ERR=1 -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:5 6.globl g7g:8l:9 10# CHECK: Section ({{.*}}) .rela.data {11# CHECK-NEXT: 0x0 R_RISCV_PLT32 l 0x012# CHECK-NEXT: 0x4 R_RISCV_PLT32 extern 0x413# CHECK-NEXT: 0x8 R_RISCV_PLT32 g 0x814# CHECK-NEXT: }15.data16.word %pltpcrel(l)17.word %pltpcrel(extern + 4), %pltpcrel(g + 8)18 19# CHECK: Section ({{.*}}) .rela.data1 {20# CHECK-NEXT: 0x0 R_RISCV_GOT32_PCREL data1 0x021# CHECK-NEXT: 0x4 R_RISCV_GOT32_PCREL extern 0x422# RV32-NEXT: 0x8 R_RISCV_GOT32_PCREL extern 0xFFFFFFFB23# RV64-NEXT: 0x8 R_RISCV_GOT32_PCREL extern 0xFFFFFFFFFFFFFFFB24# CHECK-NEXT: }25.section .data1,"aw"26data1:27.word %gotpcrel(data1)28.word %gotpcrel(extern+4), %gotpcrel(extern-5)29 30.ifdef ERR31# ERR: [[#@LINE+1]]:8: error: %pltpcrel can only be used in a .word directive32.quad %pltpcrel(g)33 34# ERR: [[#@LINE+1]]:8: error: expected relocatable expression35.word %pltpcrel(g-.)36 37# ERR: [[#@LINE+1]]:8: error: expected relocatable expression38.word %pltpcrel(extern - und)39 40# ERR: [[#@LINE+1]]:8: error: %gotpcrel can only be used in a .word directive41.quad %gotpcrel(g)42 43# ERR: [[#@LINE+1]]:8: error: expected relocatable expression44.word %gotpcrel(extern - .)45 46# ERR: [[#@LINE+1]]:8: error: expected relocatable expression47.word %gotpcrel(extern - und)48.endif49