Kito Cheng e45087fd53 [RISCV] Fix state persistence bugs (PR55548)
We didn't implement RISCVELFStreamer::reset and cause some very strange
section output for attribute section...just reference D15950 to see how
ARM implement that.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D125905
2022-05-26 16:09:00 +08:00

18 lines
683 B
LLVM

; Check for state persistence bugs in the RISC-V MC backend
; This should neither fail (in the comparison that the second object
; is bit-identical to the first) nor crash. Either failure would most
; likely indicate some state that is not properly reset in the
; appropriate ::reset method.
; RUN: llc -compile-twice -filetype=obj -mtriple=riscv64 %s -o - \
; RUN: | llvm-objdump --section-headers - \
; RUN: | FileCheck %s
; CHECK: Sections:
; CHECK-NEXT: Idx Name Size VMA Type
; CHECK-NEXT: 0
; CHECK-NEXT: 1 .strtab
; CHECK-NEXT: 2 .text
; CHECK-NEXT: 3 .note.GNU-stack
; CHECK-NEXT: 4 .riscv.attributes
; CHECK-NEXT: 5 .symtab