diff --git a/kmir/src/kmir/kast.py b/kmir/src/kmir/kast.py index 7268cf755..d04d750bd 100644 --- a/kmir/src/kmir/kast.py +++ b/kmir/src/kmir/kast.py @@ -215,8 +215,19 @@ def _make_symbolic_call_config( types: Mapping[Ty, TypeMetadata], ) -> tuple[KInner, list[KInner]]: locals, constraints = _symbolic_locals(fn_data.args, types) + init_config = definition.init_config(KSort('GeneratedTopCell')) + _, init_subst = split_config_from(init_config) + symbolic_init_cells = ( + 'FRAMEID_CELL', + 'ADDRESSMAP_CELL', + 'NEXTADDRESS_CELL', + 'EXPOSEDSET_CELL', + 'GENERATEDCOUNTER_CELL', + ) + symbolic_init_subst = {cell: init_subst[cell] for cell in symbolic_init_cells if cell in init_subst} subst = Subst( { + **symbolic_init_subst, 'K_CELL': fn_data.call_terminator, 'STACK_CELL': list_empty(), # FIXME see #560, problems matching a symbolic stack 'LOCALS_CELL': list_of(locals), diff --git a/kmir/src/kmir/kdist/mir-semantics/kmir.md b/kmir/src/kmir/kdist/mir-semantics/kmir.md index 82c28b3f0..7bcae9073 100644 --- a/kmir/src/kmir/kdist/mir-semantics/kmir.md +++ b/kmir/src/kmir/kdist/mir-semantics/kmir.md @@ -213,18 +213,19 @@ value is the value in local `_0`, and will go to the _destination_ in the `LOCALS` of the caller's stack frame. Execution continues with the context of the enclosing stack frame, at the _target_. -If the returned value is a `Reference`, its stack height must be decremented because a stack frame is popped. -NB that a stack height of `0` cannot occur here, because the compiler prevents local variable references from escaping. +References and pointers already carry stable frame ids, so returning from a call does not require +rewriting the returned value when the callee frame is popped. If the local `_0` does not have a value (i.e., it remained uninitialised), the function returns unit and writing the value is skipped. ```k rule [termReturnSome]: #execTerminator(terminator(terminatorKindReturn, _SPAN)) ~> _ => - #setLocalValue(DEST, #decrementRef(VAL)) ~> #execBlockIdx(TARGET) + #setLocalValue(DEST, VAL) ~> #execBlockIdx(TARGET) _ => CALLER // + _ => FRAMEID _ => #getBlocks(CALLER) CALLER => NEWCALLER DEST => NEWDEST @@ -233,7 +234,7 @@ If the local `_0` does not have a value (i.e., it remained uninitialised), the f ListItem(typedValue(VAL:Value, _, _)) _ => NEWLOCALS // // remaining call stack (without top frame) - ListItem(StackFrame(NEWCALLER, NEWDEST, NEWTARGET, UNWIND, NEWLOCALS)) STACK => STACK + ListItem(StackFrame(FRAMEID, NEWCALLER, NEWDEST, NEWTARGET, UNWIND, NEWLOCALS)) STACK => STACK // no value to return, skip writing rule [termReturnNone]: #execTerminator(terminator(terminatorKindReturn, _SPAN)) ~> _ @@ -242,6 +243,7 @@ If the local `_0` does not have a value (i.e., it remained uninitialised), the f _ => CALLER // + _ => FRAMEID _ => #getBlocks(CALLER) CALLER => NEWCALLER _ => NEWDEST @@ -250,7 +252,7 @@ If the local `_0` does not have a value (i.e., it remained uninitialised), the f ListItem(_:NewLocal) _ => NEWLOCALS // // remaining call stack (without top frame) - ListItem(StackFrame(NEWCALLER, NEWDEST, NEWTARGET, UNWIND, NEWLOCALS)) STACK => STACK + ListItem(StackFrame(FRAMEID, NEWCALLER, NEWDEST, NEWTARGET, UNWIND, NEWLOCALS)) STACK => STACK syntax List ::= #getBlocks( Ty ) [function, total] | #getBlocksAux( MonoItemKind ) [function, total] @@ -356,6 +358,7 @@ where the returned result should go. CALLER => FTY + OLDFRAMEID => !_NEWFRAMEID:Int _ OLDCALLER => CALLER OLDDEST => DEST @@ -363,7 +366,7 @@ where the returned result should go. OLDUNWIND => UNWIND LOCALS - STACK => ListItem(StackFrame(OLDCALLER, OLDDEST, OLDTARGET, OLDUNWIND, LOCALS)) STACK + STACK => ListItem(StackFrame(OLDFRAMEID, OLDCALLER, OLDDEST, OLDTARGET, OLDUNWIND, LOCALS)) STACK requires notBool isIntrinsicFunction(FUNC) andBool notBool #functionNameMatchesEnv(getFunctionName(FUNC)) @@ -374,6 +377,7 @@ where the returned result should go. CALLER => FTY + OLDFRAMEID => !_NEWFRAMEID:Int _ OLDCALLER => CALLER OLDDEST => DEST @@ -381,7 +385,7 @@ where the returned result should go. OLDUNWIND => UNWIND LOCALS - STACK => ListItem(StackFrame(OLDCALLER, OLDDEST, OLDTARGET, OLDUNWIND, LOCALS)) STACK + STACK => ListItem(StackFrame(OLDFRAMEID, OLDCALLER, OLDDEST, OLDTARGET, OLDUNWIND, LOCALS)) STACK requires notBool isIntrinsicFunction(FUNC) andBool #functionNameMatchesEnv(getFunctionName(FUNC)) @@ -438,7 +442,8 @@ where the returned result should go. The local data has to be set up for the call, which requires information about the local variables of a call. This step is separate from the above call stack setup because it needs to retrieve the locals declaration from the body. Arguments to the call are `Operands` which refer to the old locals (`OLDLOCALS` below), and the data is either _copied_ into the new locals using `#setArgs`, or it needs to be _shared_ via references. -An operand may be a `Reference` (the only way a function could access another function call's `local` variables). For this case, the stack height in the `Reference` must be incremented because a stack frame is added. +An operand may be a `Reference` (the only way a function could access another function call's `local` +variables). With frame-id-based references, argument passing forwards the reference unchanged. ```k syntax KItem ::= #setUpCalleeData(MonoItemKind, Operands, Span) @@ -495,10 +500,10 @@ An operand may be a `Reference` (the only way a function could access another fu rule #setArgFromStack(IDX, operandCopy(place(local(I), .ProjectionElems))) => - #setLocalValue(place(local(IDX), .ProjectionElems), #incrementRef(getValue(CALLERLOCALS, I))) + #setLocalValue(place(local(IDX), .ProjectionElems), getValue(CALLERLOCALS, I)) ... - ListItem(StackFrame(_, _, _, _, CALLERLOCALS)) _:List + ListItem(StackFrame(_, _, _, _, _, CALLERLOCALS)) _:List requires 0 <=Int I andBool I #setArgFromStack(IDX, operandMove(place(local(I), _))) => - #setLocalValue(place(local(IDX), .ProjectionElems), #incrementRef(getValue(CALLERLOCALS, I))) + #setLocalValue(place(local(IDX), .ProjectionElems), getValue(CALLERLOCALS, I)) ... - (ListItem(StackFrame(_, _, _, _, CALLERLOCALS) #as CALLERFRAME => #updateStackLocal(CALLERFRAME, I, Moved))) _:List + (ListItem(StackFrame(_, _, _, _, _, CALLERLOCALS) #as CALLERFRAME => #updateStackLocal(CALLERFRAME, I, Moved))) _:List requires 0 <=Int I andBool I - #setLocalValue(place(local(1), .ProjectionElems), #incrementRef(getValue(LOCALS, CLOSURE))) + #setLocalValue(place(local(1), .ProjectionElems), getValue(LOCALS, CLOSURE)) ~> #setTupleArgs(2, getValue(LOCALS, TUPLE)) ~> #execBlock(FIRST) // arguments are tuple components, stored as _2 .. _n ... @@ -627,7 +632,7 @@ Therefore a heuristics is used here: rule #setTupleArgs(_, .List ) => .K ... rule #setTupleArgs(IDX, ListItem(VAL) REST:List) - => #setLocalValue(place(local(IDX), .ProjectionElems), #incrementRef(VAL)) ~> #setTupleArgs(IDX +Int 1, REST) + => #setLocalValue(place(local(IDX), .ProjectionElems), VAL) ~> #setTupleArgs(IDX +Int 1, REST) ... ``` diff --git a/kmir/src/kmir/kdist/mir-semantics/lemmas/kmir-lemmas.md b/kmir/src/kmir/kdist/mir-semantics/lemmas/kmir-lemmas.md index 525e311a0..f6ea2ee5e 100644 --- a/kmir/src/kmir/kdist/mir-semantics/lemmas/kmir-lemmas.md +++ b/kmir/src/kmir/kdist/mir-semantics/lemmas/kmir-lemmas.md @@ -51,29 +51,6 @@ If nothing is removed, the list remains the same. If all elements are removed, n rule #Ceil(range(L, A, B)) => #Ceil(L) #And #Ceil(A) #And #Ceil(B) #And {true #Equals A +Int B <=Int size(L)} [simplification] ``` -The `#mapOffset` function maps `#adjustRef` over a lists of `Value`s, leaving the list length unchanged. -Definedness of the list and list elements is also guaranteed. - -```k - rule size(#mapOffset(L, _)) => size(L) [simplification, preserves-definedness] - - rule #Ceil(#mapOffset(L, _)[I]) => #Ceil(L) #And {true #Equals 0 <=Int I} #And {true #Equals I #Ceil(L) [simplification] - - rule #adjustRef(VAL:Value, 0) => VAL [simplification] - - rule #adjustRef(#adjustRef(VAL, OFFSET1), OFFSET2) - => #adjustRef(VAL, OFFSET1 +Int OFFSET2) - [simplification] - - rule #mapOffset(L, 0) => L [simplification] - - rule #mapOffset(#mapOffset(L, OFFSET1), OFFSET2) - => #mapOffset(L, OFFSET1 +Int OFFSET2) - [simplification] -``` - ## Simplifications for `enum` Discriminants and Variant Indexes For symbolic enum values, the variant index remains unevaluated but the original (symbolic) discriminant can be restored: diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md b/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md index c5d764361..d4d7d86b0 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/configuration.md @@ -24,7 +24,8 @@ module KMIR-CONFIGURATION syntax RetVal ::= return( Value ) | "noReturn" - syntax StackFrame ::= StackFrame(caller:Ty, // index of caller function + syntax StackFrame ::= StackFrame(frameId:Int, // stable id for this frame + caller:Ty, // index of caller function dest:Place, // place to store return value target:MaybeBasicBlockIdx, // basic block to return to UnwindAction, // action to perform on panic @@ -36,6 +37,7 @@ module KMIR-CONFIGURATION ty(-1) // to retrieve caller // unpacking the top frame to avoid frequent stack read/write operations + 0 .List ty(-1) place(local(-1), .ProjectionElems) diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/data.md b/kmir/src/kmir/kdist/mir-semantics/rt/data.md index 5839521b4..9da6db8de 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/data.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/data.md @@ -266,41 +266,61 @@ A `Deref` projection in the projections list changes the target of the write ope [preserves-definedness] // valid context ensured upon context construction - rule #traverseProjection(toStack(FRAME, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) + rule #traverseProjection(toFrame(FRAMEID, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) + ~> #writeProjection(NEW) + => #setLocalValue(place(local(I), .ProjectionElems), #buildUpdate(NEW, CONTEXTS)) + ... + + + FRAMEID + LOCALS + ... + + requires 0 <=Int I andBool I #traverseProjection(toFrame(FRAMEID, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) + ~> #writeMoved + => #setLocalValue(place(local(I), .ProjectionElems), #buildUpdate(Moved, CONTEXTS)) + ... + + + FRAMEID + LOCALS + ... + + requires 0 <=Int I andBool I #traverseProjection(toFrame(FRAMEID, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) ~> #writeProjection(NEW) => .K ... - STACK - => STACK[(FRAME -Int 1) <- - #updateStackLocal( - {STACK[FRAME -Int 1]}:>StackFrame, - I, - #adjustRef(#buildUpdate(NEW, CONTEXTS), 0 -Int FRAME) - ) - ] - - requires 0 + CURRENT_FRAME_ID + ... + + STACK => #updateStackLocalByFrameId(STACK, FRAMEID, I, #buildUpdate(NEW, CONTEXTS)) + requires FRAMEID =/=Int CURRENT_FRAME_ID + andBool #stackFrameHasTypedLocal(FRAMEID, I, STACK) + [preserves-definedness] // valid context ensured upon context construction - rule #traverseProjection(toStack(FRAME, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) + rule #traverseProjection(toFrame(FRAMEID, local(I)), _ORIGINAL, .ProjectionElems, CONTEXTS) ~> #writeMoved => .K ... - STACK - => STACK[(FRAME -Int 1) <- - #updateStackLocal( - {STACK[FRAME -Int 1]}:>StackFrame, - I, - #adjustRef(#buildUpdate(Moved, CONTEXTS), 0 -Int FRAME) - ) // TODO retain Ty and Mutability from _ORIGINAL - ] - - requires 0 + CURRENT_FRAME_ID + ... + + STACK => #updateStackLocalByFrameId(STACK, FRAMEID, I, #buildUpdate(Moved, CONTEXTS)) + requires FRAMEID =/=Int CURRENT_FRAME_ID + andBool #stackFrameHasTypedLocal(FRAMEID, I, STACK) + [preserves-definedness] // valid context ensured upon context construction // allocations should not be written to, therefore no rule for `toAlloc` ``` @@ -311,7 +331,7 @@ These helpers mark down, as we traverse the projection, what `Place` we are curr ```k // stores the target of the write operation, which may change when references are dereferenced. syntax WriteTo ::= toLocal ( Int ) - | toStack ( Int , Local ) + | toFrame ( Int , Local ) | toAlloc ( AllocId ) // retains information about the value that was deconstructed by a projection @@ -362,13 +382,17 @@ These helpers mark down, as we traverse the projection, what `Place` we are curr syntax StackFrame ::= #updateStackLocal ( StackFrame, Int, Value ) [function] - rule #updateStackLocal(StackFrame(CALLER, DEST, TARGET, UNWIND, LOCALS), I, VAL) - => StackFrame(CALLER, DEST, TARGET, UNWIND, LOCALS[I <- typedValue(VAL, tyOfLocal(getLocal(LOCALS, I)), mutabilityMut)]) + rule #updateStackLocal(StackFrame(FRAMEID, CALLER, DEST, TARGET, UNWIND, LOCALS), I, VAL) + => StackFrame(FRAMEID, CALLER, DEST, TARGET, UNWIND, LOCALS[I <- typedValue(VAL, tyOfLocal(getLocal(LOCALS, I)), mutabilityMut)]) requires 0 <=Int I andBool I FRAMEID + syntax ProjectionElems ::= appendP ( ProjectionElems , ProjectionElems ) [function, total] syntax ProjectionElems ::= appendP ( ProjectionElems , ProjectionElems ) [function, total] | consP ( ProjectionElem , ProjectionElems ) [function, total] @@ -390,40 +414,69 @@ These helpers mark down, as we traverse the projection, what `Place` we are curr rule consP(projectionElemToZST, projectionElemFromZST PS:ProjectionElems) => PS [priority(40)] rule consP(projectionElemFromZST, projectionElemToZST PS:ProjectionElems) => PS [priority(40)] - syntax Value ::= #localFromFrame ( StackFrame, Local, Int ) [function] + syntax Bool ::= #stackFrameHasTypedLocal ( Int, Int, List ) [function, total] + // ------------------------------------------------------------------------- + rule #stackFrameHasTypedLocal(FRAMEID, I, ListItem(StackFrame(FRAMEID, _, _, _, _, LOCALS)) _) + => false + requires I isTypedValue(LOCALS[I]) + requires 0 <=Int I andBool I #stackFrameHasTypedLocal(FRAMEID, I, REST) + requires FRAMEID =/=Int OTHER + rule #stackFrameHasTypedLocal(_, _, _) => false [owise] - rule #localFromFrame(StackFrame(... locals: LOCALS), local(I:Int), OFFSET) => #adjustRef(getValue(LOCALS, I), OFFSET) + syntax Value ::= #stackFrameLocalById ( Int, Int, List ) [function] + // --------------------------------------------------------------- + rule #stackFrameLocalById(FRAMEID, I, ListItem(StackFrame(FRAMEID, _, _, _, _, LOCALS)) _) + => getValue(LOCALS, I) requires 0 <=Int I andBool I #stackFrameLocalById(FRAMEID, I, REST) + requires FRAMEID =/=Int OTHER - syntax Value ::= #adjustRef (Value, Int ) [function, total] - // -------------------------------------------------------- - rule #adjustRef(Reference(HEIGHT, PLACE, REFMUT, META), OFFSET) - => Reference(HEIGHT +Int OFFSET, PLACE, REFMUT, META) - rule #adjustRef(PtrLocal(HEIGHT, PLACE, REFMUT, META), OFFSET) - => PtrLocal(HEIGHT +Int OFFSET, PLACE, REFMUT, META) - rule #adjustRef(Aggregate(IDX, ARGS), OFFSET) - => Aggregate(IDX, #mapOffset(ARGS, OFFSET)) - rule #adjustRef(Range(ELEMS), OFFSET) - => Range(#mapOffset(ELEMS, OFFSET)) - rule #adjustRef(TL, _) => TL [owise] - - syntax List ::= #mapOffset ( List, Int ) [function, total] - // ------------------------------------------------------- - rule #mapOffset(.List, _) - => .List - rule #mapOffset(ListItem(ELEM:Value) REST, OFFSET) - => ListItem(#adjustRef(ELEM, OFFSET)) #mapOffset(REST, OFFSET) - rule #mapOffset(OTHER, _) - => OTHER [owise] // should not happen - - syntax Value ::= #incrementRef ( Value ) [function, total] - | #decrementRef ( Value ) [function, total] - // -------------------------------------------------------- - rule #incrementRef(TL) => #adjustRef(TL, 1) - rule #decrementRef(TL) => #adjustRef(TL, -1) + syntax List ::= #updateStackLocalByFrameId ( List, Int, Int, Value ) [function] + // ---------------------------------------------------------------------------- + rule #updateStackLocalByFrameId(ListItem(FRAME:StackFrame) REST, FRAMEID, I, VAL) + => ListItem(#updateStackLocal(FRAME, I, VAL)) REST + requires frameIdOf(FRAME) ==Int FRAMEID + rule #updateStackLocalByFrameId(ListItem(FRAME:StackFrame) REST, FRAMEID, I, VAL) + => ListItem(FRAME) #updateStackLocalByFrameId(REST, FRAMEID, I, VAL) + requires frameIdOf(FRAME) =/=Int FRAMEID + rule #updateStackLocalByFrameId(.List, _, _, _) => .List + + syntax Bool ::= #localInFrameId ( Int, Int, Int, List, List ) [function, total] + // --------------------------------------------------------------------------- + rule #localInFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, _STACK) + => false + requires FRAMEID ==Int CURRENT_FRAME_ID + andBool (I isTypedValue(LOCALS[I]) + requires FRAMEID ==Int CURRENT_FRAME_ID + andBool 0 <=Int I + andBool I #stackFrameHasTypedLocal(FRAMEID, I, STACK) + requires FRAMEID =/=Int CURRENT_FRAME_ID + + syntax Value ::= #localFromFrameId ( Int, Int, Int, List, List ) [function] + // ------------------------------------------------------------------------- + rule #localFromFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, _STACK) + => getValue(LOCALS, I) + requires FRAMEID ==Int CURRENT_FRAME_ID + andBool 0 <=Int I + andBool I #stackFrameLocalById(FRAMEID, I, STACK) + requires FRAMEID =/=Int CURRENT_FRAME_ID + andBool #stackFrameHasTypedLocal(FRAMEID, I, STACK) syntax Int ::= originSize ( MetadataSize ) [function, total] // --------------------------------------------------------------------- @@ -669,11 +722,11 @@ Similar to `ConstantIndex`, the slice _end_ index may count from the _end_ or t #### References -A `Deref` projection operates on `Reference`s or pointers (`PtrLocal`) that refer to locals in the same or -an enclosing stack frame, indicated by the stack height in the value. +A `Deref` projection operates on `Reference`s or pointers (`PtrLocal`) that refer to locals in the current +stack frame or another live stack frame, identified by the frame id stored in the value. `Deref` reads the referred place (and may proceed with further projections). -In the simplest case, the reference refers to a local in the same stack frame (height 0), which is directly read. -If the offset height is greater than zero, the stack element is accessed. +If the stored frame id matches the current frame, the local is read directly. +Otherwise the target frame is found in the stack by its id. Pointers and references may carry metadata indicating a _size_ (`dynamicSize`). If present, the `Deref` is expected to access a _slice_ and the size determines how many elements are read from it. @@ -716,185 +769,109 @@ An attempt to read more elements than the length of the accessed array is undefi [preserves-definedness] - // Ref, 0 < OFFSET, 0 < PTR_OFFSET, ToStack + // Ref, frame id, 0 < PTR_OFFSET rule #traverseProjection( _DEST, - Reference(OFFSET, place(LOCAL, PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), + Reference(FRAMEID, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), projectionElemDeref PROJS, _CTXTS ) => #traverseProjection( - toStack(OFFSET, LOCAL), - #localFromFrame({STACK[OFFSET -Int 1]}:>StackFrame, LOCAL, OFFSET), - appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), // apply reference projections with pointer offset + toFrame(FRAMEID, local(I)), + #localFromFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK), + appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), .Contexts ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections + ~> #derefTruncate(SIZE, PROJS) ... - STACK - requires 0 + CURRENT_FRAME_ID + LOCALS + ... + + STACK + requires #localInFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK) andBool 0 #traverseProjection( _DEST, - Reference(OFFSET, place(LOCAL, PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), + Reference(FRAMEID, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), projectionElemDeref PROJS, _CTXTS ) => #traverseProjection( - toStack(OFFSET, LOCAL), - #localFromFrame({STACK[OFFSET -Int 1]}:>StackFrame, LOCAL, OFFSET), - PLACEPROJ, // apply reference projections with pointer offset + toFrame(FRAMEID, local(I)), + #localFromFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK), + PLACEPROJ, .Contexts ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections + ~> #derefTruncate(SIZE, PROJS) ... - STACK - requires 0 + CURRENT_FRAME_ID + LOCALS + ... + + STACK + requires #localInFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK) andBool PTR_OFFSET ==Int 0 [preserves-definedness] - // Ref, 0 == OFFSET, 0 < PTR_OFFSET, Local + // Ptr, frame id, 0 < PTR_OFFSET rule #traverseProjection( _DEST, - Reference(OFFSET, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), + PtrLocal(FRAMEID, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), projectionElemDeref PROJS, _CTXTS ) => #traverseProjection( - toLocal(I), - getValue(LOCALS, I), - appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), // apply reference projections with pointer offset + toFrame(FRAMEID, local(I)), + #localFromFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK), + appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), .Contexts ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections + ~> #derefTruncate(SIZE, PROJS) ... - LOCALS - requires OFFSET ==Int 0 - andBool 0 <=Int I andBool I + CURRENT_FRAME_ID + LOCALS + ... + + STACK + requires #localInFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK) andBool 0 #traverseProjection( _DEST, - Reference(OFFSET, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), + PtrLocal(FRAMEID, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), projectionElemDeref PROJS, _CTXTS ) => #traverseProjection( - toLocal(I), - getValue(LOCALS, I), + toFrame(FRAMEID, local(I)), + #localFromFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK), PLACEPROJ, .Contexts ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections - ... - - LOCALS - requires OFFSET ==Int 0 - andBool 0 <=Int I andBool I #traverseProjection( - _DEST, - PtrLocal(OFFSET, place(LOCAL, PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), - projectionElemDeref PROJS, - _CTXTS - ) - => #traverseProjection( - toStack(OFFSET, LOCAL), - #localFromFrame({STACK[OFFSET -Int 1]}:>StackFrame, LOCAL, OFFSET), - appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), // apply reference projections with pointer offset - .Contexts // previous contexts obsolete - ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections - ... - - STACK - requires 0 #traverseProjection( - _DEST, - PtrLocal(OFFSET, place(LOCAL, PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), - projectionElemDeref PROJS, - _CTXTS - ) - => #traverseProjection( - toStack(OFFSET, LOCAL), - #localFromFrame({STACK[OFFSET -Int 1]}:>StackFrame, LOCAL, OFFSET), - PLACEPROJ, // apply reference projections - .Contexts // add pointer offset context - ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections + ~> #derefTruncate(SIZE, PROJS) ... - STACK - requires 0 + CURRENT_FRAME_ID + LOCALS + ... + + STACK + requires #localInFrameId(FRAMEID, I, CURRENT_FRAME_ID, LOCALS, STACK) andBool PTR_OFFSET ==Int 0 [preserves-definedness] - - // Ptr, 0 == OFFSET, 0 < PTR_OFFSET, Local - rule #traverseProjection( - _DEST, - PtrLocal(OFFSET, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, ORIGIN_SIZE)), - projectionElemDeref PROJS, - _CTXTS - ) - => #traverseProjection( - toLocal(I), - getValue(LOCALS, I), - appendP(PLACEPROJ, PointerOffset(PTR_OFFSET, originSize(ORIGIN_SIZE))), // apply reference projections with pointer offset - .Contexts // previous contexts obsolete - ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections - ... - - LOCALS - requires OFFSET ==Int 0 - andBool 0 <=Int I andBool I #traverseProjection( - _DEST, - PtrLocal(OFFSET, place(local(I), PLACEPROJ), _MUT, metadata(SIZE, PTR_OFFSET, _ORIGIN_SIZE)), - projectionElemDeref PROJS, - _CTXTS - ) - => #traverseProjection( - toLocal(I), - getValue(LOCALS, I), - PLACEPROJ, // apply reference projections - .Contexts // add pointer offset context - ) - ~> #derefTruncate(SIZE, PROJS) // then truncate, then continue with remaining projections - ... - - LOCALS - requires OFFSET ==Int 0 - andBool 0 <=Int I andBool I ` heap which is populated with allocated constants. @@ -1258,7 +1235,7 @@ This eliminates any `Deref` projections from the place, and also resolves `Index syntax KItem ::= #forRef( Mutability , Metadata ) - // once traversal is finished, reconstruct the last projections and the reference offset/local, and possibly read the size + // once traversal is finished, reconstruct the last projections and the reference frame/local, and possibly read the size rule #traverseProjection(DEST, VAL:Value, .ProjectionElems, CTXTS) ~> #forRef(MUT, metadata(SIZE, OFFSET, ORIGIN_SIZE)) => #mkRef(DEST, #projectionsFor(CTXTS), MUT, metadata(#maybeDynamicSize(SIZE, VAL), OFFSET, ORIGIN_SIZE) ) ... @@ -1266,11 +1243,15 @@ This eliminates any `Deref` projections from the place, and also resolves `Index syntax Evaluation ::= #mkRef( WriteTo , ProjectionElems , Mutability , Metadata ) // [function, total] // ----------------------------------------------------------------------------------------------- - // Create Reference for local variable (stack depth 0, no offset) - rule #mkRef( toLocal(I) , PROJS, MUT, META) => Reference( 0 , place(local(I), PROJS), MUT, META) ... + // Create Reference for local variable in the current frame + rule #mkRef(toLocal(I), PROJS, MUT, META) => Reference(CURRENT_FRAME_ID, place(local(I), PROJS), MUT, META) ... + + CURRENT_FRAME_ID + ... + - // Create Reference for stack frame variable (stack depth OFFSET, with pointer offset) - rule #mkRef(toStack(OFFSET, LOCAL), PROJS, MUT, META) => Reference(OFFSET, place( LOCAL , PROJS), MUT, META) ... + // Create Reference for a local variable in another frame + rule #mkRef(toFrame(FRAMEID, LOCAL), PROJS, MUT, META) => Reference(FRAMEID, place(LOCAL, PROJS), MUT, META) ... // Create AllocRef for heap allocation (assumed zero offset, no offset concept for heap) rule #mkRef(toAlloc(ALLOC_ID) , PROJS, _ , META) => AllocRef(ALLOC_ID, PROJS, META) ... @@ -1316,7 +1297,7 @@ The operation typically creates a pointer with empty metadata. andBool isTypedValue(LOCALS[I]) [preserves-definedness] // valid list indexing checked, #metadataSize should only use static information - // once traversal is finished, reconstruct the last projections and the reference offset/local, and possibly read the size + // once traversal is finished, reconstruct the last projections and the pointer frame/local, and possibly read the size rule #traverseProjection(DEST, VAL:Value, .ProjectionElems, CTXTS) ~> #forPtr(MUT, metadata(SIZE, OFFSET, ORIGIN_SIZE)) => #mkPtr(DEST, #projectionsFor(CTXTS), MUT, metadata(#maybeDynamicSize(SIZE, VAL), OFFSET, ORIGIN_SIZE)) ... @@ -1324,8 +1305,12 @@ The operation typically creates a pointer with empty metadata. syntax Evaluation ::= #mkPtr ( WriteTo, ProjectionElems, Mutability , Metadata ) // [function, total] // ------------------------------------------------------------------------------------------ - rule #mkPtr( toLocal(I) , PROJS, MUT, META) => PtrLocal( 0 , place(local(I), PROJS), MUT, META) ... - rule #mkPtr(toStack(STACK_OFFSET, LOCAL), PROJS, MUT, META) => PtrLocal(STACK_OFFSET, place( LOCAL , PROJS), MUT, META) ... + rule #mkPtr(toLocal(I), PROJS, MUT, META) => PtrLocal(CURRENT_FRAME_ID, place(local(I), PROJS), MUT, META) ... + + CURRENT_FRAME_ID + ... + + rule #mkPtr(toFrame(FRAMEID, LOCAL), PROJS, MUT, META) => PtrLocal(FRAMEID, place(LOCAL, PROJS), MUT, META) ... ``` In practice, the `AddressOf` can often be found applied to references that get dereferenced first, @@ -1353,7 +1338,7 @@ a special rule for this case is applied with higher priority. syntax Value ::= refToPtrLocal ( Value , Mutability ) [function] - rule refToPtrLocal(Reference(STACK_OFFSET, PLACE, _, META), MUT) => PtrLocal(STACK_OFFSET, PLACE, MUT, META) + rule refToPtrLocal(Reference(FRAMEID, PLACE, _, META), MUT) => PtrLocal(FRAMEID, PLACE, MUT, META) ``` ## Type casts diff --git a/kmir/src/kmir/kdist/mir-semantics/rt/value.md b/kmir/src/kmir/kdist/mir-semantics/rt/value.md index 676784869..f6360db72 100644 --- a/kmir/src/kmir/kdist/mir-semantics/rt/value.md +++ b/kmir/src/kmir/kdist/mir-semantics/rt/value.md @@ -44,13 +44,13 @@ The special `Moved` value represents values that have been used and should not b // value, bit-width for f16-f128 | Reference( Int , Place , Mutability , Metadata ) [symbol(Value::Reference)] - // stack depth (initially 0), place, borrow kind, metadata (size, pointer offset, origin size) + // frame id, place, borrow kind, metadata (size, pointer offset, origin size) | Range( List ) [symbol(Value::Range)] // homogenous values for array/slice | PtrLocal( Int , Place , Mutability, Metadata ) [symbol(Value::PtrLocal)] // pointer to a local TypedValue (on the stack) - // fields are the same as in Reference + // fields are the same as in Reference; the Int is the target frame id | FunPtr ( Ty ) // function pointer, created by operandConstant only. Ty is a key in the function table | AllocRef ( AllocId , ProjectionElems , Metadata ) diff --git a/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::a_module::twice.expected b/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::a_module::twice.expected index 2609e8676..c8c65b003 100644 --- a/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::a_module::twice.expected +++ b/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::a_module::twice.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ │ (44 steps) ├─ 3 (split) diff --git a/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::main.expected b/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::main.expected index 3edeb4f48..34f6b2b5b 100644 --- a/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::main.expected +++ b/kmir/src/tests/integration/data/crate-tests/single-bin/single_exe::main.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ │ (228 steps) ├─ 3 (terminal) diff --git a/kmir/src/tests/integration/data/crate-tests/single-dylib/small_test_dylib::add.expected b/kmir/src/tests/integration/data/crate-tests/single-dylib/small_test_dylib::add.expected index 76fa2d153..4b5a9b765 100644 --- a/kmir/src/tests/integration/data/crate-tests/single-dylib/small_test_dylib::add.expected +++ b/kmir/src/tests/integration/data/crate-tests/single-dylib/small_test_dylib::add.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ │ (35 steps) ├─ 3 (split) diff --git a/kmir/src/tests/integration/data/crate-tests/single-lib/small_test_lib::testing::test_add_in_range.expected b/kmir/src/tests/integration/data/crate-tests/single-lib/small_test_lib::testing::test_add_in_range.expected index 3cb67eec2..345099ef1 100644 --- a/kmir/src/tests/integration/data/crate-tests/single-lib/small_test_lib::testing::test_add_in_range.expected +++ b/kmir/src/tests/integration/data/crate-tests/single-lib/small_test_lib::testing::test_add_in_range.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ │ (114 steps) ├─ 3 (split) diff --git a/kmir/src/tests/integration/data/crate-tests/two-crate-bin/crate2::main.expected b/kmir/src/tests/integration/data/crate-tests/two-crate-bin/crate2::main.expected index 544958705..c708a582e 100644 --- a/kmir/src/tests/integration/data/crate-tests/two-crate-bin/crate2::main.expected +++ b/kmir/src/tests/integration/data/crate-tests/two-crate-bin/crate2::main.expected @@ -1,8 +1,9 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ -│ (737 steps) +│ (736 steps) ├─ 3 (terminal) │ #EndProgram ~> .K │ diff --git a/kmir/src/tests/integration/data/crate-tests/two-crate-dylib/crate2::test_crate1_with.expected b/kmir/src/tests/integration/data/crate-tests/two-crate-dylib/crate2::test_crate1_with.expected index bd3076868..a26327334 100644 --- a/kmir/src/tests/integration/data/crate-tests/two-crate-dylib/crate2::test_crate1_with.expected +++ b/kmir/src/tests/integration/data/crate-tests/two-crate-dylib/crate2::test_crate1_with.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ │ (216 steps) ├─ 3 (terminal) diff --git a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state index 09d56cea7..24a94840d 100644 --- a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state +++ b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic-unchecked-runs.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueCheckedBinaryOp ( binOpAdd , operandConstant ( constOperand (... span: span ( 101 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 14 ) ) ) ) , operandConstant ( constOperand (... span: span ( 102 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 14 ) ) ) ) ) ) , span: span ( 103 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 21 ) ) .ProjectionElems ) ) , expected: false , msg: assertMessageOverflow ( binOpAdd , operandConstant ( constOperand (... span: span ( 101 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 14 ) ) ) ) , operandConstant ( constOperand (... span: span ( 102 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 14 ) ) ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 103 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 9 ) ) .ProjectionElems ) ) ) ) , span: span ( 103 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 104 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 33 ) , id: mirConstId ( 15 ) ) ) ) , args: operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) operandConstant ( constOperand (... span: span ( 105 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 16 ) ) ) ) .Operands , destination: place (... local: local ( 3 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionContinue ) , span: span ( 106 ) ) ) ) @@ -52,6 +55,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic.state b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic.state index a2940d22a..df58a6735 100644 --- a/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic.state +++ b/kmir/src/tests/integration/data/exec-smir/arithmetic/arithmetic.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueCheckedBinaryOp ( binOpAdd , operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 9 ) ) ) ) , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 25 ) ) .ProjectionElems ) ) , expected: false , msg: assertMessageOverflow ( binOpAdd , operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 9 ) ) ) ) , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 10 ) ) ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 52 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 9 ) ) .ProjectionElems ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueCheckedBinaryOp ( binOpSub , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\xff" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 4 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 25 ) ) .ProjectionElems ) ) , expected: false , msg: assertMessageOverflow ( binOpSub , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\xff" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 11 ) ) ) ) ) , target: basicBlockIdx ( 2 ) , unwind: unwindActionContinue ) , span: span ( 54 ) ) ) ) @@ -65,6 +68,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/arithmetic/unary.state b/kmir/src/tests/integration/data/exec-smir/arithmetic/unary.state index 97333b1b7..90183a929 100644 --- a/kmir/src/tests/integration/data/exec-smir/arithmetic/unary.state +++ b/kmir/src/tests/integration/data/exec-smir/arithmetic/unary.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueCheckedBinaryOp ( binOpAdd , operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 9 ) ) ) ) , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 25 ) ) .ProjectionElems ) ) , expected: false , msg: assertMessageOverflow ( binOpAdd , operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x7f" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 9 ) ) ) ) , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 10 ) ) ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 52 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandMove ( place (... local: local ( 2 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 9 ) ) .ProjectionElems ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUnaryOp ( unOpNot , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUnaryOp ( unOpNot , operandConstant ( constOperand (... span: span ( 55 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x85" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 56 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueUnaryOp ( unOpNot , operandConstant ( constOperand (... span: span ( 57 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 12 ) ) ) ) ) ) , span: span ( 58 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 13 ) ) ) ) ) ) , span: span ( 53 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) , expected: false , msg: assertMessageOverflowNeg ( operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 2 ) , unwind: unwindActionContinue ) , span: span ( 53 ) ) ) ) @@ -39,6 +42,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state b/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state index d905964fc..713689dda 100644 --- a/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state +++ b/kmir/src/tests/integration/data/exec-smir/arrays/array_indexing.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueRepeat ( operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 2 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 9 ) ) ) ) , tyConst (... kind: tyConstKindValue ( ty ( 25 ) , allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , id: tyConstId ( 0 ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 53 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 50 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 50 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 50 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemIndex ( local ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 50 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , ty ( 25 ) ) ) , span: span ( 55 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 8 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 8 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 2 ) , unwind: unwindActionContinue ) , span: span ( 54 ) ) ) ) @@ -47,6 +50,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/arrays/array_inlined.state b/kmir/src/tests/integration/data/exec-smir/arrays/array_inlined.state index 7e5876270..7ed04ce91 100644 --- a/kmir/src/tests/integration/data/exec-smir/arrays/array_inlined.state +++ b/kmir/src/tests/integration/data/exec-smir/arrays/array_inlined.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 91 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\xfe\x03" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) , ty: ty ( 40 ) , id: mirConstId ( 16 ) ) ) ) ) ) , span: span ( 91 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 92 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 41 ) , id: mirConstId ( 17 ) ) ) ) ) ) , span: span ( 92 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x03\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 41 ) , id: mirConstId ( 18 ) ) ) ) ) ) , span: span ( 90 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 90 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 90 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemIndex ( local ( 4 ) ) .ProjectionElems ) ) ) ) , span: span ( 90 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 94 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\xfe\x03" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityNot ) ) , ty: ty ( 40 ) , id: mirConstId ( 16 ) ) ) ) ) ) , span: span ( 94 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 95 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 41 ) , id: mirConstId ( 19 ) ) ) ) ) ) , span: span ( 95 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x03\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 41 ) , id: mirConstId ( 18 ) ) ) ) ) ) , span: span ( 93 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 11 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 93 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 11 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 2 ) , unwind: unwindActionContinue ) , span: span ( 93 ) ) ) ) @@ -90,6 +93,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state b/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state index 861180b8d..1bac76c33 100644 --- a/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state +++ b/kmir/src/tests/integration/data/exec-smir/arrays/array_write.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueRepeat ( operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 2 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 9 ) ) ) ) , tyConst (... kind: tyConstKindValue ( ty ( 25 ) , allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , id: tyConstId ( 0 ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 53 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 50 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 50 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 1 ) , unwind: unwindActionContinue ) , span: span ( 50 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: projectionElemIndex ( local ( 2 ) ) .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 55 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x02\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 2 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 12 ) ) ) ) ) ) , span: span ( 56 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 57 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 13 ) ) ) ) ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x04\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpLt , operandCopy ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: assert (... cond: operandMove ( place (... local: local ( 8 ) , projection: .ProjectionElems ) ) , expected: true , msg: assertMessageBoundsCheck (... len: operandMove ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) , index: operandCopy ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) ) , target: basicBlockIdx ( 2 ) , unwind: unwindActionContinue ) , span: span ( 54 ) ) ) ) @@ -56,6 +59,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/assign-cast/assign-cast.state b/kmir/src/tests/integration/data/exec-smir/assign-cast/assign-cast.state index b2f9a3ef5..de50b6d04 100644 --- a/kmir/src/tests/integration/data/exec-smir/assign-cast/assign-cast.state +++ b/kmir/src/tests/integration/data/exec-smir/assign-cast/assign-cast.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x80\x80" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 2 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , ty ( 2 ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , ty ( 26 ) ) ) , span: span ( 53 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) , ty ( 16 ) ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , ty ( 26 ) ) ) , span: span ( 55 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , ty ( 27 ) ) ) , span: span ( 56 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , ty ( 2 ) ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , ty ( 2 ) ) ) , span: span ( 58 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , ty ( 25 ) ) ) , span: span ( 59 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , ty ( 28 ) ) ) , span: span ( 60 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 11 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , ty ( 25 ) ) ) , span: span ( 61 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , ty ( 29 ) ) ) , span: span ( 62 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 13 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , ty ( 9 ) ) ) , span: span ( 63 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 14 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , ty ( 9 ) ) ) , span: span ( 64 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 15 ) , projection: .ProjectionElems ) , rvalue: rvalueCast ( castKindIntToInt , operandCopy ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , ty ( 28 ) ) ) , span: span ( 65 ) ) .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) @@ -44,6 +47,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/call-with-args/closure-call.state b/kmir/src/tests/integration/data/exec-smir/call-with-args/closure-call.state index db13358c2..dcc12d5ac 100644 --- a/kmir/src/tests/integration/data/exec-smir/call-with-args/closure-call.state +++ b/kmir/src/tests/integration/data/exec-smir/call-with-args/closure-call.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 57 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b" \x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindTuple , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) .Operands ) ) , span: span ( 58 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 55 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 27 ) , id: mirConstId ( 9 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 3 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 56 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 4 ) , projection: .ProjectionElems ) ) ) , span: span ( 59 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindTuple , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) .Operands ) ) , span: span ( 60 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 59 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 28 ) , id: mirConstId ( 11 ) ) ) ) , args: operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) operandMove ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 5 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionContinue ) , span: span ( 60 ) ) ) ) @@ -46,6 +49,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/call-with-args/main-a-b-with-int.state b/kmir/src/tests/integration/data/exec-smir/call-with-args/main-a-b-with-int.state index 056091d15..dfd1b5746 100644 --- a/kmir/src/tests/integration/data/exec-smir/call-with-args/main-a-b-with-int.state +++ b/kmir/src/tests/integration/data/exec-smir/call-with-args/main-a-b-with-int.state @@ -9,6 +9,9 @@ ty ( 27 ) + + 2 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 63 ) ) ) ) @@ -31,9 +34,9 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 1 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 10 , 64 , false ) , ty ( 26 ) , mutabilityNot ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/enum/enum.state b/kmir/src/tests/integration/data/exec-smir/enum/enum.state index 16e4c197d..15d57aae2 100644 --- a/kmir/src/tests/integration/data/exec-smir/enum/enum.state +++ b/kmir/src/tests/integration/data/exec-smir/enum/enum.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 7 ) , variantIdx ( 0 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , .Operands ) ) , span: span ( 51 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 8 ) , variantIdx ( 0 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , .Operands ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 8 ) , variantIdx ( 1 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 16 ) , id: mirConstId ( 9 ) ) ) ) .Operands ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 8 ) , variantIdx ( 2 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandConstant ( constOperand (... span: span ( 55 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 2 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 10 ) ) ) ) operandConstant ( constOperand (... span: span ( 56 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 11 ) ) ) ) .Operands ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 8 ) , variantIdx ( 3 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandConstant ( constOperand (... span: span ( 58 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 12 ) ) ) ) operandConstant ( constOperand (... span: span ( 59 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"+" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 13 ) ) ) ) operandConstant ( constOperand (... span: span ( 60 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 14 ) ) ) ) .Operands ) ) , span: span ( 61 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueDiscriminant ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) ) , span: span ( 62 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 89 , basicBlockIdx ( 1 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 50 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 2 ) , projection: projectionElemDowncast ( variantIdx ( 1 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 16 ) ) .ProjectionElems ) ) ) ) , span: span ( 64 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 8 ) , variantIdx ( 1 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandCopy ( place (... local: local ( 8 ) , projection: .ProjectionElems ) ) .Operands ) ) , span: span ( 65 ) ) .Statements , terminator: terminator (... kind: terminatorKindGoto (... target: basicBlockIdx ( 2 ) ) , span: span ( 63 ) ) ) ) @@ -53,6 +56,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.run.state b/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.run.state index 596624cb4..e63deca64 100644 --- a/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.run.state +++ b/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.run.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) , args: .Operands , destination: place (... local: local ( 0 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 51 ) ) ) ) ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 52 ) ) ) ) @@ -30,6 +33,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.state b/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.state index a8b20314b..4bb6718f7 100644 --- a/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.state +++ b/kmir/src/tests/integration/data/exec-smir/main-a-b-c/main-a-b-c.state @@ -9,6 +9,9 @@ ty ( 27 ) + + 3 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 65 ) ) ) ) @@ -29,9 +32,9 @@ - ListItem ( StackFrame ( ty ( 25 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 2 , ty ( 25 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) + ListItem ( StackFrame ( 1 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/niche-enum/niche-enum.state b/kmir/src/tests/integration/data/exec-smir/niche-enum/niche-enum.state index 2f67853c8..00732e036 100644 --- a/kmir/src/tests/integration/data/exec-smir/niche-enum/niche-enum.state +++ b/kmir/src/tests/integration/data/exec-smir/niche-enum/niche-enum.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 100 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 47 ) , id: mirConstId ( 19 ) ) ) ) , args: operandConstant ( constOperand (... span: span ( 101 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 9 ) , id: mirConstId ( 20 ) ) ) ) .Operands , destination: place (... local: local ( 3 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 102 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 104 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 105 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: provenanceMapEntry (... offset: 0 , allocId: allocId ( 2 ) ) .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 22 ) ) ) ) ) ) , span: span ( 105 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindTuple , operandMove ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) .Operands ) ) , span: span ( 106 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 25 ) ) .ProjectionElems ) ) ) ) , span: span ( 107 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 25 ) ) .ProjectionElems ) ) ) ) , span: span ( 108 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 103 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 48 ) , id: mirConstId ( 21 ) ) ) ) , args: operandCopy ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) operandCopy ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 7 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 2 ) ) , unwind: unwindActionContinue ) , span: span ( 103 ) ) ) ) @@ -74,6 +77,15 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + + .Map + + + 4096 + + + .Set + \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state b/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state index de694867d..dd22dfe2c 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state +++ b/kmir/src/tests/integration/data/exec-smir/references/doubleRef.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 69 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 11 ) ) ) ) ) ) , span: span ( 69 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 70 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 2 ) , projection: .ProjectionElems ) ) ) , span: span ( 71 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 13 ) , projection: .ProjectionElems ) , rvalue: rvalueCopyForDeref ( place (... local: local ( 3 ) , projection: projectionElemDeref .ProjectionElems ) ) ) , span: span ( 72 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 13 ) , projection: projectionElemDeref .ProjectionElems ) ) ) ) , span: span ( 72 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 68 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 68 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 74 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 11 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 75 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 11 ) , projection: .ProjectionElems ) ) ) , span: span ( 76 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) , span: span ( 76 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 73 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 31 ) , id: mirConstId ( 12 ) ) ) ) , args: operandMove ( place (... local: local ( 8 ) , projection: .ProjectionElems ) ) operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 7 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 3 ) ) , unwind: unwindActionContinue ) , span: span ( 73 ) ) ) ) @@ -47,6 +50,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state b/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state index 951a10279..3f483eaca 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state +++ b/kmir/src/tests/integration/data/exec-smir/references/mutableRef.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindDefault ) , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 53 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) , args: operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 51 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 55 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 32 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 54 ) ) ) ) @@ -42,6 +45,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state b/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state index 043aae9d7..b3a1468f2 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refAsArg.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 53 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) , args: operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 51 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 54 ) ) ) ) @@ -37,6 +40,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state b/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state index 043aae9d7..b3a1468f2 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refAsArg2.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 53 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) , args: operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 51 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 54 ) ) ) ) @@ -37,6 +40,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/refReturned.state b/kmir/src/tests/integration/data/exec-smir/references/refReturned.state index 7301205f2..20585c996 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/refReturned.state +++ b/kmir/src/tests/integration/data/exec-smir/references/refReturned.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 10 ) ) ) ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 53 ) ) .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 50 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 25 ) , id: mirConstId ( 9 ) ) ) ) , args: operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 2 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 51 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 2 ) , projection: projectionElemDeref .ProjectionElems ) ) ) ) , span: span ( 55 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 54 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 54 ) ) ) ) @@ -38,6 +41,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/simple.state b/kmir/src/tests/integration/data/exec-smir/references/simple.state index 86f6e5353..0f7d5f230 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/simple.state +++ b/kmir/src/tests/integration/data/exec-smir/references/simple.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 9 ) ) ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 52 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 2 ) , projection: projectionElemDeref .ProjectionElems ) ) ) ) , span: span ( 53 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpEq , operandCopy ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , operandCopy ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 50 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 50 ) ) ) ) ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 54 ) ) ) ) @@ -36,6 +39,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state b/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state index 454f37867..5e3395cb7 100644 --- a/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state +++ b/kmir/src/tests/integration/data/exec-smir/references/weirdRefs.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 7 ) , variantIdx ( 0 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b" " , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 9 ) ) ) ) operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 10 ) ) ) ) operandConstant ( constOperand (... span: span ( 53 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b" \x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 11 ) ) ) ) .Operands ) ) , span: span ( 54 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindDefault ) , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) ) ) , span: span ( 55 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: projectionElemDeref .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 56 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"*" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 12 ) ) ) ) ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) ) ) ) , span: span ( 58 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 42 , basicBlockIdx ( 1 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 50 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindDefault ) , place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) ) ) , span: span ( 60 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindDefault ) , place (... local: local ( 5 ) , projection: .ProjectionElems ) ) ) , span: span ( 61 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 20 ) , projection: .ProjectionElems ) , rvalue: rvalueCopyForDeref ( place (... local: local ( 6 ) , projection: projectionElemDeref .ProjectionElems ) ) ) , span: span ( 62 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 20 ) , projection: projectionElemDeref .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 63 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"+" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 2 ) , id: mirConstId ( 13 ) ) ) ) ) ) , span: span ( 62 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 2 ) ) .ProjectionElems ) ) ) ) , span: span ( 64 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 7 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 43 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 4 ) ) ) , span: span ( 59 ) ) ) ) @@ -65,6 +68,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/structs-tuples/struct_field_update.state b/kmir/src/tests/integration/data/exec-smir/structs-tuples/struct_field_update.state index bed580f75..eb572e052 100644 --- a/kmir/src/tests/integration/data/exec-smir/structs-tuples/struct_field_update.state +++ b/kmir/src/tests/integration/data/exec-smir/structs-tuples/struct_field_update.state @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 2 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindTuple , operandConstant ( constOperand (... span: span ( 51 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 16 ) , id: mirConstId ( 9 ) ) ) ) operandConstant ( constOperand (... span: span ( 52 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x02\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 16 ) , id: mirConstId ( 10 ) ) ) ) .Operands ) ) , span: span ( 53 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: .ProjectionElems ) , rvalue: rvalueAggregate ( aggregateKindAdt ( adtDef ( 7 ) , variantIdx ( 0 ) , .GenericArgs , noUserTypeAnnotationIndex , noFieldIdx ) , operandConstant ( constOperand (... span: span ( 54 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\n\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 16 ) , id: mirConstId ( 11 ) ) ) ) operandConstant ( constOperand (... span: span ( 55 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 12 ) ) ) ) operandConstant ( constOperand (... span: span ( 56 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00$@" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 13 ) ) ) ) operandMove ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands ) ) , span: span ( 57 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 25 ) ) .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 58 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x01" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 1 ) , mutability: mutabilityMut ) ) , ty: ty ( 25 ) , id: mirConstId ( 14 ) ) ) ) ) ) , span: span ( 59 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 16 ) ) .ProjectionElems ) ) ) ) , span: span ( 60 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 3 ) , ty ( 27 ) ) projectionElemField ( fieldIdx ( 1 ) , ty ( 16 ) ) .ProjectionElems ) , rvalue: rvalueUse ( operandMove ( place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 61 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 3 ) , ty ( 27 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 16 ) ) .ProjectionElems ) ) ) ) , span: span ( 62 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 16 ) ) .ProjectionElems ) , rvalue: rvalueUse ( operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 63 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 1 ) , projection: projectionElemField ( fieldIdx ( 2 ) , ty ( 26 ) ) .ProjectionElems ) , rvalue: rvalueUse ( operandConstant ( constOperand (... span: span ( 64 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"33333sE@" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 26 ) , id: mirConstId ( 15 ) ) ) ) ) ) , span: span ( 65 ) ) .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) @@ -37,6 +40,6 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/exec-smir/structs-tuples/structs-tuples.state b/kmir/src/tests/integration/data/exec-smir/structs-tuples/structs-tuples.state index e6dc9aec9..26202f22f 100644 --- a/kmir/src/tests/integration/data/exec-smir/structs-tuples/structs-tuples.state +++ b/kmir/src/tests/integration/data/exec-smir/structs-tuples/structs-tuples.state @@ -9,6 +9,9 @@ ty ( 25 ) + + 1 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindReturn , span: span ( 73 ) ) ) ) @@ -32,7 +35,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 1 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 10 , 32 , true ) ) ListItem ( BoolVal ( false ) ) ListItem ( Float ( 0.10000000000000000e2 , 64 ) ) ) , ty ( 28 ) , mutabilityNot ) ) @@ -48,6 +51,6 @@ ListItem ( newLocal ( ty ( 16 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 26 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 27 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , .List ) ) \ No newline at end of file diff --git a/kmir/src/tests/integration/data/modules/test-add-module-multiple.k b/kmir/src/tests/integration/data/modules/test-add-module-multiple.k index eea9602de..6c4029340 100644 --- a/kmir/src/tests/integration/data/modules/test-add-module-multiple.k +++ b/kmir/src/tests/integration/data/modules/test-add-module-multiple.k @@ -12,6 +12,9 @@ module TEST-ADD-MODULE ( CURRENTFUNC_CELL => ty ( -1 ) ) + + 0 + ( _CURRENTBODY_CELL => ListItem ( basicBlock ( ... statements: .Statements , terminator: terminator ( ... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) ) @@ -32,7 +35,7 @@ module TEST-ADD-MODULE - ( .List => ListItem ( StackFrame ( CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) + ( .List => ListItem ( StackFrame ( 0 , CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) [priority(20), label(BASIC-BLOCK-1-TO-3)] diff --git a/kmir/src/tests/integration/data/modules/test-add-module.k b/kmir/src/tests/integration/data/modules/test-add-module.k index fe59569cc..8ba6178bc 100644 --- a/kmir/src/tests/integration/data/modules/test-add-module.k +++ b/kmir/src/tests/integration/data/modules/test-add-module.k @@ -12,6 +12,9 @@ module TEST-ADD-MODULE ( CURRENTFUNC_CELL => ty ( -1 ) ) + + 0 + ( _CURRENTBODY_CELL => ListItem ( basicBlock ( ... statements: .Statements , terminator: terminator ( ... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) ) @@ -32,7 +35,7 @@ module TEST-ADD-MODULE - ( .List => ListItem ( StackFrame ( CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) + ( .List => ListItem ( StackFrame ( 0 , CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) [priority(20), label(BASIC-BLOCK-1-TO-3)] diff --git a/kmir/src/tests/integration/data/modules/test-add-module.md b/kmir/src/tests/integration/data/modules/test-add-module.md index 06776ba27..5e2e3e491 100644 --- a/kmir/src/tests/integration/data/modules/test-add-module.md +++ b/kmir/src/tests/integration/data/modules/test-add-module.md @@ -15,6 +15,9 @@ module TEST-ADD-MODULE ( CURRENTFUNC_CELL => ty ( -1 ) ) + + 0 + ( _CURRENTBODY_CELL => ListItem ( basicBlock ( ... statements: .Statements , terminator: terminator ( ... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) ) @@ -35,7 +38,7 @@ module TEST-ADD-MODULE - ( .List => ListItem ( StackFrame ( CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) + ( .List => ListItem ( StackFrame ( 0 , CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) [priority(20), label(BASIC-BLOCK-1-TO-3)] diff --git a/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.json b/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.json index 9cf02027b..bc8d1e687 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.json +++ b/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.json @@ -365,6 +365,26 @@ "params": [] }, "args": [ + { + "node": "KApply", + "label": { + "node": "KLabel", + "name": "", + "params": [] + }, + "args": [ + { + "node": "KToken", + "token": "0", + "sort": { + "node": "KSort", + "name": "Int" + } + } + ], + "arity": 1, + "variable": false + }, { "node": "KApply", "label": { @@ -704,7 +724,7 @@ "variable": false } ], - "arity": 6, + "arity": 7, "variable": false }, { @@ -740,10 +760,18 @@ "node": "KApply", "label": { "node": "KLabel", - "name": "StackFrame(_,_,_,_,_)_KMIR-CONFIGURATION_StackFrame_Ty_Place_MaybeBasicBlockIdx_UnwindAction_List", + "name": "StackFrame(_,_,_,_,_,_)_KMIR-CONFIGURATION_StackFrame_Int_Ty_Place_MaybeBasicBlockIdx_UnwindAction_List", "params": [] }, "args": [ + { + "node": "KToken", + "token": "0", + "sort": { + "node": "KSort", + "name": "Int" + } + }, { "node": "KVariable", "name": "CALLER_CELL", @@ -832,7 +860,7 @@ "variable": false } ], - "arity": 5, + "arity": 6, "variable": false } ], @@ -857,8 +885,23 @@ }, "args": [ { - "node": "KVariable", - "name": "_GENERATEDCOUNTER_CELL" + "node": "KRewrite", + "lhs": { + "node": "KToken", + "token": "0", + "sort": { + "node": "KSort", + "name": "Int" + } + }, + "rhs": { + "node": "KToken", + "token": "1", + "sort": { + "node": "KSort", + "name": "Int" + } + } } ], "arity": 1, diff --git a/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.k b/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.k index 58b96e706..8e534b708 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.k +++ b/kmir/src/tests/integration/data/prove-rs/show/assert-true.main.to-module.k @@ -12,6 +12,9 @@ module ASSERT-TRUE-MAIN-SUMMARY ( CURRENTFUNC_CELL => ty ( -1 ) ) + + 0 + ( _CURRENTBODY_CELL => ListItem ( basicBlock ( ... statements: .Statements , terminator: terminator ( ... kind: terminatorKindReturn , span: span ( 50 ) ) ) ) ) @@ -32,7 +35,7 @@ module ASSERT-TRUE-MAIN-SUMMARY - ( .List => ListItem ( StackFrame ( CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) + ( .List => ListItem ( StackFrame ( 0 , CALLER_CELL:Ty , DEST_CELL:Place , TARGET_CELL:MaybeBasicBlockIdx , UNWIND_CELL:UnwindAction , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ) ) ) [priority(20), label(BASIC-BLOCK-1-TO-3)] diff --git a/kmir/src/tests/integration/data/prove-rs/show/break-on-function.main.cli-break-on-function.expected b/kmir/src/tests/integration/data/prove-rs/show/break-on-function.main.cli-break-on-function.expected index 59a3b1f2a..5f98b51d0 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/break-on-function.main.cli-break-on-function.expected +++ b/kmir/src/tests/integration/data/prove-rs/show/break-on-function.main.cli-break-on-function.expected @@ -1,6 +1,7 @@ ┌─ 1 (root, init) │ #execTerminator ( terminator ( ... kind: terminatorKindCall ( ... func: operandC +│ function: main │ span: src/rust/library/std/src/rt.rs:194 │ │ (7 steps) diff --git a/kmir/src/tests/integration/data/prove-rs/show/symbolic-args-fail.main.cli-stats-leaves.expected b/kmir/src/tests/integration/data/prove-rs/show/symbolic-args-fail.main.cli-stats-leaves.expected index e4e10b74c..a6b2b9a77 100644 --- a/kmir/src/tests/integration/data/prove-rs/show/symbolic-args-fail.main.cli-stats-leaves.expected +++ b/kmir/src/tests/integration/data/prove-rs/show/symbolic-args-fail.main.cli-stats-leaves.expected @@ -34,5 +34,4 @@ LEAF CELLS Node 3: #setUpCalleeData ( monoItemFn ( ... name: symbol ( "_ZN4core9panicking5panic17hE" ) , id: defId ( 38 ) , body: noBody ) , operandConstant ( constOperand ( ... span: span ( 32 ) , userTy: noUserTypeAnnotationIndex , const: mirConst ( ... kind: constantKindAllocated ( allocation ( ... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap ( ... ptrs: provenanceMapEntry ( ... offset: 0 , allocId: allocId ( 1 ) ) .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 39 ) , id: mirConstId ( 25 ) ) ) ) .Operands , span ( 117 ) ) ~> .K >> function: core::panicking::panic::h - >> call span: /kmir/src/tests/integration/data/prove-rs/symbolic-args-fail.rs:53:5 - >> message: 'assertion failed: false' \ No newline at end of file + >> call span: /kmir/src/tests/integration/data/prove-rs/symbolic-args-fail.rs:53:5 \ No newline at end of file diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-0.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-0.expected index c8bee9fef..4a001c445 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-0.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-0.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 207 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 207 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 207 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 244 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 183 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( -341142443 , 32 , true ) ) ListItem ( Integer ( 48424546 , 32 , true ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 207 , 8 , false ) ) @@ -90,7 +93,7 @@ ListItem ( Integer ( 71 , 8 , false ) ) ListItem ( Integer ( 144 , 8 , false ) ) ListItem ( Integer ( 71 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 6 ) , 0 , dynamicSize ( 6 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 6 ) , 0 , dynamicSize ( 6 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( -341142443 , 32 , true ) , ty ( 28 ) , mutabilityNot ) ) @@ -153,7 +156,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( -341142443 , 32 , true ) ) ListItem ( Integer ( 48424546 , 32 , true ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 207 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-1.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-1.expected index 50fb59617..2d91ea402 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-1.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-1.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 32 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 32 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 32 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 130 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 60 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 253 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 32 , 8 , false ) ) ListItem ( Integer ( 130 , 8 , false ) ) @@ -89,7 +92,7 @@ ListItem ( Integer ( 241 , 8 , false ) ) ListItem ( Integer ( 194 , 8 , false ) ) ListItem ( Integer ( 107 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 6 ) , 0 , dynamicSize ( 6 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 6 ) , 0 , dynamicSize ( 6 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -151,7 +154,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 32 , 8 , false ) ) ListItem ( Integer ( 130 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-2.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-2.expected index 66dbadacc..bfe4b7a4b 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-2.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-2.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 46 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 46 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 46 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 43 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 184 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 86 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 46 , 8 , false ) ) ListItem ( Integer ( 43 , 8 , false ) ) @@ -89,7 +92,7 @@ ListItem ( Integer ( 128 , 8 , false ) ) ListItem ( Integer ( 108 , 8 , false ) ) ListItem ( Integer ( 18 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 10 ) , 0 , dynamicSize ( 10 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 10 ) , 0 , dynamicSize ( 10 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -151,7 +154,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 46 , 8 , false ) ) ListItem ( Integer ( 43 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-3.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-3.expected index d408600a9..bd0401480 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-3.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-3.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 66 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 66 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 66 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 242 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 33 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 66 , 8 , false ) ) ListItem ( Integer ( 189 , 8 , false ) ) @@ -89,7 +92,7 @@ ListItem ( Integer ( 240 , 8 , false ) ) ListItem ( Integer ( 132 , 8 , false ) ) ListItem ( Integer ( 119 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 12 ) , 0 , dynamicSize ( 12 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 12 ) , 0 , dynamicSize ( 12 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -151,7 +154,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 66 , 8 , false ) ) ListItem ( Integer ( 189 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-4.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-4.expected index 2b6e8720c..85ed76b22 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-4.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-4.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 155 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 155 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 155 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 52 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 202 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 245 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 155 , 8 , false ) ) ListItem ( Integer ( 52 , 8 , false ) ) @@ -89,7 +92,7 @@ ListItem ( Integer ( 46 , 8 , false ) ) ListItem ( Integer ( 34 , 8 , false ) ) ListItem ( Integer ( 10 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 25 ) , 0 , dynamicSize ( 25 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 25 ) , 0 , dynamicSize ( 25 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -151,7 +154,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 155 , 8 , false ) ) ListItem ( Integer ( 52 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-5.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-5.expected index 73d82794e..19aa2cf62 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-5.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-5.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 238 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 238 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 238 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 127 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 26 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 80 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 7 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 7 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 2 ) , ListItem ( Integer ( 130 , 8 , false ) ) ListItem ( Aggregate ( variantIdx ( 1 ) , ListItem ( Integer ( 14 , 8 , false ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 238 , 8 , false ) ) @@ -90,7 +93,7 @@ ListItem ( Integer ( 190 , 8 , false ) ) ListItem ( Integer ( 240 , 8 , false ) ) ListItem ( Integer ( 126 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 24 ) , 0 , dynamicSize ( 24 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 24 ) , 0 , dynamicSize ( 24 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -154,7 +157,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 2 ) , ListItem ( Integer ( 130 , 8 , false ) ) ListItem ( Aggregate ( variantIdx ( 1 ) , ListItem ( Integer ( 14 , 8 , false ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 238 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-6.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-6.expected index 3a3a93c89..810129eda 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-6.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-6.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 18 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 18 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 18 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 0 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 74 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 240 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 7 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 7 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 2 ) , ListItem ( Integer ( 41 , 8 , false ) ) ListItem ( Aggregate ( variantIdx ( 1 ) , ListItem ( Integer ( 133 , 8 , false ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 18 , 8 , false ) ) @@ -90,7 +93,7 @@ ListItem ( Integer ( 163 , 8 , false ) ) ListItem ( Integer ( 11 , 8 , false ) ) ListItem ( Integer ( 139 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 31 ) , 0 , dynamicSize ( 31 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 31 ) , 0 , dynamicSize ( 31 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -154,7 +157,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 2 ) , ListItem ( Integer ( 41 , 8 , false ) ) ListItem ( Aggregate ( variantIdx ( 1 ) , ListItem ( Integer ( 133 , 8 , false ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 18 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-7.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-7.expected index 8bdd69426..d56d8d55d 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-7.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-7.expected @@ -9,6 +9,9 @@ ty ( -2 ) + + 0 + ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueDiscriminant ( place (... local: local ( 1 ) , projection: .ProjectionElems ) ) ) , span: span ( 331 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 16 ) ) branch ( 1 , basicBlockIdx ( 3 ) ) branch ( 2 , basicBlockIdx ( 1 ) ) .Branches , otherwise: basicBlockIdx ( 20 ) ) ) , span: span ( 330 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 4 ) , projection: .ProjectionElems ) , rvalue: rvalueDiscriminant ( place (... local: local ( 1 ) , projection: projectionElemDowncast ( variantIdx ( 2 ) ) projectionElemField ( fieldIdx ( 1 ) , ty ( 55 ) ) .ProjectionElems ) ) ) , span: span ( 331 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 1 , basicBlockIdx ( 2 ) ) branch ( 0 , basicBlockIdx ( 16 ) ) .Branches , otherwise: basicBlockIdx ( 20 ) ) ) , span: span ( 330 ) ) ) ) @@ -72,7 +75,7 @@ ListItem ( Integer ( 44 , 8 , false ) ) ListItem ( Integer ( 222 , 8 , false ) ) ListItem ( Integer ( 214 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 4 ) , 0 , dynamicSize ( 4 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 4 ) , 0 , dynamicSize ( 4 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 1923567076 , 32 , true ) , ty ( 28 ) , mutabilityNot ) ) @@ -128,7 +131,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 1923567076 , 32 , true ) ) ListItem ( Integer ( -1940095024 , 32 , true ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 48 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-8.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-8.expected index 056a32057..7dc2873c3 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-8.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-8.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 189 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 189 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 189 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 192 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 64 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 98 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 189 , 8 , false ) ) ListItem ( Integer ( 192 , 8 , false ) ) @@ -89,7 +92,7 @@ ListItem ( Integer ( 43 , 8 , false ) ) ListItem ( Integer ( 70 , 8 , false ) ) ListItem ( Integer ( 126 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 32 ) , 0 , dynamicSize ( 32 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 32 ) , 0 , dynamicSize ( 32 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityNot ) ) @@ -151,7 +154,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 0 ) , .List ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 189 , 8 , false ) ) ListItem ( Integer ( 192 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-9.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-9.expected index 92a082106..72611fd63 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/final-9.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/final-9.expected @@ -1,6 +1,6 @@ - #traverseProjection ( toStack ( 1 , local ( 30 ) ) , Integer ( 95 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) ) ) ) + #traverseProjection ( toFrame ( 0 , local ( 30 ) ) , Integer ( 95 , 8 , false ) , PointerOffset ( 1 , 8 ) .ProjectionElems , CtxField ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) , 0 , ty ( 23 ) ) CtxFieldUnion ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) ) , ty ( 74 ) ) CtxIndex ( ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 95 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 3 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 173 , 8 , false ) ) ) ) ) ListItem ( Union ( fieldIdx ( 1 ) , Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 237 , 8 , false ) ) ) ) ) @@ -25,6 +25,9 @@ ty ( 64 ) + + 4 + ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageLive ( local ( 2 ) ) , span: span ( 247 ) ) statement (... kind: statementKindStorageLive ( local ( 3 ) ) , span: span ( 248 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 3 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindMut (... kind: mutBorrowKindTwoPhaseBorrow ) , place (... local: local ( 1 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) ) ) , span: span ( 248 ) ) statement (... kind: statementKindStorageLive ( local ( 5 ) ) , span: span ( 246 ) ) statement (... kind: statementKindStorageLive ( local ( 6 ) ) , span: span ( 249 ) ) statement (... kind: statementKindStorageLive ( local ( 7 ) ) , span: span ( 250 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 7 ) , projection: .ProjectionElems ) , rvalue: rvalueRef ( region (... kind: regionKindReErased ) , borrowKindShared , place (... local: local ( 3 ) , projection: .ProjectionElems ) ) ) , span: span ( 250 ) ) statement (... kind: statementKindStorageLive ( local ( 9 ) ) , span: span ( 251 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 9 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 1 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 251 ) ) statement (... kind: statementKindStorageLive ( local ( 10 ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 10 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 252 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 6 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpSubUnchecked , operandMove ( place (... local: local ( 9 ) , projection: .ProjectionElems ) ) , operandMove ( place (... local: local ( 10 ) , projection: .ProjectionElems ) ) ) ) , span: span ( 51 ) ) statement (... kind: statementKindStorageDead ( local ( 10 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 9 ) ) , span: span ( 253 ) ) statement (... kind: statementKindStorageDead ( local ( 7 ) ) , span: span ( 254 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGt , operandMove ( place (... local: local ( 6 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 255 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 8 ) , mutability: mutabilityMut ) ) , ty: ty ( 3 ) , id: mirConstId ( 6 ) ) ) ) ) ) , span: span ( 246 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 2 ) ) .Branches , otherwise: basicBlockIdx ( 1 ) ) ) , span: span ( 246 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindStorageDead ( local ( 6 ) ) , span: span ( 255 ) ) statement (... kind: statementKindStorageLive ( local ( 8 ) ) , span: span ( 257 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 8 ) , projection: .ProjectionElems ) , rvalue: rvalueUse ( operandCopy ( place (... local: local ( 3 ) , projection: projectionElemDeref projectionElemField ( fieldIdx ( 0 ) , ty ( 3 ) ) .ProjectionElems ) ) ) ) , span: span ( 258 ) ) statement (... kind: statementKindStorageLive ( local ( 11 ) ) , span: span ( 259 ) ) statement (... kind: statementKindStorageLive ( local ( 12 ) ) , span: span ( 256 ) ) statement (... kind: statementKindAssign (... place: place (... local: local ( 12 ) , projection: .ProjectionElems ) , rvalue: rvalueNullaryOp ( nullOpUbChecks , ty ( 4 ) ) ) , span: span ( 260 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 12 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 4 ) ) .Branches , otherwise: basicBlockIdx ( 3 ) ) ) , span: span ( 256 ) ) ) ) @@ -50,13 +53,13 @@ ListItem ( newLocal ( ty ( 55 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 10 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Moved ) ) , ty ( 48 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 1 ) , ty ( 13 ) ) .ProjectionElems ) , mutabilityMut , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 56 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 4 , place (... local: local ( 3 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , noMetadataSize ) ) , ty ( 58 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 3 ) , mutabilityMut ) ) @@ -65,21 +68,21 @@ ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1 , 64 , false ) , ty ( 3 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 23 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 50 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 15 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) ListItem ( typedValue ( Moved , ty ( 4 ) , mutabilityMut ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 0 , dynamicSize ( 8 ) ) ) , ty ( 53 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 2 ) , mutabilityNot ) ) - ListItem ( typedValue ( PtrLocal ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( PtrLocal ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) projectionElemConstantIndex (... offset: 0 , minLength: 0 , fromEnd: false ) projectionElemField ( fieldIdx ( 1 ) , ty ( 74 ) ) projectionElemField ( fieldIdx ( 0 ) , ty ( 23 ) ) .ProjectionElems ) , mutabilityNot , metadata ( noMetadataSize , 1 , dynamicSize ( 8 ) ) ) , ty ( 54 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 30 ) , projection: projectionElemField ( fieldIdx ( 0 ) , ty ( 11 ) ) .ProjectionElems ) , mutabilityNot , metadata ( staticSize ( 8 ) , 0 , noMetadataSize ) ) , ty ( 57 ) , mutabilityMut ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( 0 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionContinue , ListItem ( newLocal ( ty ( 2 ) , mutabilityMut ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 486255726 , 32 , true ) ) ListItem ( Integer ( -1000150020 , 32 , true ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 95 , 8 , false ) ) @@ -90,7 +93,7 @@ ListItem ( Integer ( 171 , 8 , false ) ) ListItem ( Integer ( 20 , 8 , false ) ) ListItem ( Integer ( 194 , 8 , false ) ) ) , ty ( 25 ) , mutabilityNot ) ) - ListItem ( typedValue ( Reference ( 1 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 10 ) , 0 , dynamicSize ( 10 ) ) ) , ty ( 32 ) , mutabilityNot ) ) + ListItem ( typedValue ( Reference ( 0 , place (... local: local ( 4 ) , projection: .ProjectionElems ) , mutabilityNot , metadata ( dynamicSize ( 10 ) , 0 , dynamicSize ( 10 ) ) ) , ty ( 32 ) , mutabilityNot ) ) ListItem ( newLocal ( ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Moved , ty ( 69 ) , mutabilityMut ) ) ListItem ( typedValue ( Integer ( 486255726 , 32 , true ) , ty ( 28 ) , mutabilityNot ) ) @@ -153,7 +156,7 @@ ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 28 ) , mutabilityMut ) ) ListItem ( newLocal ( ty ( 5 ) , mutabilityMut ) ) ) ) - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( Aggregate ( variantIdx ( 1 ) , ListItem ( Aggregate ( variantIdx ( 0 ) , ListItem ( Integer ( 486255726 , 32 , true ) ) ListItem ( Integer ( -1000150020 , 32 , true ) ) ) ) ) , ty ( 68 ) , mutabilityNot ) ) ListItem ( typedValue ( Range ( ListItem ( Integer ( 95 , 8 , false ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-0.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-0.expected index 7e6b4e60a..d60437b7b 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-0.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-0.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-1.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-1.expected index 8d4f34f7d..1fd3dad15 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-1.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-1.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-2.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-2.expected index 6bbd4c726..162ac57f2 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-2.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-2.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-3.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-3.expected index a46aea65e..ee5904308 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-3.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-3.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-4.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-4.expected index 77d20383f..d4ade281f 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-4.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-4.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-5.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-5.expected index b2eeca22a..9626a962f 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-5.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-5.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-6.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-6.expected index 175fabdab..79d3bf298 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-6.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-6.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-7.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-7.expected index d186da3b3..4060fd789 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-7.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-7.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-8.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-8.expected index 5a1813338..907ad3b3b 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-8.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-8.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-9.expected b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-9.expected index edca97d9f..f101dc085 100644 --- a/kmir/src/tests/integration/data/run-smir-random/complex-types/init-9.expected +++ b/kmir/src/tests/integration/data/run-smir-random/complex-types/init-9.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-0.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-0.expected index f041f3897..82c07e67c 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-0.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-0.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -75,7 +78,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( true ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 197 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -341142443 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-1.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-1.expected index d4175ed23..c3afd0ae9 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-1.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-1.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 32 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -1051970500 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-2.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-2.expected index c9b4a3ba5..96730372b 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-2.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-2.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -75,7 +78,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( true ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 28 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -1754129965 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-3.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-3.expected index 09fef980f..d5a464836 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-3.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-3.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 66 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 446333181 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-4.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-4.expected index fe0fc56a4..eb163596a 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-4.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-4.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 155 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -446426455 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-5.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-5.expected index 451c52bb4..3d9b042a5 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-5.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-5.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( true ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 130 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1038467225 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-6.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-6.expected index 0ccc56705..3b9a11d70 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-6.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-6.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -75,7 +78,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( true ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 41 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -1023827911 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-7.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-7.expected index f39dc9787..5f0a683e3 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-7.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-7.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 77 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -1940095024 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-8.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-8.expected index ef460d19e..414dc415c 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-8.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-8.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 189 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 1985542055 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-9.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-9.expected index 3bd535f28..d2e972f27 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/final-9.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/final-9.expected @@ -9,6 +9,9 @@ ty ( -4 ) + + 0 + ListItem ( basicBlock (... statements: .Statements , terminator: terminator (... kind: terminatorKindCall (... func: operandConstant ( constOperand (... span: span ( 31 ) , userTy: someUserTypeAnnotationIndex ( userTypeAnnotationIndex ( 0 ) ) , const: mirConst (... kind: constantKindZeroSized , ty: ty ( 15 ) , id: mirConstId ( 3 ) ) ) ) , args: operandCopy ( place (... local: local ( 2 ) , projection: .ProjectionElems ) ) .Operands , destination: place (... local: local ( 4 ) , projection: .ProjectionElems ) , target: someBasicBlockIdx ( basicBlockIdx ( 1 ) ) , unwind: unwindActionContinue ) , span: span ( 32 ) ) ) ) ListItem ( basicBlock (... statements: statement (... kind: statementKindAssign (... place: place (... local: local ( 5 ) , projection: .ProjectionElems ) , rvalue: rvalueBinaryOp ( binOpGe , operandCopy ( place (... local: local ( 4 ) , projection: .ProjectionElems ) ) , operandConstant ( constOperand (... span: span ( 34 ) , userTy: noUserTypeAnnotationIndex , const: mirConst (... kind: constantKindAllocated ( allocation (... bytes: b"\x00\x00\x00\x00" , provenance: provenanceMap (... ptrs: .ProvenanceMapEntries ) , align: align ( 4 ) , mutability: mutabilityMut ) ) , ty: ty ( 8 ) , id: mirConstId ( 4 ) ) ) ) ) ) , span: span ( 33 ) ) .Statements , terminator: terminator (... kind: terminatorKindSwitchInt (... discr: operandMove ( place (... local: local ( 5 ) , projection: .ProjectionElems ) ) , targets: switchTargets (... branches: branch ( 0 , basicBlockIdx ( 3 ) ) .Branches , otherwise: basicBlockIdx ( 2 ) ) ) , span: span ( 33 ) ) ) ) @@ -76,7 +79,7 @@ - ListItem ( StackFrame ( ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) + ListItem ( StackFrame ( 0 , ty ( -1 ) , place (... local: local ( -1 ) , projection: .ProjectionElems ) , noBasicBlockIdx , unwindActionUnreachable , ListItem ( newLocal ( ty ( 0 ) , mutabilityNot ) ) ListItem ( typedValue ( BoolVal ( false ) , ty ( 18 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( 191 , 8 , false ) , ty ( 9 ) , mutabilityNot ) ) ListItem ( typedValue ( Integer ( -1000150020 , 32 , true ) , ty ( 8 ) , mutabilityNot ) ) ) ) diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-0.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-0.expected index 821e11dd2..cdda121ba 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-0.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-0.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-1.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-1.expected index 49c6c69f5..21228dab0 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-1.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-1.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-2.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-2.expected index d28072381..7b6ba3251 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-2.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-2.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-3.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-3.expected index 27c8bd0af..6ff4fd52c 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-3.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-3.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-4.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-4.expected index 56e7fffcf..da9e47bd2 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-4.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-4.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-5.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-5.expected index 23a47f9da..0ce194940 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-5.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-5.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-6.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-6.expected index 5d3b0ff0c..8c6577ec0 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-6.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-6.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-7.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-7.expected index 6d7802d4e..dd3d4d30e 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-7.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-7.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-8.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-8.expected index c2dccad40..70b17dbdc 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-8.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-8.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-9.expected b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-9.expected index cf31f963d..5f29ca636 100644 --- a/kmir/src/tests/integration/data/run-smir-random/simple-types/init-9.expected +++ b/kmir/src/tests/integration/data/run-smir-random/simple-types/init-9.expected @@ -9,6 +9,9 @@ ty ( -1 ) + + 0 + .List diff --git a/kmir/src/tests/integration/test_decode_value.py b/kmir/src/tests/integration/test_decode_value.py index afbcb2560..422e22225 100644 --- a/kmir/src/tests/integration/test_decode_value.py +++ b/kmir/src/tests/integration/test_decode_value.py @@ -77,6 +77,7 @@ def dedent(s: str) -> str: Lbl'-LT-'retVal'-GT-'{}(LblnoReturn'Unds'KMIR-CONFIGURATION'Unds'RetVal{}()), Lbl'-LT-'currentFunc'-GT-'{}(Lblty{}(\dv{SortInt{}}("-1"))), Lbl'-LT-'currentFrame'-GT-'{}( + Lbl'-LT-'frameId'-GT-'{}(\dv{SortInt{}}("0")), Lbl'-LT-'currentBody'-GT-'{}(Lbl'Stop'List{}()), Lbl'-LT-'caller'-GT-'{}(Lblty{}(\dv{SortInt{}}("-1"))), Lbl'-LT-'dest'-GT-'{}(Lblplace{}(Lbllocal{}(\dv{SortInt{}}("-1")),LblProjectionElems'ColnColn'empty{}())),