<commit_before>; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o %t.o
; RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=READOBJ-RELOCS %s
; RUN: llvm-objdump --source %t.o | FileCheck -check-prefix=OBJDUMP-SOURCE %s
; RUN: llvm-dwarfdump --debug-info --debug-line %t.o | \
; RUN:     FileCheck -check-prefix=DWARF-DUMP %s

; Check that we actually have relocations, otherwise this is kind of pointless.
; READOBJ-RELOCS:  Section (8) .rela.debug_info {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0x0
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 - 0x0
; READOBJ-RELOCS:  Section (11) .rela.debug_addr {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0x0
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 - 0x0
; READOBJ-RELOCS:  Section (17) .rela.debug_line {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0xFFFFFFFC
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 .Lline_table_start0 0x0

; Check that we can print the source, even with relocations.
; OBJDUMP-SOURCE: Disassembly of section .text:
; OBJDUMP-SOURCE-EMPTY:
; OBJDUMP-SOURCE-NEXT: 00000000 main:
; OBJDUMP-SOURCE: ; {
; OBJDUMP-SOURCE: ; return 0;

; Check that we correctly dump the DWARF info, even with relocations.
; DWARF-DUMP: DW_AT_name        ("dwarf-riscv-relocs.c")
; DWARF-DUMP: DW_AT_comp_dir    (".")
; DWARF-DUMP: DW_AT_name      ("main")
; DWARF-DUMP: DW_AT_decl_file ("./dwarf-riscv-relocs.c")
; DWARF-DUMP: DW_AT_decl_line (1)
; DWARF-DUMP: DW_AT_type      (0x00000032 "int")
; DWARF-DUMP: DW_AT_name      ("int")
; DWARF-DUMP: DW_AT_encoding  (DW_ATE_signed)
; DWARF-DUMP: DW_AT_byte_size (0x04)

; DWARF-DUMP: .debug_line contents:
; DWARF-DUMP-NEXT: debug_line[0x00000000]
; DWARF-DUMP-NEXT: Line table prologue:
; DWARF-DUMP-NEXT:     total_length: 0x0000005f
; DWARF-DUMP-NEXT:          version: 5<commit_msg>[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows<commit_after>; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o %t.o
; RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=READOBJ-RELOCS %s
; RUN: llvm-objdump --source %t.o | FileCheck -check-prefix=OBJDUMP-SOURCE %s
; RUN: llvm-dwarfdump --debug-info --debug-line %t.o | \
; RUN:     FileCheck -check-prefix=DWARF-DUMP %s

; Check that we actually have relocations, otherwise this is kind of pointless.
; READOBJ-RELOCS:  Section (8) .rela.debug_info {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0x0
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 - 0x0
; READOBJ-RELOCS:  Section (11) .rela.debug_addr {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0x0
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 - 0x0
; READOBJ-RELOCS:  Section (17) .rela.debug_line {
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_ADD32 - 0xFFFFFFFC
; READOBJ-RELOCS-NEXT:    0x0 R_RISCV_SUB32 .Lline_table_start0 0x0

; Check that we can print the source, even with relocations.
; OBJDUMP-SOURCE: Disassembly of section .text:
; OBJDUMP-SOURCE-EMPTY:
; OBJDUMP-SOURCE-NEXT: 00000000 main:
; OBJDUMP-SOURCE: ; {
; OBJDUMP-SOURCE: ; return 0;

; Check that we correctly dump the DWARF info, even with relocations.
; DWARF-DUMP: DW_AT_name        ("dwarf-riscv-relocs.c")
; DWARF-DUMP: DW_AT_comp_dir    (".")
; DWARF-DUMP: DW_AT_name      ("main")
; DWARF-DUMP: DW_AT_decl_file ("{{.*}}dwarf-riscv-relocs.c")
; DWARF-DUMP: DW_AT_decl_line (1)
; DWARF-DUMP: DW_AT_type      (0x00000032 "int")
; DWARF-DUMP: DW_AT_name      ("int")
; DWARF-DUMP: DW_AT_encoding  (DW_ATE_signed)
; DWARF-DUMP: DW_AT_byte_size (0x04)

; DWARF-DUMP: .debug_line contents:
; DWARF-DUMP-NEXT: debug_line[0x00000000]
; DWARF-DUMP-NEXT: Line table prologue:
; DWARF-DUMP-NEXT:     total_length: 0x0000005f
; DWARF-DUMP-NEXT:          version: 5
{'fraction_non_alphanumeric': 0.13426305715066994, 'fraction_numerical': 0.04539239814055236, 'mean_word_length': 3.8773333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6949267', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1599, 'n_words': 318}