brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 4c748ad Raw
49 lines · plain
1; RUN: llc < %s -mtriple=avr | FileCheck %s2 3; The avr-rust bug can be found here:4; https://github.com/avr-rust/rust/issues/1125;6; In this test, the codegen stage generates a FRMIDX7; instruction. Later in the pipeline, the frame index8; gets expanded into a 16-bit MOVWRdRr instruction.9;10; There was a bug in the FRMIDX->MOVWRdRr expansion logic11; that could leave the MOVW instruction with an extraneous12; operand, left over from the original FRMIDX.13;14; This would trigger an assertion:15;16;   Assertion failed: ((isImpReg || Op.isRegMask() || MCID->isVariadic() ||17;                       OpNo < MCID->getNumOperands() || isMetaDataOp) &&18;                       "Trying to add an operand to a machine instr that is already done!"),19;   function addOperand, file llvm/lib/CodeGen/MachineInstr.cpp20;21; The logic has since been fixed.22 23; CHECK-LABEL: "core::str::slice_error_fail"24define void @"core::str::slice_error_fail"(i16 %arg) personality ptr addrspace(1) @rust_eh_personality {25start:26  %char_range = alloca { i16, i16 }, align 127  br i1 undef, label %"<core::option::Option<T>>::unwrap.exit.thread", label %bb11.i.i28 29"<core::option::Option<T>>::unwrap.exit.thread":30  br label %"core::char::methods::<impl char>::len_utf8.exit"31 32bb11.i.i:33  %tmp = bitcast ptr %char_range to ptr34  %tmp1 = icmp ult i32 undef, 6553635  %..i = select i1 %tmp1, i16 3, i16 436  br label %"core::char::methods::<impl char>::len_utf8.exit"37 38"core::char::methods::<impl char>::len_utf8.exit":39  %tmp2 = phi ptr [ %tmp, %bb11.i.i ], [ undef, %"<core::option::Option<T>>::unwrap.exit.thread" ]40  %_0.0.i12 = phi i16 [ %..i, %bb11.i.i ], [ 1, %"<core::option::Option<T>>::unwrap.exit.thread" ]41  %tmp3 = add i16 %_0.0.i12, %arg42  store i16 %tmp3, ptr undef, align 143  store ptr %tmp2, ptr undef, align 144  unreachable45}46 47declare i32 @rust_eh_personality(...) addrspace(1)48 49