1 ; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o %t.o
2 ; RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=RELAX %s
3 ; RUN: llvm-dwarfdump --debug-frame %t.o 2>&1 \
4 ; RUN: | FileCheck -check-prefix=RELAX-DWARFDUMP %s
6 ; RELAX: Section ({{.*}}) .rela.eh_frame {
7 ; REALX-NEXT: 0x1C R_RISCV_32_PCREL .L0 0x0
8 ; REALX-NEXT: 0x30 R_RISCV_32_PCREL .L0 0x0
9 ; REALX-NEXT: 0x48 R_RISCV_32_PCREL .L0 0x0
10 ; REALX-NEXT: 0x4C R_RISCV_ADD32 .L0 0x0
11 ; REALX-NEXT: 0x4C R_RISCV_SUB32 .L0 0x0
12 ; REALX-NEXT: 0x57 R_RISCV_SET6 .L0 0x0
15 ; RELAX-DWARFDUMP-NOT: error: failed to compute relocation
16 ; RELAX-DWARFDUMP: FDE
17 ; RELAX-DWARFDUMP-NEXT: Format:
18 ; RELAX-DWARFDUMP: DW_CFA_advance_loc: 4
19 ; RELAX-DWARFDUMP-NEXT: DW_CFA_def_cfa_offset: +16
20 ; RELAX-DWARFDUMP-NEXT: DW_CFA_advance_loc: 8
21 ; RELAX-DWARFDUMP-NEXT: DW_CFA_def_cfa_offset: +0
22 ; RELAX-DWARFDUMP-NEXT: DW_CFA_nop:
23 ; RELAX-DWARFDUMP-EMPTY:
25 ; RELAX-DWARFDUMP: FDE
26 ; RELAX-DWARFDUMP: Format:
27 ; RELAX-DWARFDUMP-NEXT: DW_CFA_advance_loc: 4
28 ; RELAX-DWARFDUMP-NEXT: DW_CFA_def_cfa_offset: +16
29 ; RELAX-DWARFDUMP-NEXT: DW_CFA_advance_loc: 4
30 ; RELAX-DWARFDUMP-NEXT: DW_CFA_offset: X1 -4
31 ; RELAX-DWARFDUMP-NEXT: DW_CFA_advance_loc: 28
32 ; RELAX-DWARFDUMP-NEXT: DW_CFA_restore: X1
33 ; RELAX-DWARFDUMP-NEXT: DW_CFA_advance_loc: 4
34 ; RELAX-DWARFDUMP-NEXT: DW_CFA_def_cfa_offset: +0
35 ; RELAX-DWARFDUMP-EMPTY:
36 source_filename = "frame.c"
38 ; Function Attrs: noinline nounwind optnone
44 ; Function Attrs: noinline nounwind optnone
45 define i32 @foo(i32 signext %value) {
47 %value.addr = alloca i32, align 4
48 store i32 %value, ptr %value.addr, align 4
49 %0 = load i32, ptr %value.addr, align 4
53 ; Function Attrs: noinline nounwind optnone
56 %result = alloca i32, align 4
57 %v = alloca i32, align 4
58 %call = call i32 @init()
59 store i32 %call, ptr %v, align 4
60 %0 = load i32, ptr %v, align 4
61 %call1 = call i32 @foo(i32 signext %0)
62 store i32 %call1, ptr %result, align 4
63 %1 = load i32, ptr %result, align 4
68 !llvm.module.flags = !{!3, !4, !5}
70 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
71 !1 = !DIFile(filename: "line.c", directory: "./")
73 !3 = !{i32 2, !"Dwarf Version", i32 4}
74 !4 = !{i32 2, !"Debug Info Version", i32 3}
75 !5 = !{i32 1, !"wchar_size", i32 4}