<commit_before># REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t

# Empty SECTIONS command.
# RUN: echo "SECTIONS {}" > %t.script
# RUN: ld.lld2 -o %t1 --script %t.script %t
# RUN: llvm-objdump -section-headers %t1 | \
# RUN:   FileCheck -check-prefix=SEC-DEFAULT %s

# SECTIONS command with the same order as default.
# RUN: echo "SECTIONS { \
# RUN:          .text : { *(.text) } \
# RUN:          .data : { *(.data) } }" \ > %t.script
# RUN: ld.lld2 -o %t2 --script %t.script %t
# RUN: llvm-objdump -section-headers %t2 | \
# RUN:   FileCheck -check-prefix=SEC-DEFAULT %s

#             Idx Name          Size
# SEC-DEFAULT: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-DEFAULT: 2 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-DEFAULT: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-DEFAULT: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-DEFAULT: 5 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-DEFAULT: 6 .symtab       00000030 {{[0-9a-f]*}}
# SEC-DEFAULT: 7 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-DEFAULT: 8 .strtab       00000008 {{[0-9a-f]*}}

# Sections are put in order specified in linker script.
# RUN: echo "SECTIONS { \
# RUN:          .bss : { *(.bss) } \
# RUN:          other : { *(other) } \
# RUN:          .shstrtab : { *(.shstrtab) } \
# RUN:          .symtab : { *(.symtab) } \
# RUN:          .strtab : { *(.strtab) } \
# RUN:          .data : { *(.data) } \
# RUN:          .text : { *(.text) } }" \ > %t.script
# RUN: ld.lld2 -o %t3 --script %t.script %t
# RUN: llvm-objdump -section-headers %t3 | \
# RUN:   FileCheck -check-prefix=SEC-ORDER %s

#           Idx Name          Size
# SEC-ORDER: 1 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-ORDER: 2 other         00000003 {{[0-9a-f]*}} DATA
# SEC-ORDER: 3 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-ORDER: 4 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-ORDER: 5 .symtab       00000030 {{[0-9a-f]*}}
# SEC-ORDER: 6 .strtab       00000008 {{[0-9a-f]*}}
# SEC-ORDER: 7 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-ORDER: 8 .text         0000000e {{[0-9a-f]*}} TEXT DATA

# .text and .data have swapped names but proper sizes and types.
# RUN: echo "SECTIONS { \
# RUN:          .data : { *(.text) } \
# RUN:          .text : { *(.data) } }" \ > %t.script
# RUN: ld.lld2 -o %t4 --script %t.script %t
# RUN: llvm-objdump -section-headers %t4 | \
# RUN:   FileCheck -check-prefix=SEC-SWAP-NAMES %s

#                Idx Name          Size
# SEC-SWAP-NAMES: 1 .data         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-SWAP-NAMES: 2 .text         00000020 {{[0-9a-f]*}} DATA
# SEC-SWAP-NAMES: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-SWAP-NAMES: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-SWAP-NAMES: 5 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 6 .symtab       00000030 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 7 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 8 .strtab       00000008 {{[0-9a-f]*}}

# .shstrtab from the input object file is discarded.
# RUN: echo "SECTIONS { \
# RUN:          /DISCARD/ : { *(.shstrtab) } }" \ > %t.script
# RUN: ld.lld2 -o %t5 --script %t.script %t
# RUN: llvm-objdump -section-headers %t5 | \
# RUN:   FileCheck -check-prefix=SEC-DISCARD %s

#             Idx Name          Size
# SEC-DISCARD: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-DISCARD: 2 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-DISCARD: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-DISCARD: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-DISCARD: 5 .symtab       00000030 {{[0-9a-f]*}}
# SEC-DISCARD: 6 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-DISCARD: 7 .strtab       00000008 {{[0-9a-f]*}}

# Multiple SECTIONS command specifying additional input section descriptions
# for the same output section description - input sections are merged into
# one output section.
# RUN: echo "SECTIONS { \
# RUN:          .text : { *(.text) } \
# RUN:          .data : { *(.data) } } \
# RUN:       SECTIONS { \
# RUN:          .data : { *(other) } }" \ > %t.script
# RUN: ld.lld2 -o %t6 --script %t.script %t
# RUN: llvm-objdump -section-headers %t6 | \
# RUN:   FileCheck -check-prefix=SEC-MULTI %s

#           Idx Name          Size
# SEC-MULTI: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-MULTI: 2 .data         00000023 {{[0-9a-f]*}} DATA
# SEC-MULTI: 3 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-MULTI: 4 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-MULTI: 5 .symtab       00000030 {{[0-9a-f]*}}<commit_msg>Fix failing test on Windows<commit_after># REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t

# Empty SECTIONS command.
# RUN: echo "SECTIONS {}" > %t.script
# RUN: ld.lld2 -o %t1 --script %t.script %t
# RUN: llvm-objdump -section-headers %t1 | \
# RUN:   FileCheck -check-prefix=SEC-DEFAULT %s

# SECTIONS command with the same order as default.
# RUN: echo "SECTIONS { \
# RUN:          .text : { *(.text) } \
# RUN:          .data : { *(.data) } }" > %t.script
# RUN: ld.lld2 -o %t2 --script %t.script %t
# RUN: llvm-objdump -section-headers %t2 | \
# RUN:   FileCheck -check-prefix=SEC-DEFAULT %s

#             Idx Name          Size
# SEC-DEFAULT: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-DEFAULT: 2 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-DEFAULT: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-DEFAULT: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-DEFAULT: 5 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-DEFAULT: 6 .symtab       00000030 {{[0-9a-f]*}}
# SEC-DEFAULT: 7 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-DEFAULT: 8 .strtab       00000008 {{[0-9a-f]*}}

# Sections are put in order specified in linker script.
# RUN: echo "SECTIONS { \
# RUN:          .bss : { *(.bss) } \
# RUN:          other : { *(other) } \
# RUN:          .shstrtab : { *(.shstrtab) } \
# RUN:          .symtab : { *(.symtab) } \
# RUN:          .strtab : { *(.strtab) } \
# RUN:          .data : { *(.data) } \
# RUN:          .text : { *(.text) } }" > %t.script
# RUN: ld.lld2 -o %t3 --script %t.script %t
# RUN: llvm-objdump -section-headers %t3 | \
# RUN:   FileCheck -check-prefix=SEC-ORDER %s

#           Idx Name          Size
# SEC-ORDER: 1 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-ORDER: 2 other         00000003 {{[0-9a-f]*}} DATA
# SEC-ORDER: 3 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-ORDER: 4 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-ORDER: 5 .symtab       00000030 {{[0-9a-f]*}}
# SEC-ORDER: 6 .strtab       00000008 {{[0-9a-f]*}}
# SEC-ORDER: 7 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-ORDER: 8 .text         0000000e {{[0-9a-f]*}} TEXT DATA

# .text and .data have swapped names but proper sizes and types.
# RUN: echo "SECTIONS { \
# RUN:          .data : { *(.text) } \
# RUN:          .text : { *(.data) } }" > %t.script
# RUN: ld.lld2 -o %t4 --script %t.script %t
# RUN: llvm-objdump -section-headers %t4 | \
# RUN:   FileCheck -check-prefix=SEC-SWAP-NAMES %s

#                Idx Name          Size
# SEC-SWAP-NAMES: 1 .data         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-SWAP-NAMES: 2 .text         00000020 {{[0-9a-f]*}} DATA
# SEC-SWAP-NAMES: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-SWAP-NAMES: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-SWAP-NAMES: 5 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 6 .symtab       00000030 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 7 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-SWAP-NAMES: 8 .strtab       00000008 {{[0-9a-f]*}}

# .shstrtab from the input object file is discarded.
# RUN: echo "SECTIONS { \
# RUN:          /DISCARD/ : { *(.shstrtab) } }" > %t.script
# RUN: ld.lld2 -o %t5 --script %t.script %t
# RUN: llvm-objdump -section-headers %t5 | \
# RUN:   FileCheck -check-prefix=SEC-DISCARD %s

#             Idx Name          Size
# SEC-DISCARD: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-DISCARD: 2 .data         00000020 {{[0-9a-f]*}} DATA
# SEC-DISCARD: 3 other         00000003 {{[0-9a-f]*}} DATA
# SEC-DISCARD: 4 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-DISCARD: 5 .symtab       00000030 {{[0-9a-f]*}}
# SEC-DISCARD: 6 .shstrtab     00000032 {{[0-9a-f]*}}
# SEC-DISCARD: 7 .strtab       00000008 {{[0-9a-f]*}}

# Multiple SECTIONS command specifying additional input section descriptions
# for the same output section description - input sections are merged into
# one output section.
# RUN: echo "SECTIONS { \
# RUN:          .text : { *(.text) } \
# RUN:          .data : { *(.data) } } \
# RUN:       SECTIONS { \
# RUN:          .data : { *(other) } }" > %t.script
# RUN: ld.lld2 -o %t6 --script %t.script %t
# RUN: llvm-objdump -section-headers %t6 | \
# RUN:   FileCheck -check-prefix=SEC-MULTI %s

#           Idx Name          Size
# SEC-MULTI: 1 .text         0000000e {{[0-9a-f]*}} TEXT DATA
# SEC-MULTI: 2 .data         00000023 {{[0-9a-f]*}} DATA
# SEC-MULTI: 3 .bss          00000002 {{[0-9a-f]*}} BSS
# SEC-MULTI: 4 .shstrtab     00000002 {{[0-9a-f]*}}
# SEC-MULTI: 5 .symtab       00000030 {{[0-9a-f]*}}
{'fraction_non_alphanumeric': 0.1977936260307555, 'fraction_numerical': 0.09248941386226878, 'mean_word_length': 2.119568995481404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 44, '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': '5899385', 'n_tokens_mistral': 4180, 'n_tokens_neox': 3559, 'n_words': 905}