1 # RUN: llvm-mc -triple=riscv32 %s | FileCheck --check-prefix=PRINT %s
2 # RUN: llvm-mc -triple=riscv64 %s | FileCheck --check-prefix=PRINT %s
3 # RUN: llvm-mc -filetype=obj -triple=riscv32 %s | llvm-readobj -r - | FileCheck %s
4 # RUN: llvm-mc -filetype=obj -triple=riscv64 %s | llvm-readobj -r - | FileCheck %s
6 # PRINT: .reloc 8, R_RISCV_NONE, .data
7 # PRINT: .reloc 4, R_RISCV_NONE, foo+4
8 # PRINT: .reloc 0, R_RISCV_NONE, 8
9 # PRINT: .reloc 0, R_RISCV_32, .data+2
10 # PRINT: .reloc 0, R_RISCV_SET32, foo+3
11 # PRINT: .reloc 0, R_RISCV_32_PCREL, 5
12 # PRINT: .reloc 0, BFD_RELOC_NONE, 9
13 # PRINT-NEXT: .reloc 0, BFD_RELOC_32, 9
14 # PRINT-NEXT: .reloc 0, BFD_RELOC_64, 9
16 # CHECK: 0x8 R_RISCV_NONE .data 0x0
17 # CHECK-NEXT: 0x4 R_RISCV_NONE foo 0x4
18 # CHECK-NEXT: 0x0 R_RISCV_NONE - 0x8
19 # CHECK-NEXT: 0x0 R_RISCV_32 .data 0x2
20 # CHECK-NEXT: 0x0 R_RISCV_SET32 foo 0x3
21 # CHECK-NEXT: 0x0 R_RISCV_32_PCREL - 0x5
22 # CHECK-NEXT: 0x0 R_RISCV_NONE - 0x9
23 # CHECK-NEXT: 0x0 R_RISCV_32 - 0x9
24 # CHECK-NEXT: 0x0 R_RISCV_64 - 0x9
26 # CHECK: Section ({{.*}}) .rela.data {
27 # CHECK-NEXT: 0x0 R_RISCV_32 - 0x6
28 # CHECK-NEXT: 0x4 R_RISCV_32 - 0x6
31 # CHECK: Section ({{.*}}) .rela.debug_line {
32 # CHECK-NEXT: 0x0 R_RISCV_32 - 0x6
35 # CHECK: Section ({{.*}}) .rela.pseudoprobe {
36 # CHECK-NEXT: 0x0 R_RISCV_32 - 0x6
43 .reloc 8, R_RISCV_NONE, .data
44 .reloc 4, R_RISCV_NONE, foo+4
45 .reloc 0, R_RISCV_NONE, 8
47 .reloc 0, R_RISCV_32, .data+2
48 .reloc 0, R_RISCV_SET32, foo+3
49 .reloc 0, R_RISCV_32_PCREL, 5
51 .reloc 0, BFD_RELOC_NONE, 9
52 .reloc 0, BFD_RELOC_32, 9
53 .reloc 0, BFD_RELOC_64, 9
55 .reloc foo, R_RISCV_32, 6
56 .reloc line, R_RISCV_32, 6
57 .reloc probe, R_RISCV_32, 6
59 .reloc foo+4, R_RISCV_32, 6
67 .section .debug_line,"",@progbits
71 .section .pseudoprobe,"",@progbits