Files
clang-p2996/llvm/test/CodeGen/MIR/AArch64/unnamed-stack.ll
Gabriel Hjort Åkerlund b9a7c89d43 [MIRPrinter] Fix incorrect output of unnamed stack names
The MIRParser expects unnamed stack entries to have empty names ('').
In case of unnamed alloca instructions, the MIRPrinter would output
'<unnamed alloca>', which caused the MIRParser to reject the generated
code.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D93685
2020-12-28 18:01:40 +01:00

24 lines
620 B
LLVM

; RUN: llc -O0 -march aarch64 -global-isel -stop-after=irtranslator -o - %s | llc -x mir -march aarch64 -run-pass=none -o - | FileCheck %s
define i16 @unnamed_stack() {
entry:
; CHECK-NAME: unnamed_stack
; CHECK: stack:
; CHECK-NEXT: - { id: 0, name: '',
; CHECK: %0:_(p0) = G_FRAME_INDEX %stack.0
%0 = alloca i16
%1 = load i16, i16* %0
ret i16 %1
}
define i16 @named_stack() {
entry:
; CHECK-NAME: named_stack
; CHECK: stack:
; CHECK-NEXT: - { id: 0, name: ptr,
; CHECK: %0:_(p0) = G_FRAME_INDEX %stack.0.ptr
%ptr = alloca i16
%0 = load i16, i16* %ptr
ret i16 %0
}