File tree Expand file tree Collapse file tree 3 files changed +43
-30
lines changed Expand file tree Collapse file tree 3 files changed +43
-30
lines changed Original file line number Diff line number Diff line change 1+ # RUN: llvm-mc -triple=riscv64 -filetype=obj %s | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,RV64
2+ # RUN: llvm-mc -triple=riscv32 -filetype=obj %s | llvm-readobj -r - | FileCheck %s --check-prefixes=CHECK,RV32
3+
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 g
7+ g:
8+ l:
9+
10+ # CHECK: Section ({{.*}}) .rela.data {
11+ # CHECK-NEXT: 0x0 R_RISCV_PLT32 l 0x0
12+ # CHECK-NEXT: 0x4 R_RISCV_PLT32 l 0x4
13+ # CHECK-NEXT: 0x8 R_RISCV_PLT32 extern 0x4
14+ # CHECK-NEXT: 0xC R_RISCV_PLT32 g 0x8
15+ # CHECK-NEXT: 0x10 R_RISCV_PLT32 g 0x18
16+ # CHECK-NEXT: }
17+ .data
18+ .word l@plt - .
19+ .word l@plt - .data
20+
21+ .word extern@plt - . + 4
22+ .word g@plt - . + 8
23+ .word g@plt - .data + 8
24+
25+ # CHECK: Section ({{.*}}) .rela.data1 {
26+ # CHECK-NEXT: 0x0 R_RISCV_GOT32_PCREL data1 0x0
27+ # CHECK-NEXT: 0x4 R_RISCV_GOT32_PCREL extern 0x4
28+ # RV32-NEXT: 0x8 R_RISCV_GOT32_PCREL extern 0xFFFFFFFB
29+ # RV64-NEXT: 0x8 R_RISCV_GOT32_PCREL extern 0xFFFFFFFFFFFFFFFB
30+ # CHECK-NEXT: }
31+ .section .data1,"aw"
32+ data1:
33+ .word data1@GOTPCREL
34+ .word extern@gotpcrel+4
35+ .word extern@GOTPCREL-5
36+
37+ .ifdef ERR
38+ # ERR: [[#@LINE+1]]:7: error: symbol 'und' can not be undefined in a subtraction expression
39+ .word extern@plt - und
40+
41+ # ERR: [[#@LINE+1]]:7: error: symbol 'und' can not be undefined in a subtraction expression
42+ .word extern@gotpcrel - und
43+ .endif
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments