Skip to content

Commit 1d1abdd

Browse files
committed
Fix parser and add parser test
Created using spr 1.3.6-beta.1
1 parent 19a2418 commit 1d1abdd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

llvm/lib/MC/MCSectionELF.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,13 @@ void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
176176
OS << "llvm_lto";
177177
else if (Type == ELF::SHT_LLVM_JT_SIZES)
178178
OS << "llvm_jt_sizes";
179+
else if (Type == ELF::SHT_LLVM_CFI_JUMP_TABLE)
180+
OS << "llvm_cfi_jump_table";
179181
else
180182
OS << "0x" << Twine::utohexstr(Type);
181183

182184
if (EntrySize) {
183-
assert(Flags & ELF::SHF_MERGE);
185+
assert((Flags & ELF::SHF_MERGE) || Type == ELF::SHT_LLVM_CFI_JUMP_TABLE);
184186
OS << "," << EntrySize;
185187
}
186188

llvm/test/MC/AsmParser/llvm_section_types.s

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
## Verify that LLVM-specific section types are correctly inferred from assembly input.
1+
## Verify that LLVM-specific section types are correctly inferred from assembly input and printed.
2+
# RUN: llvm-mc -triple i386-pc-linux %s | FileCheck --check-prefix=ASM %s
23
# RUN: llvm-mc -triple i386-pc-linux -filetype=obj -o %t %s
34
# RUN: llvm-readobj -S %t | FileCheck %s
5+
# ASM: .section .section1,"",@llvm_bb_addr_map
46
.section .section1,"",@llvm_bb_addr_map
57
.byte 1
8+
# ASM: .section .section2,"",@llvm_call_graph_profile
69
.section .section2,"",@llvm_call_graph_profile
710
.byte 1
11+
# ASM: .section .section3,"",@llvm_odrtab
812
.section .section3,"",@llvm_odrtab
913
.byte 1
14+
# ASM: .section .section4,"",@llvm_linker_options
1015
.section .section4,"",@llvm_linker_options
1116
.byte 1
17+
# ASM: .section .section5,"",@llvm_sympart
1218
.section .section5,"",@llvm_sympart
1319
.byte 1
20+
# ASM: .section .section6,"",@llvm_dependent_libraries
1421
.section .section6,"",@llvm_dependent_libraries
1522
.byte 1
23+
# ASM: .section .section7,"",@llvm_offloading
1624
.section .section7,"",@llvm_offloading
1725
.byte 1
26+
# ASM: .section .section8,"",@llvm_lto
1827
.section .section8,"",@llvm_lto
1928
.byte 1
29+
# ASM: .section .section9,"",@llvm_cfi_jump_table,1
2030
.section .section9,"",@llvm_cfi_jump_table,1
2131
.byte 1
2232

0 commit comments

Comments
 (0)