Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ void AsmPrinter::emitStackSizeSection(const MachineFunction &MF) {
return;

MCSection *StackSizeSection =
getObjFileLowering().getStackSizesSection(*getCurrentSection());
getObjFileLowering().getStackSizesSection(*MF.getSection());
if (!StackSizeSection)
return;

Expand Down
30 changes: 30 additions & 0 deletions llvm/test/CodeGen/SystemZ/stack-size-section.ll
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,34 @@ define void @dynalloc(i32 %N) #0 {
ret void
}

; Check that .stack_sizes section is linked to the function's section (.text),
; and not to the section containing the jump table (.rodata).
; CHECK-LABEL: .section .stack_sizes,"o",@progbits,.text{{$}}
; CHECK-NEXT: .quad .Lfunc_begin4
; CHECK-NEXT: .ascii "\260!"
define i32 @jump_table(i32 %x) {
%arr = alloca [1024 x i32]
switch i32 %x, label %sw.epilog [
i32 0, label %sw.bb0
i32 1, label %sw.bb1
i32 2, label %sw.bb2
i32 3, label %sw.bb3
]

sw.bb0:
ret i32 0

sw.bb1:
ret i32 1

sw.bb2:
ret i32 2

sw.bb3:
ret i32 3

sw.epilog:
ret i32 -1
}

attributes #0 = { "frame-pointer"="all" }