diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/MachineOperand.cpp | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/SystemZ/isel-debug.ll | 19 | 
2 files changed, 21 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index a116d8fe877..97d32a5d66a 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -461,7 +461,8 @@ static void printIRValueReference(raw_ostream &OS, const Value &V,      printLLVMNameWithoutPrefix(OS, V.getName());      return;    } -  MachineOperand::printIRSlotNumber(OS, MST.getLocalSlot(&V)); +  int Slot = MST.getCurrentFunction() ? MST.getLocalSlot(&V) : -1; +  MachineOperand::printIRSlotNumber(OS, Slot);  }  static void printSyncScope(raw_ostream &OS, const LLVMContext &Context, diff --git a/llvm/test/CodeGen/SystemZ/isel-debug.ll b/llvm/test/CodeGen/SystemZ/isel-debug.ll new file mode 100644 index 00000000000..cf5370cbec6 --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/isel-debug.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -mtriple=s390x-linux-gnu -debug-only=systemz-isel -o - 2>&1 | \ +; RUN:   FileCheck %s + +; REQUIRES: asserts +; +; Check that some debug output is printed without problems. +; CHECK: SystemZAddressingMode +; CHECK: Base +; CHECK: Index +; CHECK: Disp + +define void @fun(i64* %ptr) { +entry: +  %0 = bitcast i64* %ptr to i32** +  %1 = load i32*, i32** %0, align 8 +  %xpv_pv = getelementptr inbounds i32, i32* %1 +  store i32 0, i32* %xpv_pv +  ret void +}  | 

