diff --git a/docs/il-cfg.md b/docs/il-cfg.md new file mode 100644 index 000000000..5d4fcc5b0 --- /dev/null +++ b/docs/il-cfg.md @@ -0,0 +1,146 @@ +CFG Iterator Implementation +=========================== + +This file explains the in-place CFG representation on top of the IL. + +Motivations +----------- + +We want a unified IL and CFG representation to avoid the problem of keeping two datastructures in sync, +and to essentially avoid the problem of defining the correspondence between the static analysis state domain, and +the IL in order to apply a transformation to the IL using the CFG results. + +It also reduces the number of places refactors need to be applied, and reduces memory overhead for static analyses +(hopefully). + + +Interpreting the CFG from the IL +-------------------------------- + +The IL has two structural interpretations: + +1. Its syntax tree; expressions have sub expressions and so on. + - This can be traversed using Visitors + - It can also be traversed down by accessing class fields, and upward using the Parent trait + - The traversal order is defined by the order of terms in the language with a depth-first traversal of sub-terms. +2. Its control flow graph; this is part of the language's semantics, and is inferred from the Jump and Call statements. + - This is traversed using the control flow iterator, or by constructing the separate Tip-style CFG and traversing that. + From here on we describe the 'control-flow iterator'. + - The traversal order is defined by the `Dependency` structure and `Worklist` solvers and the predecessor/successor + relation between pairs of nodes + +We need to derive the predecessor/successor relation on CFG nodes IL . + +1. CFG positions are defined as + - The entry to a procedure + - The single return point from a procedure + - The block and jump statement that return from the procedure + - The beginning of a block within a procedure + - A statement command within a block + - A jump or call command within a block + +For example we define the language as statements for horn clauses. (`A :- B` means B produces A, with `,` indicating +conjunction and `;` indicating disjunction) + +First we have basic blocks belonging to a procedure. + + Procedure(id) + Block(id, procedure) + EntryBlock(block_id, procedure) + ReturnBlock(block_id, procedure) + Block(id, procedure) :- EntryBlock(id, procedure); ReturnBlock(id, procedure) + +A list of sequential statements belonging to a block + + Statement(id, block, index) + +A list of jumps (either Calls or GoTos) belonging to a block, which occur after the statements. GoTos form the +intra-procedural edges, and Calls form the inter-procedural edges. + + GoTo(id, block, destinationBlock) // multiple destinations + Call(id, block, destinationProcedure, returnBlock), count {Call(id, block, _, _)} == 1 + Jump(id, block) :- GoTo(id, block, _) ; Call(id, block, _, _) + +Statements and Jumps are both considered commands. All IL terms, commands, blocks, and procedures, have a unique +identifier. All of the above are considered IL terms. + + Command(id) :- Statement(id, _, _) ; Jump(id, _) + ILTerm(id) :- Procedure(id); Block(id, _); Command(id) + +The predecessor/successor relates ILTerms to ILTerms, and is simply defined in terms of the nodes + + pred(i, j) :- succ(j, i) + + succ(block, statement) :- Statement(statement, block, 0) + succ(statement1, statement2) :- Statement(statement1, block, i), Statement(statement2, block, i + 1) + succ(statement, goto) :- Statement(block, _last), Jump(block, goto), _last = max i forall Statement(block, i) + + succ(goto, targetBlock) :- GoTo(goto, _, _, targetBlock) + + succ(call, return_block) :- Call(call, block, dest_procedure, return_block) + +For an inter-procedural CFG we also have: + + succ(call, return_block) :- ReturnBlock(return_block, call), Procedure(call) + succ(call, targetProcedure) :- Call(call, _, _, targetProcedure) + +An inter-procedural solver is expected to keep track of call sites which return statements jump back to. + +So a sequential application of `succ` might look like + + ProcedureA -> {Block0} -> {Statement1} -> {Statement2} -> {Jump0, Jump1} -> {Block1} | {Block2} -> ... + +Implementation +-------------- + +We want it to be possible to define `succ(term, _)` and `pred(term, _)` for any given term in the IL in `O(1)`. +Successors are easily derived but predecessors are not stored with their successors. Furthermore `ProcedureExit`, +and `CallReturn` are not inherently present in the IL. + +In code we have a set of Calls, and Gotos present in the IL: these define the edges from themselves to their target. + +Then all vertices in the CFG---that is all Commands, Blocks, and Procedures in the IL---store a list of references to +their set of incoming and outgoing edges. In a sense the 'id's in the formulation above become the JVM object IDs. + +For Blocks and Procedures this means a `Set` of call statements. For Commands this means they are +stored in their block in an intrusive linked list. + +Specifically this means we store + + Command: + - reference to parent block + - procedure to find the next or previous statement in the block + - IntrusiveListElement trait inserts a next() and previous() method forming the linked list + + Block + - reference to parent procedure + - list of incoming GoTos + - list of Jumps including + - Outgoing Calls + - Outgoing GoTos + + Procedure + - list of incoming Calls + - subroutine to compute the set of all outgoing calls in all contained blocks + +This means the IL contains: + - Forward graph edges in the forms of calls and gotos + - Forward syntax tree edges in the form of classes containing their children as fields + - Backwards graph edges in the form of lists of incoming jumps and calls + - Procedure has list of incoming calls + - Block has list of incoming gotos + - Backwards syntax tree edges in the form of a parent field + - Implementation of the `HasParent` trait. + +To maintain the backwards edges it is necessary to make the actual data structures private, and only allow +modification through interfaces which maintain the graph/tree. + +Jumps: +- Must implement an interface to allow adding or removing edge references (references to themself) to and from their + target + +Blocks and Procedures: +- Implement an interface for adding and removing edge references + +Furthermore; +- Reparenting Blocks and Commands in the IL must preserve the parent field, this is not really implemented yet diff --git a/src/main/scala/analysis/Analysis.scala b/src/main/scala/analysis/Analysis.scala index fe275c0cd..6330ba8cf 100644 --- a/src/main/scala/analysis/Analysis.scala +++ b/src/main/scala/analysis/Analysis.scala @@ -297,4 +297,4 @@ class MemoryRegionAnalysisSolver( case _ => super.funsub(n, x) } } -} \ No newline at end of file +} diff --git a/src/main/scala/analysis/BasicIRConstProp.scala b/src/main/scala/analysis/BasicIRConstProp.scala new file mode 100644 index 000000000..06abef535 --- /dev/null +++ b/src/main/scala/analysis/BasicIRConstProp.scala @@ -0,0 +1,76 @@ +package analysis +import ir.* +import analysis.solvers.* + +trait ILValueAnalysisMisc: + val valuelattice: ConstantPropagationLattice = ConstantPropagationLattice() + val statelattice: MapLattice[Variable, FlatElement[BitVecLiteral], ConstantPropagationLattice] = MapLattice(valuelattice) + + def eval(exp: Expr, env: Map[Variable, FlatElement[BitVecLiteral]]): FlatElement[BitVecLiteral] = + import valuelattice._ + exp match + case id: Variable => env(id) + case n: BitVecLiteral => bv(n) + case ze: ZeroExtend => zero_extend(ze.extension, eval(ze.body, env)) + case se: SignExtend => sign_extend(se.extension, eval(se.body, env)) + case e: Extract => extract(e.end, e.start, eval(e.body, env)) + case bin: BinaryExpr => + val left = eval(bin.arg1, env) + val right = eval(bin.arg2, env) + bin.op match + case BVADD => bvadd(left, right) + case BVSUB => bvsub(left, right) + case BVMUL => bvmul(left, right) + case BVUDIV => bvudiv(left, right) + case BVSDIV => bvsdiv(left, right) + case BVSREM => bvsrem(left, right) + case BVUREM => bvurem(left, right) + case BVSMOD => bvsmod(left, right) + case BVAND => bvand(left, right) + case BVOR => bvor(left, right) + case BVXOR => bvxor(left, right) + case BVNAND => bvnand(left, right) + case BVNOR => bvnor(left, right) + case BVXNOR => bvxnor(left, right) + case BVSHL => bvshl(left, right) + case BVLSHR => bvlshr(left, right) + case BVASHR => bvashr(left, right) + case BVCOMP => bvcomp(left, right) + case BVCONCAT => concat(left, right) + + case un: UnaryExpr => + val arg = eval(un.arg, env) + + un.op match + case BVNOT => bvnot(arg) + case BVNEG => bvneg(arg) + + case _ => valuelattice.top + + private final val callerPreservedRegisters = Set("R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8", "R9", "R10", + "R11", "R12", "R13", "R14", "R15", "R16", "R17", "R18", "R30") + + /** Transfer function for state lattice elements. + */ + def localTransfer(n: CFGPosition, s: statelattice.Element): statelattice.Element = + n match + case la: LocalAssign => + s + (la.lhs -> eval(la.rhs, s)) + case c: Call => s ++ callerPreservedRegisters.filter(reg => s.keys.exists(_.name == reg)).map(n => Register(n, BitVecType(64)) -> statelattice.sublattice.top).toMap + case _ => s + + + +object IRSimpleValueAnalysis: + + class Solver(prog: Program) extends ILValueAnalysisMisc + with IRIntraproceduralForwardDependencies + with Analysis[Map[CFGPosition, Map[Variable, FlatElement[BitVecLiteral]]]] + with SimplePushDownWorklistFixpointSolver[CFGPosition, Map[Variable, FlatElement[BitVecLiteral]], MapLattice[Variable, FlatElement[BitVecLiteral], ConstantPropagationLattice]] + : + /* Worklist initial set */ + //override val lattice: MapLattice[CFGPosition, statelattice.type] = MapLattice(statelattice) + override val lattice: MapLattice[CFGPosition, Map[Variable, FlatElement[BitVecLiteral]], MapLattice[Variable, FlatElement[BitVecLiteral], ConstantPropagationLattice]] = MapLattice(statelattice) + + override val domain : Set[CFGPosition] = computeDomain(IntraProcIRCursor, prog.procedures).toSet + def transfer(n: CFGPosition, s: statelattice.Element): statelattice.Element = localTransfer(n, s) diff --git a/src/main/scala/analysis/Cfg.scala b/src/main/scala/analysis/Cfg.scala index b5a49f98c..c5f931572 100644 --- a/src/main/scala/analysis/Cfg.scala +++ b/src/main/scala/analysis/Cfg.scala @@ -428,7 +428,7 @@ class ProgramCfgFactory: cfg.addEdge(funcEntryNode, funcExitNode) } else { // Recurse through blocks - visitBlock(proc.blocks.head, funcEntryNode) + visitBlock(proc.entryBlock.get, funcEntryNode) } /** Add a block to the CFG. A block in this case is a basic block, so it contains a list of consecutive statements @@ -472,12 +472,10 @@ class ProgramCfgFactory: * Statements in this block * @param prevNode * Preceding block's end node (jump) - * @param cond - * Condition on the jump from `prevNode` to the first statement of this block * @return * The last statement's CFG node */ - def visitStmts(stmts: ArrayBuffer[Statement], prevNode: CfgNode): CfgCommandNode = { + def visitStmts(stmts: Iterable[Statement], prevNode: CfgNode): CfgCommandNode = { val firstNode = CfgStatementNode(stmts.head, block, funcEntryNode) cfg.addEdge(prevNode, firstNode) @@ -506,9 +504,6 @@ class ProgramCfgFactory: * @param prevNode * Either the previous statement in the block, or the previous block's end node (in the case that this block * contains no statements) - * @param cond - * Jump from `prevNode` to this. `TrueLiteral` if `prevNode` is a statement, and any `Expr` if `prevNode` is a - * jump. * @param solitary * `True` if this block contains no statements, `False` otherwise */ @@ -616,7 +611,6 @@ class ProgramCfgFactory: cfg.addEdge(jmpNode, noReturn) cfg.addEdge(noReturn, funcExitNode) } - case _ => assert(false, s"unexpected jump encountered, jump: $jmp") } // `jmps.head` match } // `visitJumps` function } // `visitBlocks` function diff --git a/src/main/scala/analysis/Dependencies.scala b/src/main/scala/analysis/Dependencies.scala index db5f8d1cc..72989a93a 100644 --- a/src/main/scala/analysis/Dependencies.scala +++ b/src/main/scala/analysis/Dependencies.scala @@ -1,4 +1,5 @@ package analysis +import ir.{IRWalk, IntraProcIRCursor, InterProcIRCursor, CFGPosition} /** Dependency methods for worklist-based analyses. */ @@ -21,11 +22,32 @@ trait Dependencies[N]: def indep(n: N): Set[N] trait InterproceduralForwardDependencies extends Dependencies[CfgNode] { - def outdep(n: CfgNode): Set[CfgNode] = n.succInter.toSet - def indep(n: CfgNode): Set[CfgNode] = n.predInter.toSet + override def outdep(n: CfgNode): Set[CfgNode] = n.succInter.toSet + override def indep(n: CfgNode): Set[CfgNode] = n.predInter.toSet } trait IntraproceduralForwardDependencies extends Dependencies[CfgNode] { - def outdep(n: CfgNode): Set[CfgNode] = n.succIntra.toSet - def indep(n: CfgNode): Set[CfgNode] = n.predIntra.toSet -} \ No newline at end of file + override def outdep(n: CfgNode): Set[CfgNode] = n.succIntra.toSet + override def indep(n: CfgNode): Set[CfgNode] = n.predIntra.toSet +} + + +trait IRInterproceduralForwardDependencies extends Dependencies[CFGPosition] { + override def outdep(n: CFGPosition): Set[CFGPosition] = InterProcIRCursor.succ(n) + override def indep(n: CFGPosition): Set[CFGPosition] = InterProcIRCursor.pred(n) +} + +trait IRIntraproceduralForwardDependencies extends Dependencies[CFGPosition] { + override def outdep(n: CFGPosition): Set[CFGPosition] = IntraProcIRCursor.succ(n) + override def indep(n: CFGPosition): Set[CFGPosition] = IntraProcIRCursor.pred(n) +} + +trait IRInterproceduralBackwardDependencies extends IRInterproceduralForwardDependencies { + override def outdep(n: CFGPosition): Set[CFGPosition] = super.indep(n) + override def indep(n: CFGPosition): Set[CFGPosition] = super.outdep(n) +} + +trait IRIntraproceduralBackwardDependencies extends IRIntraproceduralForwardDependencies { + override def outdep(n: CFGPosition): Set[CFGPosition] = super.indep(n) + override def indep(n: CFGPosition): Set[CFGPosition] = super.outdep(n) +} diff --git a/src/main/scala/analysis/UtilMethods.scala b/src/main/scala/analysis/UtilMethods.scala index 402076ee5..ef7a2ce96 100644 --- a/src/main/scala/analysis/UtilMethods.scala +++ b/src/main/scala/analysis/UtilMethods.scala @@ -26,7 +26,10 @@ def evaluateExpression(exp: Expr, constantPropResult: Map[Variable, FlatElement[ case BVASHR => Some(BitVectorEval.smt_bvashr(l, r)) case BVCOMP => Some(BitVectorEval.smt_bvcomp(l, r)) case BVCONCAT => Some(BitVectorEval.smt_concat(l, r)) - case _ => throw new RuntimeException("Binary operation support not implemented: " + binOp.op) + case x => { + Logger.error("Binary operation support not implemented: " + binOp.op) + None + } } case _ => None } diff --git a/src/main/scala/analysis/solvers/FixPointSolver.scala b/src/main/scala/analysis/solvers/FixPointSolver.scala index aa4e52d5c..68b1f41ba 100644 --- a/src/main/scala/analysis/solvers/FixPointSolver.scala +++ b/src/main/scala/analysis/solvers/FixPointSolver.scala @@ -112,7 +112,7 @@ trait ListSetWorklist[N] extends Worklist[N]: def add(n: N): Unit = worklist += n - def add(ns: Set[N]): Unit = worklist ++= ns + def add(ns: Iterable[N]): Unit = worklist ++= ns def run(first: Set[N]): Unit = worklist = new ListSet[N] ++ first diff --git a/src/main/scala/ir/IRCursor.scala b/src/main/scala/ir/IRCursor.scala new file mode 100644 index 000000000..94e7cb298 --- /dev/null +++ b/src/main/scala/ir/IRCursor.scala @@ -0,0 +1,212 @@ +package ir +import cfg_visualiser.DotElement +import cfg_visualiser.{DotArrow, DotGraph, DotInlineArrow, DotInterArrow, DotIntraArrow, DotNode, DotRegularArrow} + +import collection.mutable +import scala.annotation.tailrec + +/** This file defines functions to get the successor and predecessor of a IR node for control flow. + */ + +/* + * Defines a position in the IL / CFG; this becomes the lhs of the state map lattice in a static analysis. + */ +type CFGPosition = Procedure | Block | Command + +// todo: we could just use the dependencies trait directly instead to avoid the instantiation issue +trait IRWalk[IN <: CFGPosition, NT <: CFGPosition & IN] { + def succ(pos: IN): Set[NT] + def pred(pos: IN): Set[NT] +} + +trait IntraProcIRCursor extends IRWalk[CFGPosition, CFGPosition] { + + def succ(pos: CFGPosition): Set[CFGPosition] = { + pos match { + case proc: Procedure => proc.entryBlock.toSet + case b: Block => Set(b.statements.headOption().getOrElse(b.jump)) + case s: Statement => Set(s.parent.statements.nextOption(s).getOrElse(s.parent.jump)) + case j: Jump => + j match { + case n: GoTo => n.targets.asInstanceOf[Set[CFGPosition]] + case c: DirectCall => + c.returnTarget match + case Some(b) => Set(b) + case None => Set() + case i: IndirectCall => + i.returnTarget match + case Some(block: Block) => Set[CFGPosition](block) + case None => Set() + } + } + } + + def pred(pos: CFGPosition): Set[CFGPosition] = { + pos match { + case s: Statement => + if (s.parent.statements.hasPrev(s)) { + Set(s.parent.statements.getPrev(s)) + } else { + Set(s.parent) // predecessor blocks + } + case j: Jump => if j.parent.statements.isEmpty then Set(j.parent) else Set(j.parent.statements.last) + case b: Block => b.incomingJumps.asInstanceOf[Set[CFGPosition]] + case proc: Procedure => Set() // intraproc + } + } +} + +object IntraProcIRCursor extends IntraProcIRCursor + +trait IntraProcBlockIRCursor extends IRWalk[CFGPosition, Block] { + + @tailrec + final def succ(pos: CFGPosition): Set[Block] = { + pos match { + case b: Block => b.nextBlocks.toSet + case s: Command => succ(s.parent) + case s: Procedure => s.entryBlock.toSet + } + } + + @tailrec + final def pred(pos: CFGPosition): Set[Block] = { + pos match { + case b: Block => if b.isEntry then Set.empty else b.incomingJumps.map(_.parent) + case j: Command => pred(j.parent) + case s: Procedure => Set.empty + } + } +} +object IntraProcBlockIRCursor extends IntraProcBlockIRCursor + +trait InterProcIRCursor extends IRWalk[CFGPosition, CFGPosition] { + + final def succ(pos: CFGPosition): Set[CFGPosition] = { + pos match + case c: DirectCall => Set(c.target) + case c: IndirectCall => Set() + case _ => IntraProcIRCursor.succ(pos) + } + final def pred(pos: CFGPosition): Set[CFGPosition] = { + IntraProcIRCursor.pred(pos) ++ (pos match + case c: Procedure => c.incomingCalls().toSet.asInstanceOf[Set[CFGPosition]] + case b: Block => if b.isEntry then Set(b.parent) else b.incomingJumps.asInstanceOf[Set[CFGPosition]] + case _ => Set() + ) + } +} + +trait InterProcBlockIRCursor extends IRWalk[CFGPosition, Block] { + + final def succ(pos: CFGPosition): Set[Block] = { + pos match { + case s: DirectCall => s.target.entryBlock.toSet + case _ => IntraProcBlockIRCursor.succ(pos) + } + } + + final def pred(pos: CFGPosition): Set[Block] = { + pos match { + case b: Block => if b.isEntry then b.parent.incomingCalls().map(_.parent).toSet else b.prevBlocks.toSet + case _ => IntraProcBlockIRCursor.pred(pos) + } + } +} +object InterProcIRCursor extends InterProcIRCursor + +trait CallGraph extends IRWalk[Procedure, Procedure] { + final def succ(b: Procedure): Set[Procedure] = b.calls + + final def pred(b: Procedure): Set[Procedure] = b.incomingCalls().map(_.target).toSet +} + +object CallGraph extends CallGraph + +object InterProcBlockIRCursor extends IntraProcBlockIRCursor + +/** Computes the reachability transitive closure of the CFGPositions in initial under the successor relation defined by + * walker. + */ +def computeDomain[T <: CFGPosition, O <: T](walker: IRWalk[T, O], initial: IterableOnce[O]): mutable.Set[O] = { + val domain: mutable.Set[O] = mutable.Set.from(initial) + + var sizeBefore = 0 + var sizeAfter = domain.size + while (sizeBefore != sizeAfter) { + for (i <- domain) { + domain.addAll(walker.succ(i)) + domain.addAll(walker.pred(i)) + } + sizeBefore = sizeAfter + sizeAfter = domain.size + } + domain +} + +def toDot(program: Program, labels: Map[CFGPosition, String] = Map.empty): String = { + val domain = computeDomain[CFGPosition, CFGPosition](IntraProcIRCursor, program.procedures) + toDot[CFGPosition](domain, IntraProcIRCursor, labels) +} + +def dotCallGraph(program: Program, labels: Map[CFGPosition, String] = Map.empty): String = { + val domain = computeDomain[Procedure, Procedure](CallGraph, program.procedures) + toDot[Procedure](domain, CallGraph, labels) +} + +def dotBlockGraph(program: Program, labels: Map[CFGPosition, String] = Map.empty): String = { + val domain = computeDomain[CFGPosition, Block](IntraProcBlockIRCursor, program.procedures.flatMap(_.blocks).toSet) + toDot[Block](domain, IntraProcBlockIRCursor, labels) +} + +def toDot[T <: CFGPosition]( + domain: mutable.Set[T], + iterator: IRWalk[? >: T, ?], + labels: Map[CFGPosition, String] +): String = { + + val visited: mutable.Set[CFGPosition] = mutable.Set.from(domain) + var labelcounter = 0 + + def label(l: Option[String]) = { + l match { + case Some(s) => s + case None => + labelcounter += 1 + s"node$labelcounter" + } + } + + val dotNodes = mutable.Map[CFGPosition, DotNode]() + var dotArrows = mutable.ListBuffer[DotArrow]() + + def nodeText(node: CFGPosition): String = { + var text = node match { + case s: Block => f"[Block] ${s.label}" + case s => s.toString + } + if (labels.contains(node)) { + text += "\n" ++ labels(node) + } + text + } + + for (node <- domain) { + node match + case s: Command => dotNodes.addOne(s -> DotNode(label(s.label), nodeText(s))) + case s: Block => dotNodes.addOne(s -> DotNode(label(Some(s.label)), nodeText(s))) + case s => dotNodes.addOne(s -> DotNode(label(Some(s.toString)), nodeText(s))) + } + + for (node <- domain) { + node match { + case s: Call => + iterator.succ(s).foreach(n => dotArrows.addOne(DotInterArrow(dotNodes(s), dotNodes(n)))) + case s => + iterator.succ(s).foreach(n => dotArrows.addOne(DotRegularArrow(dotNodes(s), dotNodes(n)))) + } + } + + val allNodes = dotNodes.values.toList.sortBy(n => n.id) + new DotGraph("CursorCFG", allNodes, dotArrows).toDotString +} diff --git a/src/main/scala/ir/Interpreter.scala b/src/main/scala/ir/Interpreter.scala index a4cf495f7..76e0ea5f1 100644 --- a/src/main/scala/ir/Interpreter.scala +++ b/src/main/scala/ir/Interpreter.scala @@ -226,7 +226,7 @@ class Interpreter() { } // Procedure.Block - p.blocks.headOption match { + p.entryBlock match { case Some(block) => nextBlock = Some(block) case None => nextBlock = Some(returnBlock.pop()) } @@ -295,8 +295,12 @@ class Interpreter() { case assign: MemoryAssign => Logger.debug(s"MemoryAssign ${assign.lhs} = ${assign.rhs}") val evalRight = eval(assign.rhs, regs) - Logger.debug(s"MemoryAssign ${assign.lhs} := 0x${evalRight.value.toString(16)}[u$evalRight.size]\n") - + evalRight match { + case BitVecLiteral(value, size) => + Logger.debug(s"MemoryAssign ${assign.lhs} := 0x${value.toString(16)}[u$size]\n") + case _ => throw new Exception("cannot register non-bitvectors") + } + case _ : NOP => () case assert: Assert => Logger.debug(assert) // TODO diff --git a/src/main/scala/ir/Parent.scala b/src/main/scala/ir/Parent.scala new file mode 100644 index 000000000..fe952934a --- /dev/null +++ b/src/main/scala/ir/Parent.scala @@ -0,0 +1,60 @@ +package ir + +trait HasParent[T]: + /* + If a node is reachable from the IL then it *must* have a parent defined. This will only be null until + the object is fully initialised. + + All IL structures must set the parent of the child to itself, when a child is added to itself. + */ + private var _parent: Option[T] = None + def parent: T = _parent.get + + def parent_=(value: T): Unit = setParent(value) + + + /** + * Update any IL control-flow links implied by this relation. + * NOT necessarily idempotent. + * For example; + * - Registering calls with their target procedure + * - Registering jumps with their target block + * + * TODO: consider making abstract to force implementers to consider the linking. + * @param p The new parent + */ + protected[this] def linkParent(p: T): Unit = () + + /** + * Update any IL control-flow links implied by this relation. + * NOT necessarily idempotent. + */ + protected[this] def unlinkParent(): Unit = () + + + /** + * Remove this element's parent and update any IL control-flow links implied by this relation. + * Is idempotent. + */ + final def deParent(): Unit = if _parent.isDefined then { + unlinkParent() + _parent = None + } + + /** + * Set this element's parent and update any IL control-flow links implied by this relation. + * If another parent is already set then it will be de-parented and unlinked from that first. + * Is idempotent. + */ + final def setParent(p: T): Unit = { + _parent match + case Some(existing) if existing == p => () + case None => + _parent = Some(p) + linkParent(p) + case Some(_) => + deParent() + _parent = Some(p) + linkParent(p) + } + diff --git a/src/main/scala/ir/Program.scala b/src/main/scala/ir/Program.scala index 8cec400c4..600c7361f 100644 --- a/src/main/scala/ir/Program.scala +++ b/src/main/scala/ir/Program.scala @@ -1,11 +1,14 @@ package ir import scala.collection.mutable.ArrayBuffer -import scala.collection.mutable +import scala.collection.{IterableOnceExtensionMethods, View, immutable, mutable} import boogie.* import analysis.BitVectorEval +import intrusivelist.{IntrusiveList, IntrusiveListElement} -class Program(var procedures: ArrayBuffer[Procedure], var mainProcedure: Procedure, var initialMemory: ArrayBuffer[MemorySection], var readOnlyMemory: ArrayBuffer[MemorySection]) { +class Program(var procedures: ArrayBuffer[Procedure], var mainProcedure: Procedure, + var initialMemory: ArrayBuffer[MemorySection], + var readOnlyMemory: ArrayBuffer[MemorySection]) extends Iterable[CFGPosition] { // This shouldn't be run before indirect calls are resolved @@ -39,7 +42,8 @@ class Program(var procedures: ArrayBuffer[Procedure], var mainProcedure: Procedu for (elem <- procedures.filter(c => c.calls.exists(s => !procedures.contains(s)))) { // last layer is analysed only as specifications so we remove the body for anything that calls // a function we have removed - elem.blocks.clear() + + elem.clearBlocks() } } @@ -116,52 +120,274 @@ class Program(var procedures: ArrayBuffer[Procedure], var mainProcedure: Procedu initialMemory = initialMemoryNew } + /** + * Iterator in approximate syntactic pre-order of procedures, blocks, and commands. Blocks and procedures are + * not guaranteed to be in any defined order. + */ + class ILUnorderedIterator(private val begin: Program) extends Iterator[CFGPosition] { + val stack = mutable.Stack[CFGPosition]() + stack.addAll(begin.procedures) + + override def hasNext: Boolean = { + stack.nonEmpty + } + + override def next(): CFGPosition = { + val n: CFGPosition = stack.pop() + + stack.pushAll(n match { + case p : Procedure => p.blocks + case b: Block => Seq() ++ b.statements ++ Seq(b.jump) + case s: Command => Seq() + }) + + n + } + + } + + /** + * Get an Iterator in approximate syntactic pre-order of procedures, blocks, and commands. Blocks and procedures are + * not guaranteed to be in any defined order. + */ + def iterator: Iterator[CFGPosition] = { + ILUnorderedIterator(this) + } } -class Procedure( - var name: String, - var address: Option[Int], - var blocks: ArrayBuffer[Block], - var in: ArrayBuffer[Parameter], - var out: ArrayBuffer[Parameter] -) { - def calls: Set[Procedure] = blocks.flatMap(_.calls).toSet +class Procedure private ( + var name: String, + var address: Option[Int], + var entryBlock: Option[Block], + var returnBlock: Option[Block], + private val _blocks: mutable.LinkedHashSet[Block], + var in: ArrayBuffer[Parameter], + var out: ArrayBuffer[Parameter], + ) { + private var _callers = new mutable.HashSet[DirectCall] + + // class invariant + require(returnBlock.forall(b => _blocks.contains(b)) && entryBlock.forall(b => _blocks.contains(b))) + require(_blocks.isEmpty == entryBlock.isEmpty) // blocks.nonEmpty <==> entryBlock.isDefined + + def this(name: String, address: Option[Int] = None , entryBlock: Option[Block] = None, returnBlock: Option[Block] = None, blocks: Iterable[Block] = ArrayBuffer(), in: IterableOnce[Parameter] = ArrayBuffer(), out: IterableOnce[Parameter] = ArrayBuffer()) = { + this(name, address, entryBlock, returnBlock, mutable.LinkedHashSet.from(blocks), ArrayBuffer.from(in), ArrayBuffer.from(out)) + } + override def toString: String = { s"Procedure $name at ${address.getOrElse("None")} with ${blocks.size} blocks and ${in.size} in and ${out.size} out parameters" } + + def calls: Set[Procedure] = blocks.iterator.flatMap(_.calls).toSet + + /** + * Block iteration order is defined such that that the entryBlock is first, and no order is defined beyond that. + * Both entry block and return block are elements of _blocks. + */ + def blocks: Iterator[Block] = _blocks.iterator + + def addCaller(c: DirectCall): Unit = { + _callers.remove(c) + } + + def removeCaller(c: DirectCall): Unit = { + _callers.remove(c) + } + + def addBlocks(block: Block): Block = { + if (!_blocks.contains(block)) { + block.parent = this + _blocks.add(block) + if (entryBlock.isEmpty) { + entryBlock = Some(block) + } + } + block + } + + def addBlocks(blocks: Iterable[Block]): Unit = { + for (elem <- blocks) { + addBlocks(elem) + } + } + + def replaceBlock(oldBlock: Block, block: Block): Block = { + require(_blocks.contains(oldBlock)) + if (oldBlock ne block) { + val isEntry: Boolean = entryBlock.contains(oldBlock) + val isReturn: Boolean = returnBlock.contains(oldBlock) + removeBlocks(oldBlock) + addBlocks(block) + if isEntry then entryBlock = Some(block) + if isReturn then returnBlock = Some(block) + } + block + } + + /** + * Removes all blocks and replaces them with the provided iterator. + * + * @param newBlocks the new set of blocks + * @return an iterator to the new block set + */ + def replaceBlocks(newBlocks: Iterable[Block]): Unit = { + clearBlocks() + addBlocks(newBlocks) + } + + def removeBlocks(block: Block): Block = { + if (_blocks.contains(block)) { + block.deParent() + _blocks.remove(block) + } + if (_blocks.isEmpty) { + entryBlock = None + } + block + } + def removeBlocks(blocks: IterableOnce[Block]): Unit = { + for (elem <- blocks.iterator) { + removeBlocks(elem) + } + } + + def clearBlocks() : Unit = { + // O(n) because we are careful to unlink the parents etc. + removeBlocks(_blocks) + } + + + def callers(): Iterable[Procedure] = _callers.map(_.parent.parent).toSet[Procedure] + def incomingCalls(): Iterator[DirectCall] = _callers.iterator + var modifies: mutable.Set[Global] = mutable.Set() +} +class Parameter(var name: String, var size: Int, var value: Register) { + def toBoogie: BVariable = BParam(name, BitVecBType(size)) + def toGamma: BVariable = BParam(s"Gamma_$name", BoolBType) } -class Block( - var label: String, - var address: Option[Int], - var statements: ArrayBuffer[Statement], - var jump: Jump -) { - def calls: Set[Procedure] = jump.calls + +class Block private (var label: String, + var address: Option[Int], + val statements: IntrusiveList[Statement], + private var _jump: Jump, + private val _incomingJumps: mutable.HashSet[GoTo], +) extends IntrusiveListElement, HasParent[Procedure] { + statements.foreach(_.setParent(this)) + _jump.setParent(this) + + statements.onInsert = x => x.setParent(this) + statements.onRemove = x => x.deParent() + + def this(label: String, address: Option[Int], statements: IterableOnce[Statement], jump: Jump) = { + this(label, address, IntrusiveList.from(statements), jump, mutable.HashSet.empty) + } + + def this(label: String, address: Option[Int], statements: IterableOnce[Statement]) = { + this(label, address, IntrusiveList.from(statements), GoTo(Seq(), Some(label + "_unknown")), mutable.HashSet.empty) + } + + def this(label: String, address: Option[Int] = None) = { + this(label, address, IntrusiveList(), GoTo(Seq(), Some(label + "_unknown")), mutable.HashSet.empty) + } + + def jump: Jump = _jump + + def incomingJumps: immutable.Set[GoTo] = _incomingJumps.toSet + + def addIncomingJump(g: GoTo) = _incomingJumps.add(g) + def removeIncomingJump(g: GoTo) = _incomingJumps.remove(g) + + def replaceJump(j: Jump): this.type = { + _jump.deParent() + j.setParent(this) + _jump = j + this + } + + def isEntry: Boolean = parent.entryBlock.contains(this) + def isReturn: Boolean = parent.returnBlock.contains(this) + + def calls: Set[Procedure] = _jump.calls + def modifies: Set[Global] = statements.flatMap(_.modifies).toSet //def locals: Set[Variable] = statements.flatMap(_.locals).toSet ++ jumps.flatMap(_.locals).toSet + def calledBy: Set[Block] = { + Set.empty + } + override def toString: String = { // display all statements and jumps val statementsString = statements.map(_.toString).mkString("\n") s"Block $label with $statementsString\n$jump" } + /** + * @return The intra-procedural set of successor blocks. If the block ends in a call then the empty set is returned. + */ + def nextBlocks: Iterable[Block] = { + jump match { + case c: GoTo => c.targets + case c: DirectCall => c.returnTarget + case c: IndirectCall => c.returnTarget + } + } + + /** + * @return The intra-procedural set of predecessor blocks. + */ + def prevBlocks: Iterable[Block] = { + incomingJumps.map(_.parent) + } + + /** + * If the block has a single block successor then this returns that block, otherwise None. + * + * @return The successor block if there is exactly one + */ + def singleSuccessor: Option[Block] = { + jump match { + case c: GoTo if c.targets.size == 1 => c.targets.headOption + case _ => None + } + } + + /** + * If the block has a single block predecessor then this returns that block, otherwise None. + * + * @return The predecessor block if there is exactly one + */ + def singlePredecessor: Option[Block] = { + if incomingJumps.size == 1 then { + incomingJumps.headOption.map(_.parent) + } else None + } + override def equals(obj: scala.Any): Boolean = obj match case b: Block => b.label == this.label - case _ => false + case _ => false override def hashCode(): Int = label.hashCode() -} -class Parameter(var name: String, var size: Int, var value: Register) { - def toBoogie: BVariable = BParam(name, BitVecBType(size)) - def toGamma: BVariable = BParam(s"Gamma_$name", BoolBType) -} + override def linkParent(p: Procedure): Unit = { + // The first block added to the procedure is the entry block + if parent.blocks.isEmpty then parent.entryBlock = Some(this) + // to connect call() links that reference jump.parent.parent + jump.setParent(this) + } + override def unlinkParent(): Unit = { + if parent.entryBlock.contains(this) then parent.entryBlock = None + if parent.returnBlock.contains(this) then parent.returnBlock = None + // to disconnect call() links that reference jump.parent.parent + jump.deParent() + } + } + /** * @param name name diff --git a/src/main/scala/ir/Statement.scala b/src/main/scala/ir/Statement.scala index 935446d74..0efe1d976 100644 --- a/src/main/scala/ir/Statement.scala +++ b/src/main/scala/ir/Statement.scala @@ -1,16 +1,23 @@ package ir +import intrusivelist.IntrusiveListElement -import scala.collection.mutable.ArrayBuffer +import collection.mutable -trait Command { +/* + To support the state-free IL iteration in CFG order all Commands must be classes with a unique object ref. +*/ + +sealed trait Command extends HasParent[Block] { val label: Option[String] + def labelStr: String = label match { case Some(s) => s"$s: " case None => "" } + } -trait Statement extends Command { +sealed trait Statement extends Command, HasParent[Block], IntrusiveListElement[Statement] { def modifies: Set[Global] = Set() //def locals: Set[Variable] = Set() def acceptVisit(visitor: Visitor): Statement = throw new Exception( @@ -31,7 +38,7 @@ class LocalAssign(var lhs: Variable, var rhs: Expr, override val label: Option[S object LocalAssign: def unapply(l: LocalAssign): Option[(Variable, Expr, Option[String])] = Some(l.lhs, l.rhs, l.label) -class MemoryAssign(var lhs: Memory, var rhs: MemoryStore, override val label: Option[String] = None) extends Statement { +class MemoryAssign(var lhs: Memory, var rhs: MemoryStore, override val label: Option[String] = None) extends Statement { override def modifies: Set[Global] = Set(lhs) //override def locals: Set[Variable] = rhs.locals override def toString: String = s"$labelStr$lhs := $rhs" @@ -41,8 +48,8 @@ class MemoryAssign(var lhs: Memory, var rhs: MemoryStore, override val label: Op object MemoryAssign: def unapply(m: MemoryAssign): Option[(Memory, MemoryStore, Option[String])] = Some(m.lhs, m.rhs, m.label) -case class NOP(override val label: Option[String] = None) extends Statement { - override def toString: String = s"$labelStr" +class NOP(override val label: Option[String] = None) extends Statement { + override def toString: String = s"NOP $labelStr" override def acceptVisit(visitor: Visitor): Statement = this } @@ -54,10 +61,11 @@ class Assert(var body: Expr, var comment: Option[String] = None, override val la object Assert: def unapply(a: Assert): Option[(Expr, Option[String], Option[String])] = Some(a.body, a.comment, a.label) -/** - * checkSecurity is true if this is a branch condition that we want to assert has a security level of low before branching - * */ + /** + * checkSecurity is true if this is a branch condition that we want to assert has a security level of low before branching + * */ class Assume(var body: Expr, var comment: Option[String] = None, override val label: Option[String] = None, var checkSecurity: Boolean = false) extends Statement { + override def toString: String = s"${labelStr}assume $body" + comment.map(" //" + _) override def acceptVisit(visitor: Visitor): Statement = visitor.visitAssume(this) } @@ -65,27 +73,60 @@ class Assume(var body: Expr, var comment: Option[String] = None, override val la object Assume: def unapply(a: Assume): Option[(Expr, Option[String], Option[String], Boolean)] = Some(a.body, a.comment, a.label, a.checkSecurity) -trait Jump extends Command { +sealed trait Jump extends Command, HasParent[Block] { def modifies: Set[Global] = Set() //def locals: Set[Variable] = Set() def calls: Set[Procedure] = Set() def acceptVisit(visitor: Visitor): Jump = throw new Exception("visitor " + visitor + " unimplemented for: " + this) } -class GoTo(var targets: ArrayBuffer[Block], override val label: Option[String] = None) extends Jump { - /* override def locals: Set[Variable] = condition match { - case Some(c) => c.locals - case None => Set() - } */ - override def toString: String = s"${labelStr}GoTo(${targets.map(_.label).mkString(", ")})" + +class GoTo private (private var _targets: mutable.Set[Block], override val label: Option[String]) extends Jump { + + def this(targets: Iterable[Block], label: Option[String] = None) = this(mutable.Set.from(targets), label) + + def targets: Set[Block] = _targets.toSet + + def addAllTargets(t: Iterable[Block]): Unit = { + t.foreach(addTarget(_)) + } + + def addTarget(t: Block): Unit = { + if (_targets.add(t)) { + t.addIncomingJump(this) + } + } + + override def linkParent(b: Block): Unit = { + _targets.foreach(_.removeIncomingJump(this)) + } + + override def unlinkParent(): Unit = { + targets.foreach(_.removeIncomingJump(this)) + } + + + def removeTarget(t: Block): Unit = { + // making the assumption that blocks only contain the same outgoing edge once + // e.g. We don't have two edges going to the same block under different conditions + if (_targets.remove(t)) { + t.removeIncomingJump(this) + } + } + + + override def toString: String = s"${labelStr}NonDetGoTo(${targets.map(_.label).mkString(", ")})" override def acceptVisit(visitor: Visitor): Jump = visitor.visitGoTo(this) } object GoTo: - def unapply(g: GoTo): Option[(ArrayBuffer[Block], Option[String])] = Some(g.targets, g.label) + def unapply(g: GoTo): Option[(Set[Block], Option[String])] = Some(g.targets, g.label) + + +sealed trait Call extends Jump -class DirectCall(var target: Procedure, var returnTarget: Option[Block], override val label: Option[String] = None) extends Jump { +class DirectCall(val target: Procedure, var returnTarget: Option[Block], override val label: Option[String] = None) extends Call { /* override def locals: Set[Variable] = condition match { case Some(c) => c.locals case None => Set() @@ -93,12 +134,18 @@ class DirectCall(var target: Procedure, var returnTarget: Option[Block], overrid override def calls: Set[Procedure] = Set(target) override def toString: String = s"${labelStr}DirectCall(${target.name}, ${returnTarget.map(_.label)})" override def acceptVisit(visitor: Visitor): Jump = visitor.visitDirectCall(this) + + override def linkParent(p: Block): Unit = { + target.addCaller(this) + } + + override def unlinkParent(): Unit = target.removeCaller(this) } object DirectCall: - def unapply(i: DirectCall): Option[(Procedure, Option[Block], Option[String])] = Some(i.target, i.returnTarget, i.label) + def unapply(i: DirectCall): Option[(Procedure, Option[Block], Option[String])] = Some(i.target, i.returnTarget, i.label) -class IndirectCall(var target: Variable, var returnTarget: Option[Block], override val label: Option[String] = None) extends Jump { +class IndirectCall(var target: Variable, var returnTarget: Option[Block], override val label: Option[String] = None) extends Call { /* override def locals: Set[Variable] = condition match { case Some(c) => c.locals + target case None => Set(target) @@ -108,4 +155,4 @@ class IndirectCall(var target: Variable, var returnTarget: Option[Block], overri } object IndirectCall: - def unapply(i: IndirectCall): Option[(Variable, Option[Block], Option[String])] = Some(i.target, i.returnTarget, i.label) \ No newline at end of file + def unapply(i: IndirectCall): Option[(Variable, Option[Block], Option[String])] = Some(i.target, i.returnTarget, i.label) diff --git a/src/main/scala/ir/Visitor.scala b/src/main/scala/ir/Visitor.scala index 0b6d79339..bc6be9a52 100644 --- a/src/main/scala/ir/Visitor.scala +++ b/src/main/scala/ir/Visitor.scala @@ -2,6 +2,7 @@ package ir import scala.collection.mutable.ArrayBuffer import scala.collection.mutable +import intrusivelist.IntrusiveList abstract class Visitor { @@ -47,16 +48,16 @@ abstract class Visitor { } def visitBlock(node: Block): Block = { - for (i <- node.statements.indices) { - node.statements(i) = visitStatement(node.statements(i)) + for (s <- node.statements) { + node.statements.replace(s, visitStatement(s)) } - node.jump = visitJump(node.jump) + node.replaceJump(visitJump(node.jump)) node } def visitProcedure(node: Procedure): Procedure = { - for (i <- node.blocks.indices) { - node.blocks(i) = visitBlock(node.blocks(i)) + for (b <- node.blocks) { + node.replaceBlock(b, visitBlock(b)) } for (i <- node.in.indices) { node.in(i) = visitParameter(node.in(i)) @@ -253,7 +254,7 @@ abstract class IntraproceduralControlFlowVisitor extends Visitor { private val visitedBlocks: mutable.Set[Block] = mutable.Set() override def visitProcedure(node: Procedure): Procedure = { - node.blocks.headOption.foreach(visitBlock) + node.entryBlock.foreach(visitBlock) node } @@ -261,11 +262,11 @@ abstract class IntraproceduralControlFlowVisitor extends Visitor { if (visitedBlocks.contains(node)) { return node } - for (i <- node.statements.indices) { - node.statements(i) = visitStatement(node.statements(i)) + for (i <- node.statements) { + visitStatement(i) } visitedBlocks.add(node) - node.jump = visitJump(node.jump) + node.replaceJump(visitJump(node.jump)) node } @@ -391,7 +392,7 @@ class ExternalRemover(external: Set[String]) extends Visitor { if (external.contains(node.name)) { // update the modifies set before removing the body node.modifies.addAll(node.blocks.flatMap(_.modifies)) - node.blocks = ArrayBuffer() + node.replaceBlocks(Seq()) } super.visitProcedure(node) } @@ -420,3 +421,23 @@ class VariablesWithoutStoresLoads extends ReadOnlyVisitor { } } + + +class ConvertToSingleProcedureReturn extends Visitor { + override def visitJump(node: Jump): Jump = { + + val returnBlock = node.parent.parent.returnBlock match { + case Some(b) => b + case None => + val name = node.parent.parent.name + "_return" + val returnBlock = new Block(name, None, List(), new IndirectCall(Register("R30", BitVecType(64)), None, None)) + node.parent.parent.addBlocks(returnBlock) + node.parent.parent.returnBlock = Some(returnBlock) + } + + node match + case c: IndirectCall => + if c.target.name == "R30" && c.returnTarget.isEmpty && !c.parent.isReturn then GoTo(Seq(c.parent.parent.returnBlock.get)) else node + case _ => node + } +} diff --git a/src/main/scala/translating/BAPToIR.scala b/src/main/scala/translating/BAPToIR.scala index 5b74774d7..bbf2707d1 100644 --- a/src/main/scala/translating/BAPToIR.scala +++ b/src/main/scala/translating/BAPToIR.scala @@ -8,6 +8,7 @@ import specification.* import scala.collection.mutable import scala.collection.mutable.Map import scala.collection.mutable.ArrayBuffer +import intrusivelist.IntrusiveList class BAPToIR(var program: BAPProgram, mainAddress: Int) { @@ -18,22 +19,18 @@ class BAPToIR(var program: BAPProgram, mainAddress: Int) { var mainProcedure: Option[Procedure] = None val procedures: ArrayBuffer[Procedure] = ArrayBuffer() for (s <- program.subroutines) { - val blocks: ArrayBuffer[Block] = ArrayBuffer() - val dummyJump = GoTo(ArrayBuffer(), None) + val procedure = Procedure(s.name, Some(s.address)) for (b <- s.blocks) { - val block = Block(b.label, b.address, ArrayBuffer(), dummyJump) - blocks.append(block) + val block = Block(b.label, b.address) + procedure.addBlocks(block) labelToBlock.addOne(b.label, block) } - val in: ArrayBuffer[Parameter] = ArrayBuffer() for (p <- s.in) { - in.append(p.toIR) + procedure.in.append(p.toIR) } - val out: ArrayBuffer[Parameter] = ArrayBuffer() for (p <- s.out) { - out.append(p.toIR) + procedure.out.append(p.toIR) } - val procedure = Procedure(s.name, Some(s.address), blocks, in, out) if (s.address == mainAddress) { mainProcedure = Some(procedure) } @@ -49,9 +46,14 @@ class BAPToIR(var program: BAPProgram, mainAddress: Int) { block.statements.append(translate(st)) } val (jump, newBlocks) = translate(b.jumps, block) - block.jump = jump - procedure.blocks.addAll(newBlocks) + procedure.addBlocks(newBlocks) + block.replaceJump(jump) } + + // Set entry block to the block with the same address as the procedure or the first in sequence + procedure.entryBlock = procedure.blocks.find(b => b.address == procedure.address) + if procedure.entryBlock.isEmpty then procedure.entryBlock = procedure.blocks.nextOption() + } val memorySections: ArrayBuffer[MemorySection] = ArrayBuffer() @@ -68,7 +70,6 @@ class BAPToIR(var program: BAPProgram, mainAddress: Int) { case b: BAPLocalAssign => LocalAssign(b.lhs.toIR, b.rhs.toIR, Some(b.line)) } - /** * Translates a list of jumps from BAP into a single Jump at the IR level by moving any conditions on jumps to * Assume statements in new blocks @@ -173,7 +174,7 @@ class BAPToIR(var program: BAPProgram, mainAddress: Int) { private def newBlockCondition(block: Block, target: Block, condition: Expr): Block = { val newLabel = s"${block.label}_goto_${target.label}" val assume = Assume(condition, checkSecurity = true) - Block(newLabel, None, ArrayBuffer(assume), GoTo(ArrayBuffer(target), None)) + Block(newLabel, None, ArrayBuffer(assume), GoTo(ArrayBuffer(target))) } } diff --git a/src/main/scala/translating/ILtoIL.scala b/src/main/scala/translating/ILtoIL.scala index bcc818634..bdbc10a81 100644 --- a/src/main/scala/translating/ILtoIL.scala +++ b/src/main/scala/translating/ILtoIL.scala @@ -60,14 +60,15 @@ private class ILSerialiser extends ReadOnlyVisitor { node } - override def visitGoTo(node: GoTo): Jump = { + + override def visitGoTo(node: GoTo): GoTo = { program ++= "GoTo(" - // TODO program ++= node.targets.map(blockIdentifier).mkString(", ") program ++= ")" // GoTo node } + override def visitDirectCall(node: DirectCall): Jump = { program ++= "DirectCall(" program ++= procedureIdentifier(node.target) @@ -92,9 +93,9 @@ private class ILSerialiser extends ReadOnlyVisitor { program ++= "statements(\n" indentLevel += 1 - for (i <- node.statements.indices) { + for (s <- node.statements) { program ++= getIndent() - visitStatement(node.statements(i)) + visitStatement(s) program ++= "\n" } indentLevel -= 1 @@ -129,8 +130,8 @@ private class ILSerialiser extends ReadOnlyVisitor { } program ++= "), " program ++= "blocks(\n" - for (i <- node.blocks.indices) { - visitBlock(node.blocks(i)) + for (b <- node.blocks) { + visitBlock(b) } program ++= ")),\n" indentLevel -= 1 diff --git a/src/main/scala/translating/IRToBoogie.scala b/src/main/scala/translating/IRToBoogie.scala index b2c6d18c6..2dd2204c5 100644 --- a/src/main/scala/translating/IRToBoogie.scala +++ b/src/main/scala/translating/IRToBoogie.scala @@ -435,9 +435,9 @@ class IRToBoogie(var program: Program, var spec: Specification) { def translateProcedure(p: Procedure, readOnlyMemory: List[BExpr]): BProcedure = { - val body = p.blocks.map(b => translateBlock(b)) + val body = (p.entryBlock.view ++ p.blocks.filterNot(x => p.entryBlock.contains(x))).map(translateBlock).toList - val callsRely: Boolean = body.flatten(_.body).exists(_ match + val callsRely: Boolean = body.flatMap(_.body).exists(_ match case BProcedureCall("rely", lhs, params, comment) => true case _ => false) @@ -531,7 +531,7 @@ class IRToBoogie(var program: Program, var spec: Specification) { def translateBlock(b: Block): BBlock = { val captureState = captureStateStatement(s"${b.label}") - val cmds = List(captureState) ++ (b.statements.flatMap(s => translate(s)) ++ translate(b.jump)) + val cmds = List(captureState) ++ b.statements.flatMap(s => translate(s)) ++ translate(b.jump) BBlock(b.label, cmds) } @@ -566,8 +566,8 @@ class IRToBoogie(var program: Program, var spec: Specification) { // collects all targets of the goto with a branch condition that we need to check the security level for // and collects the variables for that val conditions = g.targets.flatMap(_.statements.headOption).collect { case a: Assume if a.checkSecurity => a } - val conditionVariables = conditions.flatMap(_.body.variables).distinct - val gammas = conditionVariables.map(_.toGamma).sorted + val conditionVariables = conditions.flatMap(_.body.variables) + val gammas = conditionVariables.map(_.toGamma).toList.sorted val conditionAssert: List[BCmd] = if (gammas.size > 1) { val andedConditions = gammas.tail.foldLeft(gammas.head)((ands: BExpr, next: BExpr) => BinaryBExpr(BoolAND, ands, next)) List(BAssert(andedConditions)) @@ -581,6 +581,7 @@ class IRToBoogie(var program: Program, var spec: Specification) { } def translate(s: Statement): List[BCmd] = s match { + case m: NOP => List.empty case m: MemoryAssign => val lhs = m.lhs.toBoogie val rhs = m.rhs.toBoogie diff --git a/src/main/scala/util/IntrusiveList.scala b/src/main/scala/util/IntrusiveList.scala new file mode 100644 index 000000000..f19118cd0 --- /dev/null +++ b/src/main/scala/util/IntrusiveList.scala @@ -0,0 +1,341 @@ +package intrusivelist +import scala.collection.mutable + +// TODO: implement IterableOps +// So need iterablefactory https://docs.scala-lang.org/overviews/core/custom-collections.html + +/** A simple intrusive list implementation. + * + * This is a linked list with the links stored as fields within the elements contained in the list, rather than boxing + * the elements in an external list structure. + * + * Therefore this structure can hold any elements that inherit the IntrusiveListElement trait and an intrusive list + * element can only be a member of a single list at a time. + * + * However, this allows us to create an iterator, or simply get the next or previous element from any point in the + * list, as well as insert or remove anywhere in the list without invalidating the iterator. + * + * Insert or remove before or after any element: O(1) Create iterator: O(1) Find element: O(n) + * + * @param numElems + * The size of the list + * @param firstElem + * The first list element if nonempty or none if empty. + * @param lastElem + * THe last list element if nonempty or none if empty. + * @tparam T + */ +final class IntrusiveList[T <: IntrusiveListElement[T]] private ( + var numElems: Int, + var firstElem: Option[T], + var lastElem: Option[T] +) extends mutable.Iterable[T], + mutable.Growable[T]: + var onInsert: T => Unit = x => () + var onRemove: T => Unit = x => () + + // invariant: + // numElems == first.length() + + // if size == 0 then first == last == None + // else if size == 1 then first.get == last.get + // else first = last.get.first() && last == first.get.last() + + // Growable + override def knownSize: Int = numElems + + override def addOne(elem: T): IntrusiveList.this.type = { + append(elem) + this + } + + override def clear(): Unit = { + while (size > 0) { + this.remove(lastElem.get) + } + } + + override def addAll(xs: IterableOnce[T]): IntrusiveList.this.type = { + xs.iterator.foreach(append) + this + } + // end Growable + + def this() = this(0, None, None) + + // Iterable + + /* + * O(n); get nth element + */ + def apply(i: Int): T = { + // TODO: cache? + assert(i < size) + var elem = firstElem.get + for (c <- 0 until i) { + elem = elem.getNext + } + elem + } + + class IntrusiveListIterator(var elem: Option[T]) extends Iterator[T] { + override def hasNext: Boolean = elem.isDefined + override def next: T = { + val t = elem.get + elem = t.next + t + } + } + + def iterator: Iterator[T] = IntrusiveListIterator(firstElem) + + // end Iterable + + def iteratorFrom(elem: T): Iterator[T] = { + assert(elem.first() == firstElem.get) + IntrusiveListIterator(Some(elem)) + } + + // Implementation + + override def size: Int = numElems + + override def head(): T = firstElem.get + + override def headOption(): Option[T] = firstElem + + def begin(): T = firstElem.get + + private def containsRef(elem: T): Boolean = { + if (size == 0) { + false + } else { + firstElem.get.containsRef(elem) + } + } + + def contains(elem: T): Boolean = { + if (size == 0) { + false + } else { + firstElem.get.contains(elem) + } + } + + def back(): T = lastElem.get + + def prepend(newElem: T): T = { + assert(newElem.unitary) + assert(!containsRef(newElem)) + onInsert(newElem) + if (size > 0) { + insertBefore(firstElem.get, newElem) + } else { + firstElem = Some(newElem) + lastElem = Some(newElem) + numElems = 1 + } + newElem + } + + def append(newElem: T): T = { + assert(newElem.unitary) + assert(!containsRef(newElem)) + onInsert(newElem) + if (size > 0) { + insertAfter(lastElem.get, newElem) + } else { + firstElem = Some(newElem) + lastElem = Some(newElem) + numElems = 1 + } + newElem + } + + def replace(elem: T, withElem: T): T = { + assert(containsRef(elem)) + if (elem ne withElem) { + assert(withElem.unitary) + assert(!containsRef(withElem)) + val newElem: T = insertAfter(elem, withElem) + val removed = remove(elem) + newElem + } else { + withElem + } + } + + def remove(intrusiveListElement: T): T = { + assert(size >= 0) + assert(containsRef(intrusiveListElement)) + numElems -= 1 + if (intrusiveListElement == lastElem.get) { + lastElem = intrusiveListElement.prev + } + if (intrusiveListElement == firstElem.get) { + firstElem = intrusiveListElement.next + } + onRemove(intrusiveListElement) + intrusiveListElement.remove() + } + + def insertAfter(intrusiveListElement: T, newElem: T): T = { + assert(size >= 1) + assert(containsRef(intrusiveListElement)) + assert(!containsRef(newElem)) + assert(newElem.unitary) + numElems += 1 + if (intrusiveListElement == lastElem.get) { + lastElem = Some(newElem) + } + + onInsert(newElem) + intrusiveListElement.insertAfter(newElem) + } + + def insertBefore(intrusiveListElement: T, newElem: T): T = { + assert(size >= 1) + assert(containsRef(intrusiveListElement)) + assert(!containsRef(newElem)) + assert(newElem.unitary) + numElems += 1 + if (intrusiveListElement == firstElem.get) { + firstElem = Some(newElem) + } + onInsert(newElem) + intrusiveListElement.insertBefore(newElem) + } + + def getNext(elem: T): T = { + elem.getNext + } + + def hasNext(elem: T): Boolean = { + elem.hasNext + } + + def hasPrev(elem: T): Boolean = { + elem.hasPrev + } + + def getPrev(elem: T): T = { + elem.getPrev + } + + def nextOption(elem: T): Option[T] = { + elem.next + } + + def prevOption(elem: T): Option[T] = { + elem.prev + } + +object IntrusiveList { + def from[T <: IntrusiveListElement[T]](it: IterableOnce[T]): IntrusiveList[T] = { + val l = new IntrusiveList[T]() + l.addAll(it) + l + } + def empty[T <: IntrusiveListElement[T]]: IntrusiveList[T] = new IntrusiveList[T]() +} + +trait IntrusiveListElement[T <: IntrusiveListElement[T]]: + private[intrusivelist] var next: Option[T] = None + private[intrusivelist] var prev: Option[T] = None + private[intrusivelist] final def insertBefore(elem: T): T = { + elem.prev = prev + if (prev.isDefined) { + prev.get.next = Some(elem) + } + prev = Some(elem) + elem.next = Some(this.asInstanceOf[T]) + elem + } + + private[intrusivelist] final def unitary: Boolean = next.isEmpty && prev.isEmpty + + private[intrusivelist] final def insertAfter(elem: T): T = { + if (next.isDefined) { + next.get.prev = Some(elem) + } + elem.next = next + next = Some(elem) + elem.prev = Some(this.asInstanceOf[T]) + elem + } + + private[intrusivelist] final def replace(elem: T): T = { + insertAfter(elem) + remove() + elem + } + + private[intrusivelist] final def remove(): T = { + if (next.isDefined) { + next.get.prev = prev + } + if (prev.isDefined) { + prev.get.next = next + } + this.next = None + this.prev = None + this.asInstanceOf[T] + } + + def succ(): Option[this.type] = { + next.map(_.asInstanceOf[this.type]) + } + + def pred(): Option[this.type] = { + prev.map(_.asInstanceOf[this.type]) + } + + private[intrusivelist] final def append(elem: T): T = { + last().insertAfter(elem) + } + + private[intrusivelist] final def prepend(elem: T): T = { + first().insertBefore(elem) + } + + private[intrusivelist] final def getNext: T = next.get + + private[intrusivelist] final def getPrev: T = prev.get + + private[intrusivelist] final def hasNext: Boolean = next.isDefined + private[intrusivelist] final def hasPrev: Boolean = prev.isDefined + + private[intrusivelist] final def last(): T = { + next match { + case Some(n) => n.last() + case None => this.asInstanceOf[T] + } + } + + private[intrusivelist] final def first(): T = { + prev match { + case Some(n) => n.first() + case None => this.asInstanceOf[T] + } + } + + private[intrusivelist] final def splice(at: T, insertBegin: T, insertEnd: T): Unit = { + assert(insertEnd.last() == insertEnd) + assert(insertBegin.last() == insertEnd) + assert(insertBegin.first() == insertBegin) + assert(insertEnd.first() == insertBegin) + assert(!at.contains(insertBegin)) + + at.next.foreach(_.prev = Some(insertEnd)) + insertBegin.prev = Some(at) + at.next = Some(insertBegin) + + } + + private[intrusivelist] final def contains(elem: T): Boolean = { + elem.first() == first() + } + + private[intrusivelist] final def containsRef(elem: T): Boolean = { + elem.first() eq first() + } diff --git a/src/main/scala/util/RunUtils.scala b/src/main/scala/util/RunUtils.scala index 1eb1072ef..ade5cfdab 100644 --- a/src/main/scala/util/RunUtils.scala +++ b/src/main/scala/util/RunUtils.scala @@ -18,9 +18,13 @@ import org.antlr.v4.runtime.tree.ParseTreeWalker import org.antlr.v4.runtime.{CharStreams, CommonTokenStream} import translating.* import util.Logger +import intrusivelist.IntrusiveList +import analysis.CfgCommandNode +import scala.annotation.tailrec import scala.collection.mutable + object RunUtils { var memoryRegionAnalysisResults: Map[CfgNode, LiftedElement[Set[MemoryRegion]]] = Map() @@ -90,8 +94,11 @@ object RunUtils { val externalNames = externalFunctions.map(e => e.name) val externalRemover = ExternalRemover(externalNames) val renamer = Renamer(reserved) + val returnUnifier = ConvertToSingleProcedureReturn() IRProgram = externalRemover.visitProgram(IRProgram) IRProgram = renamer.visitProgram(IRProgram) + IRProgram = returnUnifier.visitProgram(IRProgram) + q.loading.dumpIL.foreach(s => writeToFile(serialiseIL(IRProgram), s"$s-before-analysis.il")) @@ -153,20 +160,33 @@ object RunUtils { val cfg = ProgramCfgFactory().fromIR(IRProgram) + val domain = computeDomain(IntraProcIRCursor, IRProgram.procedures) + Logger.info("[!] Running Constant Propagation") val constPropSolver = ConstantPropagationSolver(cfg) val constPropResult = constPropSolver.analyze() + val ilcpsolver = IRSimpleValueAnalysis.Solver(IRProgram) + val newCPResult = ilcpsolver.analyze() + config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(IRProgram, newCPResult), s"${s}_new_ir_constprop$iteration.txt")) + + config.analysisDotPath.foreach(s => writeToFile(cfg.toDot(Output.labeler(constPropResult, true), Output.dotIder), s"${s}_constprop$iteration.dot")) + config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(IRProgram, cfg, constPropResult), s"${s}_constprop$iteration.txt")) + config.analysisDotPath.foreach(s => writeToFile(cfg.toDot(Output.labeler(constPropResult, true), Output.dotIder), s"${s}_constprop$iteration.dot")) - config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(cfg, constPropResult, iteration), s"${s}_constprop$iteration.txt")) + config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(IRProgram, cfg, constPropResult), s"${s}_constprop$iteration.txt")) Logger.info("[!] Running MRA") val mraSolver = MemoryRegionAnalysisSolver(cfg, globalAddresses, globalOffsets, mergedSubroutines, constPropResult) val mraResult = mraSolver.analyze() memoryRegionAnalysisResults = mraResult - config.analysisDotPath.foreach(s => writeToFile(cfg.toDot(Output.labeler(mraResult, true), Output.dotIder), s"${s}_mra$iteration.dot")) - config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(cfg, mraResult, iteration), s"${s}_mra$iteration.txt")) + config.analysisDotPath.foreach(s => { + writeToFile(cfg.toDot(Output.labeler(mraResult, true), Output.dotIder), s"${s}_mra$iteration.dot") + writeToFile(dotCallGraph(IRProgram), s"${s}_callgraph$iteration.dot") + writeToFile(dotBlockGraph(IRProgram, IRProgram.filter(_.isInstanceOf[Block]).map(b => b -> b.toString).toMap), s"${s}_blockgraph$iteration.dot") + }) + config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(IRProgram, cfg, mraResult), s"${s}_mra$iteration.txt")) Logger.info("[!] Running MMM") val mmm = MemoryModelMap() @@ -177,7 +197,7 @@ object RunUtils { val vsaResult: Map[CfgNode, LiftedElement[Map[Variable | MemoryRegion, Set[Value]]]] = vsaSolver.analyze() config.analysisDotPath.foreach(s => writeToFile(cfg.toDot(Output.labeler(vsaResult, true), Output.dotIder), s"${s}_vsa$iteration.dot")) - config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(cfg, vsaResult, iteration), s"${s}_vsa$iteration.txt")) + config.analysisResultsPath.foreach(s => writeToFile(printAnalysisResults(IRProgram, cfg, vsaResult), s"${s}_vsa$iteration.txt")) Logger.info("[!] Resolving CFG") val (newIR, modified): (Program, Boolean) = resolveCFG(cfg, vsaResult, IRProgram) @@ -196,7 +216,60 @@ object RunUtils { newIR } - def printAnalysisResults(cfg: ProgramCfg, result: Map[CfgNode, _], iteration: Int): String = { + + def convertAnalysisResults[T](cfg: ProgramCfg, result: Map[CfgNode, T]): Map[CFGPosition, T] = { + val results = mutable.HashMap[CFGPosition, T]() + result.foreach((node, res) => + node match { + case s: CfgStatementNode => results.addOne(s.data -> res) + case s: CfgFunctionEntryNode => results.addOne(s.data -> res) + case s: CfgJumpNode => results.addOne(s.data -> res) + case s: CfgCommandNode => results.addOne(s.data -> res) + case _ => () + } + ) + + results.toMap + } + + def printAnalysisResults[T](program: Program, cfg: ProgramCfg, result: Map[CfgNode, T]): String = { + printAnalysisResults(program, convertAnalysisResults(cfg, result)) + } + + def printAnalysisResults(prog: Program, result: Map[CFGPosition, _]): String = { + val results = mutable.ArrayBuffer[String]() + val toVisit = mutable.Stack[CFGPosition]() + val visited = mutable.HashSet[CFGPosition]() + toVisit.pushAll(prog.procedures) + + while (toVisit.nonEmpty) { + val next = toVisit.pop() + visited.add(next) + toVisit.pushAll(IntraProcBlockIRCursor.succ(next).diff(visited.collect[Block] { + case b: Block => b + })) + + def contentStr(b: CFGPosition) = { + if result.contains(b) then "\n :: " + result(b) + else "" + } + + val t = next match + case p: Procedure => s"\nProcedure ${p.name}" + case b: Block => Seq( + s" Block ${b.label}${contentStr(b)}" + , b.statements.map(s => {" " + s.toString + contentStr(s)}).mkString("\n") + , " " + b.jump.toString + contentStr(b.jump)).mkString("\n") + case s: Statement => s" Statement $s${contentStr(s)}" + case s: Jump => s" Jump $s${contentStr(s)}" + results.addOne(t) + } + + results.mkString(System.lineSeparator()) + } + + + def printAnalysisResults(cfg: ProgramCfg, result: Map[CfgNode, _], iteration: Int): String = { val functionEntries = cfg.nodes.collect { case n: CfgFunctionEntryNode => n }.toSeq.sortBy(_.data.name) val s = StringBuilder() s.append(System.lineSeparator()) @@ -215,6 +288,10 @@ object RunUtils { if (c.block.label != previousBlock) { printBlock(c) } + c match { + case _: CfgStatementNode => s.append(" ") + case _ => () + } printNode(c) previousBlock = c.block.label isEntryNode = false @@ -228,7 +305,7 @@ object RunUtils { } val successors = next.succIntra if (successors.size > 1) { - val successorsCmd = successors.collect { case c: CfgCommandNode => c }.toSeq.sortBy(_.data.label) + val successorsCmd = successors.collect { case c: CfgCommandNode => c }.toSeq.sortBy(_.data.toString) printGoTo(successorsCmd) for (s <- successorsCmd) { if (!visited.contains(s)) { @@ -339,7 +416,7 @@ object RunUtils { if (targets.size == 1) { modified = true val newCall = DirectCall(targets.head, indirectCall.returnTarget, indirectCall.label) - block.jump = newCall + block.replaceJump(newCall) } else if (targets.size > 1) { modified = true val procedure = c.parent.data @@ -350,9 +427,9 @@ object RunUtils { val directCall = DirectCall(t, indirectCall.returnTarget) newBlocks.append(Block(newLabel, None, ArrayBuffer(assume), directCall)) } - procedure.blocks.addAll(newBlocks) + procedure.addBlocks(newBlocks) val newCall = GoTo(newBlocks, indirectCall.label) - block.jump = newCall + block.replaceJump(newCall) } case LiftedBottom => } @@ -365,7 +442,7 @@ object RunUtils { } def addFakeProcedure(name: String): Unit = { - IRProgram.procedures += Procedure(name, None, ArrayBuffer(), ArrayBuffer(), ArrayBuffer()) + IRProgram.procedures += Procedure(name) } def resolveAddresses(valueSet: Set[Value]): Set[AddressValue] = { diff --git a/src/test/correct/arrays_simple/clang/arrays_simple.expected b/src/test/correct/arrays_simple/clang/arrays_simple.expected index e8148fdd9..1c3104644 100644 --- a/src/test/correct/arrays_simple/clang/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang/arrays_simple.expected @@ -104,6 +104,9 @@ implementation main() assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected b/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected index 93df8d220..6ad789189 100644 --- a/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected index e8148fdd9..1c3104644 100644 --- a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected @@ -104,6 +104,9 @@ implementation main() assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected b/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected index e8148fdd9..1c3104644 100644 --- a/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected @@ -104,6 +104,9 @@ implementation main() assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected b/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected index 657d807d3..89d953131 100644 --- a/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected +++ b/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected index c5b688e20..449c9bf24 100644 --- a/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected @@ -117,6 +117,9 @@ implementation main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected index 6d956c255..6676682fb 100644 --- a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected @@ -101,6 +101,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert true; assume {:captureState "%000002c9"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected index 4c17176f2..c84bb9de3 100644 --- a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected @@ -117,6 +117,9 @@ implementation main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected index ab9f8055e..e245119db 100644 --- a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected @@ -126,6 +126,9 @@ implementation main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected index edb11860b..c8a094719 100644 --- a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected @@ -108,6 +108,9 @@ implementation main() R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected index c843cddaa..73de65ea1 100644 --- a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected @@ -101,6 +101,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 24bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 24bv64), true); assert true; assume {:captureState "%000001b7"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected index 99b9ee356..ac5e53666 100644 --- a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected @@ -108,6 +108,9 @@ implementation main() R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected index ae0f28825..9f81e5624 100644 --- a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected @@ -117,6 +117,9 @@ implementation main() R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4080bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4080bv64)) || L(mem, bvadd64(R0, 4080bv64))); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected index f2fd56f92..44edaee5b 100644 --- a/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected @@ -123,6 +123,9 @@ implementation main() assume {:captureState "%000002f4"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected index ebb755408..5a939b84e 100644 --- a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); assume {:captureState "%000002d4"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected index 76a559719..4ddc614b8 100644 --- a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected @@ -123,6 +123,9 @@ implementation main() assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected index 9fcce3ab0..ad80572af 100644 --- a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected @@ -131,6 +131,9 @@ implementation main() assume {:captureState "%000002f5"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected index 8e03e4189..fab6240fd 100644 --- a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected @@ -121,6 +121,9 @@ implementation main() assume {:captureState "%000002f4"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected index c804e3075..ce9d35e0b 100644 --- a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 28bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 28bv64), Gamma_R2); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); assume {:captureState "%000001be"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected index cbc4e476f..cfb71fab0 100644 --- a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected @@ -121,6 +121,9 @@ implementation main() assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected index 84af2b94c..4a0823143 100644 --- a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected @@ -129,6 +129,9 @@ implementation main() assume {:captureState "%000002f5"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected index ef04944c8..49cd5cbb1 100644 --- a/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected @@ -108,6 +108,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected index d64b06e7f..da5bb08d2 100644 --- a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000002d3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected index cb4eb6691..6f2f64853 100644 --- a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected @@ -108,6 +108,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected index ba57bc23c..9cfc98efd 100644 --- a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected @@ -117,6 +117,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected index 67cd54772..ccd7b9dbe 100644 --- a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected @@ -107,6 +107,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected index 2c52bf6ac..9b201b71d 100644 --- a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000001bd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected index c22f17d25..5417fc0ef 100644 --- a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected @@ -107,6 +107,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected index 906116fac..2a1283c94 100644 --- a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected @@ -115,6 +115,9 @@ implementation main() assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected index 63e8aa7c6..e5e4ed62a 100644 --- a/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected @@ -116,6 +116,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000002da"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected index c4614ad48..c329a809c 100644 --- a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected @@ -116,6 +116,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000002df"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected index 82a1091e7..8433da06e 100644 --- a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected @@ -116,6 +116,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%0000085f"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected index faa73d91e..eaa0ad674 100644 --- a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected @@ -125,6 +125,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000002e5"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected index fbd2704b0..ba43d5c3e 100644 --- a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected @@ -117,6 +117,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000002f7"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected index 9ca19cfbc..4df2639da 100644 --- a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected @@ -116,6 +116,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 20bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R2, 20bv64), Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000001c5"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected index d4bf3b846..275759b2e 100644 --- a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected @@ -117,6 +117,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected index 227c5dffc..8b814f0f0 100644 --- a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected @@ -126,6 +126,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); assume {:captureState "%000002f9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected index f7b4a805a..7c8fdb3f2 100644 --- a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected @@ -178,6 +178,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -206,6 +209,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected index f0ffa441b..67f1b438e 100644 --- a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected @@ -134,6 +134,9 @@ implementation main() assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); assume {:captureState "%000002fa"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected index 2520dda04..adda22bcf 100644 --- a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected @@ -178,6 +178,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -206,6 +209,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected index 35abd32f8..e4539e963 100644 --- a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected @@ -188,6 +188,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -220,6 +223,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected index 5ba0d1baf..69f10bdc2 100644 --- a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected @@ -176,6 +176,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -204,6 +207,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected index 0f4323cd4..22c369091 100644 --- a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected @@ -134,6 +134,9 @@ implementation main() assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); assume {:captureState "%000001df"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected index 5a1961394..c47bbf53a 100644 --- a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected @@ -176,6 +176,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -204,6 +207,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected index 82a5d1bc0..4afd3b959 100644 --- a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected @@ -184,6 +184,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -216,6 +219,9 @@ implementation zero() lzero: assume {:captureState "lzero"} true; R0, Gamma_R0 := 0bv64, true; + goto zero_return; + zero_return: + assume {:captureState "zero_return"} true; return; } diff --git a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected index b061e6446..e0d4ac96b 100644 --- a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected @@ -159,7 +159,7 @@ implementation main() l00000348: assume {:captureState "l00000348"} true; assert Gamma_R8; - goto l00000348_goto_l00000350, l00000348_goto_l0000037a; + goto l00000348_goto_l0000037a, l00000348_goto_l00000350; l00000350: assume {:captureState "l00000350"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -178,7 +178,7 @@ implementation main() assume {:captureState "l00000365"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000342: assume {:captureState "lmain_goto_l00000342"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -195,5 +195,8 @@ implementation main() assume {:captureState "l00000348_goto_l0000037a"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000037a; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected index 17422fd8f..fb01ac4e4 100644 --- a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected @@ -129,7 +129,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000002f9, lmain_goto_l000002fd; + goto lmain_goto_l000002fd, lmain_goto_l000002f9; l000002fd: assume {:captureState "l000002fd"} true; R0, Gamma_R0 := zero_extend32_32(R9[32:0]), Gamma_R9; @@ -140,7 +140,7 @@ implementation main() goto l00000300; l00000300: assume {:captureState "l00000300"} true; - return; + goto main_return; lmain_goto_l000002f9: assume {:captureState "lmain_goto_l000002f9"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -149,5 +149,8 @@ implementation main() assume {:captureState "lmain_goto_l000002fd"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000002fd; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected index 1cac520ec..f041bdf4a 100644 --- a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected @@ -159,7 +159,7 @@ implementation main() l0000098b: assume {:captureState "l0000098b"} true; assert Gamma_R8; - goto l0000098b_goto_l00000993, l0000098b_goto_l000009bd; + goto l0000098b_goto_l000009bd, l0000098b_goto_l00000993; l00000993: assume {:captureState "l00000993"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -178,7 +178,7 @@ implementation main() assume {:captureState "l000009a8"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000985: assume {:captureState "lmain_goto_l00000985"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -195,5 +195,8 @@ implementation main() assume {:captureState "l0000098b_goto_l000009bd"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l000009bd; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected index 79f1d9df6..8ce836552 100644 --- a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected @@ -192,7 +192,7 @@ implementation main() assume {:captureState "l0000037b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000358: assume {:captureState "lmain_goto_l00000358"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -209,5 +209,8 @@ implementation main() assume {:captureState "l0000035e_goto_l00000390"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000390; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected index 822dfd0ae..d71c3e779 100644 --- a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected @@ -144,7 +144,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000332, lmain_goto_l00000349; + goto lmain_goto_l00000349, lmain_goto_l00000332; l00000332: assume {:captureState "l00000332"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -156,7 +156,7 @@ implementation main() l0000033e: assume {:captureState "l0000033e"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000332: assume {:captureState "lmain_goto_l00000332"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -165,5 +165,8 @@ implementation main() assume {:captureState "lmain_goto_l00000349"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000349; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected index 9e4dbdf63..d1f5db87f 100644 --- a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected @@ -103,7 +103,7 @@ implementation main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R0, 20bv64))), (gamma_load32(Gamma_mem, bvadd64(R0, 20bv64)) || L(mem, bvadd64(R0, 20bv64))); assert Gamma_R0; - goto lmain_goto_l000001bc, lmain_goto_l00000398; + goto lmain_goto_l00000398, lmain_goto_l000001bc; l00000398: assume {:captureState "l00000398"} true; call rely(); @@ -111,7 +111,7 @@ implementation main() goto l000001bc; l000001bc: assume {:captureState "l000001bc"} true; - return; + goto main_return; lmain_goto_l000001bc: assume {:captureState "lmain_goto_l000001bc"} true; assume (bvcomp32(R0[32:0], 0bv32) != 0bv1); @@ -120,5 +120,8 @@ implementation main() assume {:captureState "lmain_goto_l00000398"} true; assume (bvcomp32(R0[32:0], 0bv32) == 0bv1); goto l00000398; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected index c9203915f..790fdac03 100644 --- a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected @@ -144,7 +144,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000937, lmain_goto_l0000094e; + goto lmain_goto_l0000094e, lmain_goto_l00000937; l00000937: assume {:captureState "l00000937"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -156,7 +156,7 @@ implementation main() l00000943: assume {:captureState "l00000943"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000937: assume {:captureState "lmain_goto_l00000937"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -165,5 +165,8 @@ implementation main() assume {:captureState "lmain_goto_l0000094e"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000094e; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected index 942505785..274ce16ba 100644 --- a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected @@ -156,7 +156,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000334, lmain_goto_l0000034b; + goto lmain_goto_l0000034b, lmain_goto_l00000334; l00000334: assume {:captureState "l00000334"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -168,7 +168,7 @@ implementation main() l00000340: assume {:captureState "l00000340"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000334: assume {:captureState "lmain_goto_l00000334"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -177,5 +177,8 @@ implementation main() assume {:captureState "lmain_goto_l0000034b"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000034b; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/clang/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang/basic_lock_read.expected index 46b155617..db6595a90 100644 --- a/src/test/correct/basic_lock_read/clang/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang/basic_lock_read.expected @@ -142,7 +142,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000032d, lmain_goto_l00000330; + goto lmain_goto_l00000330, lmain_goto_l0000032d; l00000330: assume {:captureState "l00000330"} true; R8, Gamma_R8 := 1bv64, true; @@ -176,7 +176,7 @@ implementation main() assume {:captureState "l0000033b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000032d: assume {:captureState "lmain_goto_l0000032d"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l00000333_goto_l00000352"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000352; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected index 4be10047d..197fdeb2c 100644 --- a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected @@ -119,11 +119,11 @@ implementation main() assert (memory_load32_le(mem, $z_addr) == z_old); assume {:captureState "%000002eb"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; l000002f7: assume {:captureState "l000002f7"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l000002dc: assume {:captureState "lmain_goto_l000002dc"} true; assume (bvcomp32(R8[32:0], 0bv32) != 0bv1); @@ -132,5 +132,8 @@ implementation main() assume {:captureState "lmain_goto_l000002f7"} true; assume (bvcomp32(R8[32:0], 0bv32) == 0bv1); goto l000002f7; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected index 2af9450e5..4f8620c1a 100644 --- a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected @@ -142,7 +142,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000958, lmain_goto_l0000095b; + goto lmain_goto_l0000095b, lmain_goto_l00000958; l0000095b: assume {:captureState "l0000095b"} true; R8, Gamma_R8 := 1bv64, true; @@ -176,7 +176,7 @@ implementation main() assume {:captureState "l00000966"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000958: assume {:captureState "lmain_goto_l00000958"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l0000095e_goto_l0000097d"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000097d; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected index 55e344550..1ebf43397 100644 --- a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected @@ -154,7 +154,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000033c, lmain_goto_l0000033f; + goto lmain_goto_l0000033f, lmain_goto_l0000033c; l0000033f: assume {:captureState "l0000033f"} true; R8, Gamma_R8 := 1bv64, true; @@ -190,7 +190,7 @@ implementation main() assume {:captureState "l0000034a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000033c: assume {:captureState "lmain_goto_l0000033c"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -207,5 +207,8 @@ implementation main() assume {:captureState "l00000342_goto_l00000361"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000361; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected index 04694eca2..c83f5c166 100644 --- a/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected @@ -160,7 +160,7 @@ implementation main() assume {:captureState "l00000327"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000327: assume {:captureState "lmain_goto_l00000327"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -169,5 +169,8 @@ implementation main() assume {:captureState "lmain_goto_l0000033e"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000033e; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected index a5778d8e2..2a16b5a6a 100644 --- a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected @@ -123,7 +123,7 @@ implementation main() l000001bd: assume {:captureState "l000001bd"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l000001bd: assume {:captureState "lmain_goto_l000001bd"} true; assume (bvnot1(bvcomp32(R0[32:0], 0bv32)) != 0bv1); @@ -132,5 +132,8 @@ implementation main() assume {:captureState "lmain_goto_l0000039c"} true; assume (bvnot1(bvcomp32(R0[32:0], 0bv32)) == 0bv1); goto l0000039c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected index 013371bd5..58f5ddf79 100644 --- a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected @@ -138,7 +138,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000948, lmain_goto_l0000095f; + goto lmain_goto_l0000095f, lmain_goto_l00000948; l0000095f: assume {:captureState "l0000095f"} true; R0, Gamma_R0 := 69632bv64, true; @@ -160,7 +160,7 @@ implementation main() assume {:captureState "l00000948"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000948: assume {:captureState "lmain_goto_l00000948"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -169,5 +169,8 @@ implementation main() assume {:captureState "lmain_goto_l0000095f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000095f; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected index b0f65f92f..084d0cad4 100644 --- a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected @@ -149,7 +149,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000328, lmain_goto_l0000033f; + goto lmain_goto_l0000033f, lmain_goto_l00000328; l0000033f: assume {:captureState "l0000033f"} true; R0, Gamma_R0 := 65536bv64, true; @@ -173,7 +173,7 @@ implementation main() assume {:captureState "l00000328"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000328: assume {:captureState "lmain_goto_l00000328"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -182,5 +182,8 @@ implementation main() assume {:captureState "lmain_goto_l0000033f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000033f; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected index 256f2ffdb..cf0ff5fbe 100644 --- a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected @@ -152,7 +152,7 @@ implementation main() l0000032f: assume {:captureState "l0000032f"} true; assert Gamma_R8; - goto l0000032f_goto_l00000337, l0000032f_goto_l0000034e; + goto l0000032f_goto_l0000034e, l0000032f_goto_l00000337; l0000034e: assume {:captureState "l0000034e"} true; goto l0000034f; @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000337"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000329: assume {:captureState "lmain_goto_l00000329"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -185,5 +185,8 @@ implementation main() assume {:captureState "l0000032f_goto_l0000034e"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000034e; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected index d58bdf4b7..d9f9cea02 100644 --- a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected @@ -125,7 +125,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000002fa, lmain_goto_l000002fd; + goto lmain_goto_l000002fd, lmain_goto_l000002fa; l000002fd: assume {:captureState "l000002fd"} true; R0, Gamma_R0 := 0bv64, true; @@ -136,7 +136,7 @@ implementation main() goto l00000300; l00000300: assume {:captureState "l00000300"} true; - return; + goto main_return; lmain_goto_l000002fa: assume {:captureState "lmain_goto_l000002fa"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -145,5 +145,8 @@ implementation main() assume {:captureState "lmain_goto_l000002fd"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000002fd; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected index b6cf86194..55416eb78 100644 --- a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected @@ -140,7 +140,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000947, lmain_goto_l0000094a; + goto lmain_goto_l0000094a, lmain_goto_l00000947; l0000094a: assume {:captureState "l0000094a"} true; R8, Gamma_R8 := 1bv64, true; @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000955"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000947: assume {:captureState "lmain_goto_l00000947"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -185,5 +185,8 @@ implementation main() assume {:captureState "l0000094d_goto_l0000096c"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000096c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected index 3a4d8c854..79910e11b 100644 --- a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected @@ -164,7 +164,7 @@ implementation main() l0000033e: assume {:captureState "l0000033e"} true; assert Gamma_R8; - goto l0000033e_goto_l00000346, l0000033e_goto_l0000035d; + goto l0000033e_goto_l0000035d, l0000033e_goto_l00000346; l0000035d: assume {:captureState "l0000035d"} true; goto l0000035e; @@ -182,7 +182,7 @@ implementation main() assume {:captureState "l00000346"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000338: assume {:captureState "lmain_goto_l00000338"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -199,5 +199,8 @@ implementation main() assume {:captureState "l0000033e_goto_l0000035d"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000035d; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected index 651c01ac4..4f7c77915 100644 --- a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected @@ -136,7 +136,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000031b, lmain_goto_l00000332; + goto lmain_goto_l00000332, lmain_goto_l0000031b; l00000332: assume {:captureState "l00000332"} true; R0, Gamma_R0 := 69632bv64, true; @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l0000031b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000031b: assume {:captureState "lmain_goto_l0000031b"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -159,5 +159,8 @@ implementation main() assume {:captureState "lmain_goto_l00000332"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000332; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected index d00ef7870..bf5fcdb4a 100644 --- a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected @@ -111,7 +111,7 @@ implementation main() goto l000001c2; l000001c2: assume {:captureState "l000001c2"} true; - return; + goto main_return; lmain_goto_l000001c2: assume {:captureState "lmain_goto_l000001c2"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) != 0bv1); @@ -120,5 +120,8 @@ implementation main() assume {:captureState "lmain_goto_l0000039c"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) == 0bv1); goto l0000039c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected index b2243b92c..8fee3b91e 100644 --- a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000918"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000918: assume {:captureState "lmain_goto_l00000918"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -159,5 +159,8 @@ implementation main() assume {:captureState "lmain_goto_l0000092f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000092f; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected index 808cfc037..f002e09a4 100644 --- a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected @@ -147,7 +147,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000031c, lmain_goto_l00000333; + goto lmain_goto_l00000333, lmain_goto_l0000031c; l00000333: assume {:captureState "l00000333"} true; R0, Gamma_R0 := 65536bv64, true; @@ -162,7 +162,7 @@ implementation main() assume {:captureState "l0000031c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000031c: assume {:captureState "lmain_goto_l0000031c"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -171,5 +171,8 @@ implementation main() assume {:captureState "lmain_goto_l00000333"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000333; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected index 367b4ac90..a1d334ccf 100644 --- a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected @@ -161,6 +161,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%00000323"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected index 19b7d3ccb..1d7f2f69a 100644 --- a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected @@ -128,6 +128,9 @@ implementation main() assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002dd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected index ae005a5ac..bb9ec2468 100644 --- a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected @@ -161,6 +161,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%00000900"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected index c1174454e..911a778b3 100644 --- a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected @@ -175,6 +175,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%00000339"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected index 6fcb6c50a..557dc3c2a 100644 --- a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected @@ -163,6 +163,9 @@ implementation main() assume {:captureState "%00000358"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected index 4539ec2d1..c38d95241 100644 --- a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected @@ -128,6 +128,9 @@ implementation main() assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000001c4"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected index 16fe76e1f..0be35f3d8 100644 --- a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected @@ -163,6 +163,9 @@ implementation main() assume {:captureState "%0000097b"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected index b07bb0495..cf10c70e3 100644 --- a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected @@ -177,6 +177,9 @@ implementation main() assume {:captureState "%0000035c"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected index 19fe5df42..1b32aee84 100644 --- a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected @@ -119,6 +119,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002e7"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected index 50cb46fbc..151e9da63 100644 --- a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected @@ -121,6 +121,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002e7"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected index 42faa9199..5b3e25eb3 100644 --- a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected @@ -119,6 +119,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%00000876"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected index a73fa8a5f..e856038a1 100644 --- a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected @@ -133,6 +133,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002fd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected index 5199b11f1..8b42a4caf 100644 --- a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected @@ -119,6 +119,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002f6"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected index 46caff477..35b4849c7 100644 --- a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected @@ -121,6 +121,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 4bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R2, 4bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000001ca"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected index ad4646279..9c0279fab 100644 --- a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected @@ -119,6 +119,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%0000089d"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected index 59062e0c6..c2ee38b4b 100644 --- a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected @@ -131,6 +131,9 @@ implementation main() assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); assume {:captureState "%000002f8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected index 9e3e90520..c7da366c3 100644 --- a/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected @@ -110,6 +110,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected index 5796c5ea2..78eb76045 100644 --- a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected @@ -110,6 +110,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000002d3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected index 167275531..de57e7b8e 100644 --- a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected @@ -110,6 +110,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected index 715eb7aac..09408a2d5 100644 --- a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected @@ -119,6 +119,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected index da04f4e45..b6dd732d6 100644 --- a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected @@ -109,6 +109,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected index 40d90295d..813c0e715 100644 --- a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected @@ -110,6 +110,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000001bd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected index 3b0a8d602..1c2d69270 100644 --- a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected @@ -109,6 +109,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected index 8b50e1cff..773c6529f 100644 --- a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected @@ -117,6 +117,9 @@ implementation main() assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected index eb30200ff..034341749 100644 --- a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected @@ -186,7 +186,7 @@ implementation main() stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); assume {:captureState "%00000407"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000003c9: assume {:captureState "lmain_goto_l000003c9"} true; assume (bvcomp32(R10[32:0], 0bv32) != 0bv1); @@ -195,5 +195,8 @@ implementation main() assume {:captureState "lmain_goto_l000003ce"} true; assume (bvcomp32(R10[32:0], 0bv32) == 0bv1); goto l000003ce; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected index 93df8d220..6ad789189 100644 --- a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected index 0c0529a9a..3e31a9755 100644 --- a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected @@ -164,7 +164,7 @@ implementation main() R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); assert Gamma_R10; - goto lmain_goto_l00000aac, lmain_goto_l00000ab1; + goto lmain_goto_l00000ab1, lmain_goto_l00000aac; l00000ab1: assume {:captureState "l00000ab1"} true; R9, Gamma_R9 := zero_extend32_32(bvsdiv33(sign_extend1_32(R8[32:0]), sign_extend1_32(R10[32:0]))[32:0]), (Gamma_R10 && Gamma_R8); @@ -186,7 +186,7 @@ implementation main() stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); assume {:captureState "%00000aea"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000aac: assume {:captureState "lmain_goto_l00000aac"} true; assume (bvcomp32(R10[32:0], 0bv32) != 0bv1); @@ -195,5 +195,8 @@ implementation main() assume {:captureState "lmain_goto_l00000ab1"} true; assume (bvcomp32(R10[32:0], 0bv32) == 0bv1); goto l00000ab1; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected index 0c0529a9a..3e31a9755 100644 --- a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected @@ -164,7 +164,7 @@ implementation main() R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); assert Gamma_R10; - goto lmain_goto_l00000aac, lmain_goto_l00000ab1; + goto lmain_goto_l00000ab1, lmain_goto_l00000aac; l00000ab1: assume {:captureState "l00000ab1"} true; R9, Gamma_R9 := zero_extend32_32(bvsdiv33(sign_extend1_32(R8[32:0]), sign_extend1_32(R10[32:0]))[32:0]), (Gamma_R10 && Gamma_R8); @@ -186,7 +186,7 @@ implementation main() stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); assume {:captureState "%00000aea"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000aac: assume {:captureState "lmain_goto_l00000aac"} true; assume (bvcomp32(R10[32:0], 0bv32) != 0bv1); @@ -195,5 +195,8 @@ implementation main() assume {:captureState "lmain_goto_l00000ab1"} true; assume (bvcomp32(R10[32:0], 0bv32) == 0bv1); goto l00000ab1; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected index ad78cb05e..519a3eea4 100644 --- a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected @@ -140,7 +140,7 @@ implementation main() R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); assert Gamma_R1; - goto lmain_goto_l000003b3, lmain_goto_l000003b8; + goto lmain_goto_l000003b8, lmain_goto_l000003b3; l000003b8: assume {:captureState "l000003b8"} true; R2, Gamma_R2 := zero_extend32_32(bvsdiv33(sign_extend1_32(R0[32:0]), sign_extend1_32(R1[32:0]))[32:0]), (Gamma_R1 && Gamma_R0); @@ -158,7 +158,7 @@ implementation main() assume {:captureState "%000003dc"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000003b3: assume {:captureState "lmain_goto_l000003b3"} true; assume (bvcomp32(R1[32:0], 0bv32) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "lmain_goto_l000003b8"} true; assume (bvcomp32(R1[32:0], 0bv32) == 0bv1); goto l000003b8; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected index 657d807d3..89d953131 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected index 7a7b55d86..e452e806d 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected @@ -158,7 +158,7 @@ implementation main() assume {:captureState "%00000a97"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000a6e: assume {:captureState "lmain_goto_l00000a6e"} true; assume (bvcomp32(R1[32:0], 0bv32) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "lmain_goto_l00000a73"} true; assume (bvcomp32(R1[32:0], 0bv32) == 0bv1); goto l00000a73; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected index 7a7b55d86..e452e806d 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected @@ -158,7 +158,7 @@ implementation main() assume {:captureState "%00000a97"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000a6e: assume {:captureState "lmain_goto_l00000a6e"} true; assume (bvcomp32(R1[32:0], 0bv32) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "lmain_goto_l00000a73"} true; assume (bvcomp32(R1[32:0], 0bv32) == 0bv1); goto l00000a73; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected index d3df02ca2..3c10d40f5 100644 --- a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected @@ -155,7 +155,7 @@ implementation main() l0000033c: assume {:captureState "l0000033c"} true; assert Gamma_R8; - goto l0000033c_goto_l00000344, l0000033c_goto_l0000035b; + goto l0000033c_goto_l0000035b, l0000033c_goto_l00000344; l0000035b: assume {:captureState "l0000035b"} true; goto l0000035c; @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000344"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000336: assume {:captureState "lmain_goto_l00000336"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -185,5 +185,8 @@ implementation main() assume {:captureState "l0000033c_goto_l0000035b"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000035b; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected index 52ed26e37..64769e137 100644 --- a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected @@ -125,7 +125,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000002fa, lmain_goto_l000002fd; + goto lmain_goto_l000002fd, lmain_goto_l000002fa; l000002fd: assume {:captureState "l000002fd"} true; R0, Gamma_R0 := 0bv64, true; @@ -136,7 +136,7 @@ implementation main() goto l00000300; l00000300: assume {:captureState "l00000300"} true; - return; + goto main_return; lmain_goto_l000002fa: assume {:captureState "lmain_goto_l000002fa"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -145,5 +145,8 @@ implementation main() assume {:captureState "lmain_goto_l000002fd"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000002fd; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected index 801699e47..d8d8d2f6c 100644 --- a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000962"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000954: assume {:captureState "lmain_goto_l00000954"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -185,5 +185,8 @@ implementation main() assume {:captureState "l0000095a_goto_l00000979"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000979; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected index 012c24569..9f2fb9d46 100644 --- a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected @@ -169,7 +169,7 @@ implementation main() l00000352: assume {:captureState "l00000352"} true; assert Gamma_R8; - goto l00000352_goto_l0000035a, l00000352_goto_l00000371; + goto l00000352_goto_l00000371, l00000352_goto_l0000035a; l00000371: assume {:captureState "l00000371"} true; goto l00000372; @@ -182,7 +182,7 @@ implementation main() assume {:captureState "l0000035a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000034c: assume {:captureState "lmain_goto_l0000034c"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -199,5 +199,8 @@ implementation main() assume {:captureState "l00000352_goto_l00000371"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000371; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected index 09f319a88..9a64a11dd 100644 --- a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l0000032e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000032e: assume {:captureState "lmain_goto_l0000032e"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -159,5 +159,8 @@ implementation main() assume {:captureState "lmain_goto_l00000345"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000345; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected index 932695a5d..30b79f20b 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected @@ -111,7 +111,7 @@ implementation main() goto l000001c2; l000001c2: assume {:captureState "l000001c2"} true; - return; + goto main_return; lmain_goto_l000001c2: assume {:captureState "lmain_goto_l000001c2"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) != 0bv1); @@ -120,5 +120,8 @@ implementation main() assume {:captureState "lmain_goto_l0000039c"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) == 0bv1); goto l0000039c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected index 649cd90fb..16de0c96b 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected @@ -140,7 +140,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000092b, lmain_goto_l00000942; + goto lmain_goto_l00000942, lmain_goto_l0000092b; l00000942: assume {:captureState "l00000942"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l0000092b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000092b: assume {:captureState "lmain_goto_l0000092b"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -159,5 +159,8 @@ implementation main() assume {:captureState "lmain_goto_l00000942"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000942; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected index 6cb642e12..f9ba8fe64 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected @@ -152,7 +152,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000330, lmain_goto_l00000347; + goto lmain_goto_l00000347, lmain_goto_l00000330; l00000347: assume {:captureState "l00000347"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); @@ -162,7 +162,7 @@ implementation main() assume {:captureState "l00000330"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000330: assume {:captureState "lmain_goto_l00000330"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -171,5 +171,8 @@ implementation main() assume {:captureState "lmain_goto_l00000347"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000347; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected index ff3f08d23..c9eea6ad7 100644 --- a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected @@ -156,6 +156,9 @@ implementation main() assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); assume {:captureState "%0000032d"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected index 265c75910..7ed7ee650 100644 --- a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected @@ -127,6 +127,9 @@ implementation main() assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); assume {:captureState "%000002e7"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected index b840b320f..1ac76133c 100644 --- a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected @@ -156,6 +156,9 @@ implementation main() assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); assume {:captureState "%00000916"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected index 1db974e9f..f50de0b9f 100644 --- a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected @@ -170,6 +170,9 @@ implementation main() assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); assume {:captureState "%00000343"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected index 5938703b5..47014fba7 100644 --- a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected @@ -158,6 +158,9 @@ implementation main() assume {:captureState "%00000362"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected index be4b9b9c7..97fd452bd 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected @@ -127,6 +127,9 @@ implementation main() assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); assume {:captureState "%000001ca"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected index 7dd67fdb8..0b971d6ea 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected @@ -158,6 +158,9 @@ implementation main() assume {:captureState "%00000991"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected index 1b7295c33..947877895 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected @@ -172,6 +172,9 @@ implementation main() assume {:captureState "%00000366"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected index 6ae41834b..a7c8e91b3 100644 --- a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected index dd4546591..913f76d9a 100644 --- a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%000002de"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected index 25c8f2b6b..3250c524d 100644 --- a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%0000085d"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected index 6d2a3151e..0629b353e 100644 --- a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected @@ -122,6 +122,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assume {:captureState "%000002ef"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected index 99829cc76..c4bf5bdff 100644 --- a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000002ed"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected index 77e5a8d69..0bc19e613 100644 --- a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assume {:captureState "%000001c5"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected index 7c731bd2e..5b5dd8132 100644 --- a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected @@ -108,6 +108,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000889"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected index 80b631034..45344cd70 100644 --- a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected @@ -120,6 +120,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000002ef"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/clang/basicfree.expected b/src/test/correct/basicfree/clang/basicfree.expected index 9dcf5bd61..1c195a8fe 100644 --- a/src/test/correct/basicfree/clang/basicfree.expected +++ b/src/test/correct/basicfree/clang/basicfree.expected @@ -165,6 +165,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/clang_O2/basicfree.expected b/src/test/correct/basicfree/clang_O2/basicfree.expected index 658b3ad9b..93b294099 100644 --- a/src/test/correct/basicfree/clang_O2/basicfree.expected +++ b/src/test/correct/basicfree/clang_O2/basicfree.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected index d9acf1966..9d5f3ca54 100644 --- a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected +++ b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected @@ -165,6 +165,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/clang_pic/basicfree.expected b/src/test/correct/basicfree/clang_pic/basicfree.expected index d9acf1966..9d5f3ca54 100644 --- a/src/test/correct/basicfree/clang_pic/basicfree.expected +++ b/src/test/correct/basicfree/clang_pic/basicfree.expected @@ -165,6 +165,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/gcc/basicfree.expected b/src/test/correct/basicfree/gcc/basicfree.expected index f006ebff3..0cadc8de8 100644 --- a/src/test/correct/basicfree/gcc/basicfree.expected +++ b/src/test/correct/basicfree/gcc/basicfree.expected @@ -160,6 +160,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/gcc_O2/basicfree.expected b/src/test/correct/basicfree/gcc_O2/basicfree.expected index 628d250a1..678775285 100644 --- a/src/test/correct/basicfree/gcc_O2/basicfree.expected +++ b/src/test/correct/basicfree/gcc_O2/basicfree.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected index 62fa514c8..982cb091c 100644 --- a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected +++ b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected @@ -160,6 +160,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/basicfree/gcc_pic/basicfree.expected b/src/test/correct/basicfree/gcc_pic/basicfree.expected index 62fa514c8..982cb091c 100644 --- a/src/test/correct/basicfree/gcc_pic/basicfree.expected +++ b/src/test/correct/basicfree/gcc_pic/basicfree.expected @@ -160,6 +160,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/cjump/clang/cjump.expected b/src/test/correct/cjump/clang/cjump.expected index d0cdf6dcf..752d25473 100644 --- a/src/test/correct/cjump/clang/cjump.expected +++ b/src/test/correct/cjump/clang/cjump.expected @@ -176,7 +176,7 @@ implementation main() assume {:captureState "l00000369"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000343: assume {:captureState "lmain_goto_l00000343"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l00000349_goto_l0000037e"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000037e; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/cjump/clang_O2/cjump.expected b/src/test/correct/cjump/clang_O2/cjump.expected index a58745453..551e9de31 100644 --- a/src/test/correct/cjump/clang_O2/cjump.expected +++ b/src/test/correct/cjump/clang_O2/cjump.expected @@ -108,6 +108,9 @@ implementation main() assert (L(mem, bvadd64(R10, 56bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), Gamma_R11); assume {:captureState "%000002f1"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected b/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected index 72022dfd4..98abee50c 100644 --- a/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected +++ b/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected @@ -176,7 +176,7 @@ implementation main() assume {:captureState "l000009bf"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000999: assume {:captureState "lmain_goto_l00000999"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l0000099f_goto_l000009d4"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l000009d4; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/cjump/clang_pic/cjump.expected b/src/test/correct/cjump/clang_pic/cjump.expected index db408d8e8..0ef8aeb1b 100644 --- a/src/test/correct/cjump/clang_pic/cjump.expected +++ b/src/test/correct/cjump/clang_pic/cjump.expected @@ -150,7 +150,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000356, lmain_goto_l00000359; + goto lmain_goto_l00000359, lmain_goto_l00000356; l00000359: assume {:captureState "l00000359"} true; R8, Gamma_R8 := 1bv64, true; @@ -162,7 +162,7 @@ implementation main() l0000035c: assume {:captureState "l0000035c"} true; assert Gamma_R8; - goto l0000035c_goto_l00000364, l0000035c_goto_l00000398; + goto l0000035c_goto_l00000398, l0000035c_goto_l00000364; l00000364: assume {:captureState "l00000364"} true; R9, Gamma_R9 := 65536bv64, true; @@ -192,7 +192,7 @@ implementation main() assume {:captureState "l00000383"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000356: assume {:captureState "lmain_goto_l00000356"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -209,5 +209,8 @@ implementation main() assume {:captureState "l0000035c_goto_l00000398"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000398; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/cjump/gcc/cjump.expected b/src/test/correct/cjump/gcc/cjump.expected index ba9fc0dc9..6752e3f52 100644 --- a/src/test/correct/cjump/gcc/cjump.expected +++ b/src/test/correct/cjump/gcc/cjump.expected @@ -129,7 +129,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000033e, lmain_goto_l00000365; + goto lmain_goto_l00000365, lmain_goto_l0000033e; l0000033e: assume {:captureState "l0000033e"} true; R0, Gamma_R0 := 69632bv64, true; @@ -153,7 +153,7 @@ implementation main() l0000035b: assume {:captureState "l0000035b"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l0000033e: assume {:captureState "lmain_goto_l0000033e"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -162,5 +162,8 @@ implementation main() assume {:captureState "lmain_goto_l00000365"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000365; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/cjump/gcc_O2/cjump.expected b/src/test/correct/cjump/gcc_O2/cjump.expected index 0d59a5334..291b8cb80 100644 --- a/src/test/correct/cjump/gcc_O2/cjump.expected +++ b/src/test/correct/cjump/gcc_O2/cjump.expected @@ -106,6 +106,9 @@ implementation main() assert (L(mem, bvadd64(R1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 4bv64), Gamma_R2); assume {:captureState "%000001d0"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected index 634105831..5285c14a0 100644 --- a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected +++ b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected @@ -129,7 +129,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000097c, lmain_goto_l000009a3; + goto lmain_goto_l000009a3, lmain_goto_l0000097c; l0000097c: assume {:captureState "l0000097c"} true; R0, Gamma_R0 := 69632bv64, true; @@ -153,7 +153,7 @@ implementation main() l00000999: assume {:captureState "l00000999"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l0000097c: assume {:captureState "lmain_goto_l0000097c"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -162,5 +162,8 @@ implementation main() assume {:captureState "lmain_goto_l000009a3"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000009a3; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/cjump/gcc_pic/cjump.expected b/src/test/correct/cjump/gcc_pic/cjump.expected index 76d3d7e0e..2be57000d 100644 --- a/src/test/correct/cjump/gcc_pic/cjump.expected +++ b/src/test/correct/cjump/gcc_pic/cjump.expected @@ -167,7 +167,7 @@ implementation main() l0000035e: assume {:captureState "l0000035e"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l00000340: assume {:captureState "lmain_goto_l00000340"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -176,5 +176,8 @@ implementation main() assume {:captureState "lmain_goto_l00000368"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000368; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/function/clang/function.expected b/src/test/correct/function/clang/function.expected index cbf682fdd..7ed13beda 100644 --- a/src/test/correct/function/clang/function.expected +++ b/src/test/correct/function/clang/function.expected @@ -109,6 +109,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -172,6 +175,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/clang_O2/function.expected b/src/test/correct/function/clang_O2/function.expected index 2c9511907..b6c12cb9e 100644 --- a/src/test/correct/function/clang_O2/function.expected +++ b/src/test/correct/function/clang_O2/function.expected @@ -108,6 +108,9 @@ implementation main() assert (L(mem, bvadd64(R10, 56bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), Gamma_R11); assume {:captureState "%000002f9"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/clang_no_plt_no_pic/function.expected b/src/test/correct/function/clang_no_plt_no_pic/function.expected index cbf682fdd..7ed13beda 100644 --- a/src/test/correct/function/clang_no_plt_no_pic/function.expected +++ b/src/test/correct/function/clang_no_plt_no_pic/function.expected @@ -109,6 +109,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -172,6 +175,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/clang_pic/function.expected b/src/test/correct/function/clang_pic/function.expected index 05351a818..7952e48a1 100644 --- a/src/test/correct/function/clang_pic/function.expected +++ b/src/test/correct/function/clang_pic/function.expected @@ -115,6 +115,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -186,6 +189,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/gcc/function.expected b/src/test/correct/function/gcc/function.expected index 7acf13282..d5a425fca 100644 --- a/src/test/correct/function/gcc/function.expected +++ b/src/test/correct/function/gcc/function.expected @@ -108,6 +108,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -174,6 +177,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/gcc_O2/function.expected b/src/test/correct/function/gcc_O2/function.expected index bca56db7f..dc4448031 100644 --- a/src/test/correct/function/gcc_O2/function.expected +++ b/src/test/correct/function/gcc_O2/function.expected @@ -106,6 +106,9 @@ implementation main() assert (L(mem, bvadd64(R1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 4bv64), Gamma_R2); assume {:captureState "%000001e4"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/gcc_no_plt_no_pic/function.expected b/src/test/correct/function/gcc_no_plt_no_pic/function.expected index 7acf13282..d5a425fca 100644 --- a/src/test/correct/function/gcc_no_plt_no_pic/function.expected +++ b/src/test/correct/function/gcc_no_plt_no_pic/function.expected @@ -108,6 +108,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -174,6 +177,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function/gcc_pic/function.expected b/src/test/correct/function/gcc_pic/function.expected index 7dc0369c7..2e2c8a1a5 100644 --- a/src/test/correct/function/gcc_pic/function.expected +++ b/src/test/correct/function/gcc_pic/function.expected @@ -114,6 +114,9 @@ implementation get_two() lget_two: assume {:captureState "lget_two"} true; R0, Gamma_R0 := 2bv64, true; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -186,6 +189,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/clang/function1.expected b/src/test/correct/function1/clang/function1.expected index bd56d178a..a5db464a4 100644 --- a/src/test/correct/function1/clang/function1.expected +++ b/src/test/correct/function1/clang/function1.expected @@ -144,6 +144,9 @@ implementation get_two() R8, Gamma_R8 := bvadd64(R8, sign_extend32_32(R9[32:0])), (Gamma_R9 && Gamma_R8); R0, Gamma_R0 := zero_extend32_32(R8[32:0]), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -213,6 +216,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/clang_O2/function1.expected b/src/test/correct/function1/clang_O2/function1.expected index b409938cf..78be239db 100644 --- a/src/test/correct/function1/clang_O2/function1.expected +++ b/src/test/correct/function1/clang_O2/function1.expected @@ -144,6 +144,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/clang_no_plt_no_pic/function1.expected b/src/test/correct/function1/clang_no_plt_no_pic/function1.expected index c08b53e66..94eedf788 100644 --- a/src/test/correct/function1/clang_no_plt_no_pic/function1.expected +++ b/src/test/correct/function1/clang_no_plt_no_pic/function1.expected @@ -144,6 +144,9 @@ implementation get_two() R8, Gamma_R8 := bvadd64(R8, sign_extend32_32(R9[32:0])), (Gamma_R9 && Gamma_R8); R0, Gamma_R0 := zero_extend32_32(R8[32:0]), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -213,6 +216,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/clang_pic/function1.expected b/src/test/correct/function1/clang_pic/function1.expected index 460f00f06..b029d5d40 100644 --- a/src/test/correct/function1/clang_pic/function1.expected +++ b/src/test/correct/function1/clang_pic/function1.expected @@ -150,6 +150,9 @@ implementation get_two() R8, Gamma_R8 := bvadd64(R8, sign_extend32_32(R9[32:0])), (Gamma_R9 && Gamma_R8); R0, Gamma_R0 := zero_extend32_32(R8[32:0]), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -227,6 +230,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/gcc/function1.expected b/src/test/correct/function1/gcc/function1.expected index c8a75de3d..bb993e876 100644 --- a/src/test/correct/function1/gcc/function1.expected +++ b/src/test/correct/function1/gcc/function1.expected @@ -172,6 +172,9 @@ implementation get_two() R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -269,6 +272,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/gcc_O2/function1.expected b/src/test/correct/function1/gcc_O2/function1.expected index 7f1e3d2a7..ef4532309 100644 --- a/src/test/correct/function1/gcc_O2/function1.expected +++ b/src/test/correct/function1/gcc_O2/function1.expected @@ -210,6 +210,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected b/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected index a6bc0b7f5..ceca97b40 100644 --- a/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected +++ b/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected @@ -172,6 +172,9 @@ implementation get_two() R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -269,6 +272,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/function1/gcc_pic/function1.expected b/src/test/correct/function1/gcc_pic/function1.expected index e8785a70e..883b6689e 100644 --- a/src/test/correct/function1/gcc_pic/function1.expected +++ b/src/test/correct/function1/gcc_pic/function1.expected @@ -178,6 +178,9 @@ implementation get_two() R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto get_two_return; + get_two_return: + assume {:captureState "get_two_return"} true; return; } @@ -282,6 +285,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/functions_with_params/clang/functions_with_params.expected b/src/test/correct/functions_with_params/clang/functions_with_params.expected index 8457da0ee..04b66fbbb 100644 --- a/src/test/correct/functions_with_params/clang/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang/functions_with_params.expected @@ -141,6 +141,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -175,6 +178,9 @@ implementation plus_one() R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected b/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected index 3ac2427ae..cf73f1c66 100644 --- a/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected index ee1683ebc..f1bd9b72d 100644 --- a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected @@ -141,6 +141,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -175,6 +178,9 @@ implementation plus_one() R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected b/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected index ee1683ebc..f1bd9b72d 100644 --- a/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected @@ -141,6 +141,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -175,6 +178,9 @@ implementation plus_one() R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/functions_with_params/gcc/functions_with_params.expected b/src/test/correct/functions_with_params/gcc/functions_with_params.expected index c0d99c4a2..b9934243b 100644 --- a/src/test/correct/functions_with_params/gcc/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc/functions_with_params.expected @@ -136,6 +136,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -170,6 +173,9 @@ implementation plus_one() R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected index 3a93588d6..9268e9b2b 100644 --- a/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected index 6c154344e..97b8bcb68 100644 --- a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected @@ -136,6 +136,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -170,6 +173,9 @@ implementation plus_one() R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected index 6c154344e..97b8bcb68 100644 --- a/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected @@ -136,6 +136,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -170,6 +173,9 @@ implementation plus_one() R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto plus_one_return; + plus_one_return: + assume {:captureState "plus_one_return"} true; return; } diff --git a/src/test/correct/ifbranches/clang/ifbranches.expected b/src/test/correct/ifbranches/clang/ifbranches.expected index c0067a67f..82749e80d 100644 --- a/src/test/correct/ifbranches/clang/ifbranches.expected +++ b/src/test/correct/ifbranches/clang/ifbranches.expected @@ -172,7 +172,7 @@ implementation main() assume {:captureState "%00000383"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000034c: assume {:captureState "lmain_goto_l0000034c"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -189,5 +189,8 @@ implementation main() assume {:captureState "l00000352_goto_l00000397"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000397; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/clang_O2/ifbranches.expected b/src/test/correct/ifbranches/clang_O2/ifbranches.expected index ccfb7c037..573cc292a 100644 --- a/src/test/correct/ifbranches/clang_O2/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_O2/ifbranches.expected @@ -105,7 +105,7 @@ implementation main() goto l000002e2; l000002e2: assume {:captureState "l000002e2"} true; - return; + goto main_return; lmain_goto_l000002db: assume {:captureState "lmain_goto_l000002db"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -114,5 +114,8 @@ implementation main() assume {:captureState "lmain_goto_l000002df"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000002df; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected index 8d82b2768..896b4800a 100644 --- a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected @@ -172,7 +172,7 @@ implementation main() assume {:captureState "%000009ef"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000009b8: assume {:captureState "lmain_goto_l000009b8"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -189,5 +189,8 @@ implementation main() assume {:captureState "l000009be_goto_l00000a03"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000a03; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/clang_pic/ifbranches.expected b/src/test/correct/ifbranches/clang_pic/ifbranches.expected index 8d82b2768..896b4800a 100644 --- a/src/test/correct/ifbranches/clang_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_pic/ifbranches.expected @@ -172,7 +172,7 @@ implementation main() assume {:captureState "%000009ef"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000009b8: assume {:captureState "lmain_goto_l000009b8"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -189,5 +189,8 @@ implementation main() assume {:captureState "l000009be_goto_l00000a03"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000a03; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/gcc/ifbranches.expected b/src/test/correct/ifbranches/gcc/ifbranches.expected index ac1bec839..0c1ad49a2 100644 --- a/src/test/correct/ifbranches/gcc/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc/ifbranches.expected @@ -131,7 +131,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000330, lmain_goto_l00000369; + goto lmain_goto_l00000369, lmain_goto_l00000330; l00000330: assume {:captureState "l00000330"} true; R0, Gamma_R0 := 2bv64, true; @@ -152,7 +152,7 @@ implementation main() assume {:captureState "%00000355"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000330: assume {:captureState "lmain_goto_l00000330"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -161,5 +161,8 @@ implementation main() assume {:captureState "lmain_goto_l00000369"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000369; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/gcc_O2/ifbranches.expected b/src/test/correct/ifbranches/gcc_O2/ifbranches.expected index 8ac961753..6a1edc35e 100644 --- a/src/test/correct/ifbranches/gcc_O2/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_O2/ifbranches.expected @@ -103,7 +103,7 @@ implementation main() l000001c9: assume {:captureState "l000001c9"} true; R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 2bv32)), Gamma_R0; - return; + goto main_return; lmain_goto_l000001c3: assume {:captureState "lmain_goto_l000001c3"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -112,5 +112,8 @@ implementation main() assume {:captureState "lmain_goto_l000001c6"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000001c6; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected index c53ffab7b..a023fc70b 100644 --- a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected @@ -152,7 +152,7 @@ implementation main() assume {:captureState "%00000988"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000963: assume {:captureState "lmain_goto_l00000963"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -161,5 +161,8 @@ implementation main() assume {:captureState "lmain_goto_l0000099c"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000099c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifbranches/gcc_pic/ifbranches.expected b/src/test/correct/ifbranches/gcc_pic/ifbranches.expected index c53ffab7b..a023fc70b 100644 --- a/src/test/correct/ifbranches/gcc_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_pic/ifbranches.expected @@ -152,7 +152,7 @@ implementation main() assume {:captureState "%00000988"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000963: assume {:captureState "lmain_goto_l00000963"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -161,5 +161,8 @@ implementation main() assume {:captureState "lmain_goto_l0000099c"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000099c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/clang/ifglobal.expected b/src/test/correct/ifglobal/clang/ifglobal.expected index 1200382ed..4f9a5c230 100644 --- a/src/test/correct/ifglobal/clang/ifglobal.expected +++ b/src/test/correct/ifglobal/clang/ifglobal.expected @@ -158,7 +158,7 @@ implementation main() assume {:captureState "l0000032c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000031e: assume {:captureState "lmain_goto_l0000031e"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -175,5 +175,8 @@ implementation main() assume {:captureState "l00000324_goto_l00000343"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000343; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/clang_O2/ifglobal.expected b/src/test/correct/ifglobal/clang_O2/ifglobal.expected index 28eaf250b..782eeaf4d 100644 --- a/src/test/correct/ifglobal/clang_O2/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_O2/ifglobal.expected @@ -106,11 +106,11 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assume {:captureState "%000002ec"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; l000002f8: assume {:captureState "l000002f8"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l000002dc: assume {:captureState "lmain_goto_l000002dc"} true; assume (bvcomp32(R9[32:0], 0bv32) != 0bv1); @@ -119,5 +119,8 @@ implementation main() assume {:captureState "lmain_goto_l000002f8"} true; assume (bvcomp32(R9[32:0], 0bv32) == 0bv1); goto l000002f8; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected index e27dcdecd..a2cf3c86a 100644 --- a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected @@ -129,7 +129,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000092d, lmain_goto_l00000930; + goto lmain_goto_l00000930, lmain_goto_l0000092d; l00000930: assume {:captureState "l00000930"} true; R8, Gamma_R8 := 1bv64, true; @@ -158,7 +158,7 @@ implementation main() assume {:captureState "l0000093b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000092d: assume {:captureState "lmain_goto_l0000092d"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -175,5 +175,8 @@ implementation main() assume {:captureState "l00000933_goto_l00000952"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000952; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/clang_pic/ifglobal.expected b/src/test/correct/ifglobal/clang_pic/ifglobal.expected index 7d2806261..c9631ddb9 100644 --- a/src/test/correct/ifglobal/clang_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_pic/ifglobal.expected @@ -138,7 +138,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000032d, lmain_goto_l00000330; + goto lmain_goto_l00000330, lmain_goto_l0000032d; l00000330: assume {:captureState "l00000330"} true; R8, Gamma_R8 := 1bv64, true; @@ -169,7 +169,7 @@ implementation main() assume {:captureState "l0000033b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000032d: assume {:captureState "lmain_goto_l0000032d"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -186,5 +186,8 @@ implementation main() assume {:captureState "l00000333_goto_l00000352"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000352; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/gcc/ifglobal.expected b/src/test/correct/ifglobal/gcc/ifglobal.expected index 3a8aab8e8..cc675c447 100644 --- a/src/test/correct/ifglobal/gcc/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc/ifglobal.expected @@ -118,7 +118,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000302, lmain_goto_l00000311; + goto lmain_goto_l00000311, lmain_goto_l00000302; l00000311: assume {:captureState "l00000311"} true; R0, Gamma_R0 := 69632bv64, true; @@ -132,7 +132,7 @@ implementation main() l00000302: assume {:captureState "l00000302"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l00000302: assume {:captureState "lmain_goto_l00000302"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -141,5 +141,8 @@ implementation main() assume {:captureState "lmain_goto_l00000311"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000311; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/gcc_O2/ifglobal.expected b/src/test/correct/ifglobal/gcc_O2/ifglobal.expected index da48f81dc..06ad1b8f1 100644 --- a/src/test/correct/ifglobal/gcc_O2/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_O2/ifglobal.expected @@ -108,7 +108,7 @@ implementation main() l000001b7: assume {:captureState "l000001b7"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l000001b7: assume {:captureState "lmain_goto_l000001b7"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) != 0bv1); @@ -117,5 +117,8 @@ implementation main() assume {:captureState "lmain_goto_l00000396"} true; assume (bvnot1(bvcomp32(R1[32:0], 0bv32)) == 0bv1); goto l00000396; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected index 3aaf2a46f..6d2e955fa 100644 --- a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected @@ -118,7 +118,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000008d6, lmain_goto_l000008e5; + goto lmain_goto_l000008e5, lmain_goto_l000008d6; l000008e5: assume {:captureState "l000008e5"} true; R0, Gamma_R0 := 69632bv64, true; @@ -132,7 +132,7 @@ implementation main() l000008d6: assume {:captureState "l000008d6"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l000008d6: assume {:captureState "lmain_goto_l000008d6"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -141,5 +141,8 @@ implementation main() assume {:captureState "lmain_goto_l000008e5"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000008e5; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/ifglobal/gcc_pic/ifglobal.expected b/src/test/correct/ifglobal/gcc_pic/ifglobal.expected index 3a0d2e99f..e29207861 100644 --- a/src/test/correct/ifglobal/gcc_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_pic/ifglobal.expected @@ -141,7 +141,7 @@ implementation main() l00000303: assume {:captureState "l00000303"} true; R0, Gamma_R0 := 0bv64, true; - return; + goto main_return; lmain_goto_l00000303: assume {:captureState "lmain_goto_l00000303"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -150,5 +150,8 @@ implementation main() assume {:captureState "lmain_goto_l00000312"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000312; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/indirect_call/clang_O2/indirect_call.expected b/src/test/correct/indirect_call/clang_O2/indirect_call.expected index c52d56929..1238c47a9 100644 --- a/src/test/correct/indirect_call/clang_O2/indirect_call.expected +++ b/src/test/correct/indirect_call/clang_O2/indirect_call.expected @@ -248,6 +248,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/indirect_call/gcc_O2/indirect_call.expected b/src/test/correct/indirect_call/gcc_O2/indirect_call.expected index 7e84f91bc..bd669b91c 100644 --- a/src/test/correct/indirect_call/gcc_O2/indirect_call.expected +++ b/src/test/correct/indirect_call/gcc_O2/indirect_call.expected @@ -237,6 +237,9 @@ implementation greet() R0, Gamma_R0 := bvadd64(R0, 1992bv64), Gamma_R0; call puts(); assume false; //no return target + greet_return: + assume {:captureState "greet_return"} true; + return; } procedure main(); @@ -389,6 +392,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/clang/initialisation.expected b/src/test/correct/initialisation/clang/initialisation.expected index 19ae309d0..ecea71deb 100644 --- a/src/test/correct/initialisation/clang/initialisation.expected +++ b/src/test/correct/initialisation/clang/initialisation.expected @@ -190,6 +190,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 52bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assume {:captureState "%00000381"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/clang_O2/initialisation.expected b/src/test/correct/initialisation/clang_O2/initialisation.expected index 12558980d..506f69b92 100644 --- a/src/test/correct/initialisation/clang_O2/initialisation.expected +++ b/src/test/correct/initialisation/clang_O2/initialisation.expected @@ -176,6 +176,9 @@ implementation main() assert (L(mem, bvadd64(R12, 52bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R12, 52bv64), R10[8:0]), gamma_store8(Gamma_mem, bvadd64(R12, 52bv64), Gamma_R10); assume {:captureState "%00000367"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected index 1a8bd119b..c1ab572b1 100644 --- a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected +++ b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected @@ -190,6 +190,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 52bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assume {:captureState "%000009c9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/clang_pic/initialisation.expected b/src/test/correct/initialisation/clang_pic/initialisation.expected index 9e95130d8..2e1916a59 100644 --- a/src/test/correct/initialisation/clang_pic/initialisation.expected +++ b/src/test/correct/initialisation/clang_pic/initialisation.expected @@ -206,6 +206,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); assume {:captureState "%0000039a"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/gcc/initialisation.expected b/src/test/correct/initialisation/gcc/initialisation.expected index 01a4e5c28..8b56af7c1 100644 --- a/src/test/correct/initialisation/gcc/initialisation.expected +++ b/src/test/correct/initialisation/gcc/initialisation.expected @@ -174,6 +174,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000003d6"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/gcc_O2/initialisation.expected b/src/test/correct/initialisation/gcc_O2/initialisation.expected index 2e931610a..08833f10a 100644 --- a/src/test/correct/initialisation/gcc_O2/initialisation.expected +++ b/src/test/correct/initialisation/gcc_O2/initialisation.expected @@ -205,6 +205,9 @@ implementation main() assert (L(mem, bvadd64(R1, 24bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R1, 24bv64), R2[8:0]), gamma_store8(Gamma_mem, bvadd64(R1, 24bv64), Gamma_R2); assume {:captureState "%0000020a"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected index 54d544e1d..27d4aef2a 100644 --- a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected +++ b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected @@ -174,6 +174,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000a89"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/initialisation/gcc_pic/initialisation.expected b/src/test/correct/initialisation/gcc_pic/initialisation.expected index 36dbed728..448645b69 100644 --- a/src/test/correct/initialisation/gcc_pic/initialisation.expected +++ b/src/test/correct/initialisation/gcc_pic/initialisation.expected @@ -194,6 +194,9 @@ implementation main() mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000003de"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/jumptable/clang_O2/jumptable.expected b/src/test/correct/jumptable/clang_O2/jumptable.expected index 56e298df9..d1c506acf 100644 --- a/src/test/correct/jumptable/clang_O2/jumptable.expected +++ b/src/test/correct/jumptable/clang_O2/jumptable.expected @@ -122,6 +122,9 @@ implementation main() assert (L(mem, bvadd64(R8, 48bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 48bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 48bv64), Gamma_R9); assume {:captureState "%00000378"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/jumptable/gcc_O2/jumptable.expected b/src/test/correct/jumptable/gcc_O2/jumptable.expected index e5a14e88e..21747ef7e 100644 --- a/src/test/correct/jumptable/gcc_O2/jumptable.expected +++ b/src/test/correct/jumptable/gcc_O2/jumptable.expected @@ -119,6 +119,9 @@ implementation add_six() assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); assume {:captureState "%00000252"} true; + goto add_six_return; + add_six_return: + assume {:captureState "add_six_return"} true; return; } @@ -153,6 +156,9 @@ implementation add_two() assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); assume {:captureState "%00000233"} true; + goto add_two_return; + add_two_return: + assume {:captureState "add_two_return"} true; return; } @@ -231,6 +237,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -265,6 +274,9 @@ implementation sub_seven() assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); assume {:captureState "%00000275"} true; + goto sub_seven_return; + sub_seven_return: + assume {:captureState "sub_seven_return"} true; return; } diff --git a/src/test/correct/jumptable3/gcc/jumptable3.expected b/src/test/correct/jumptable3/gcc/jumptable3.expected index 48aac8bf5..f8daceebb 100644 --- a/src/test/correct/jumptable3/gcc/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc/jumptable3.expected @@ -126,6 +126,9 @@ implementation add_six() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000511"} true; + goto add_six_return; + add_six_return: + assume {:captureState "add_six_return"} true; return; } @@ -163,6 +166,9 @@ implementation add_two() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000004df"} true; + goto add_two_return; + add_two_return: + assume {:captureState "add_two_return"} true; return; } @@ -286,7 +292,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#5, 1bv32), 0bv32), Gamma_#5; NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; assert Gamma_ZF; - goto lmain_goto_l00000599, lmain_goto_l000005e0; + goto lmain_goto_l000005e0, lmain_goto_l00000599; l000005e0: assume {:captureState "l000005e0"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -354,7 +360,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#9, 1bv32), 0bv32), Gamma_#9; NF, Gamma_NF := bvadd32(#9, 1bv32)[32:31], Gamma_#9; assert Gamma_ZF; - goto l0000066b_goto_l0000068c, l0000066b_goto_l000006a3; + goto l0000066b_goto_l000006a3, l0000066b_goto_l0000068c; l0000068c: assume {:captureState "l0000068c"} true; R30, Gamma_R30 := 2276bv64, true; @@ -387,7 +393,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l000006cb_goto_l000006ec, l000006cb_goto_l00000703; + goto l000006cb_goto_l00000703, l000006cb_goto_l000006ec; l00000703: assume {:captureState "l00000703"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -397,7 +403,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#12, 1bv32), 0bv32), Gamma_#12; NF, Gamma_NF := bvadd32(#12, 1bv32)[32:31], Gamma_#12; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000703_goto_l000005d7, l00000703_goto_l0000072b; + goto l00000703_goto_l0000072b, l00000703_goto_l000005d7; l0000072b: assume {:captureState "l0000072b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -407,7 +413,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#13, 1bv32), 0bv32), Gamma_#13; NF, Gamma_NF := bvadd32(#13, 1bv32)[32:31], Gamma_#13; assert Gamma_ZF; - goto l0000072b_goto_l0000074c, l0000072b_goto_l00000758; + goto l0000072b_goto_l00000758, l0000072b_goto_l0000074c; l00000758: assume {:captureState "l00000758"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -437,7 +443,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#16, 1bv32), 0bv32), Gamma_#16; NF, Gamma_NF := bvadd32(#16, 1bv32)[32:31], Gamma_#16; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000007ad_goto_l000005d7, l000007ad_goto_l000007d5; + goto l000007ad_goto_l000007d5, l000007ad_goto_l000005d7; l000007d5: assume {:captureState "l000007d5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -447,7 +453,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#17, 1bv32), 0bv32), Gamma_#17; NF, Gamma_NF := bvadd32(#17, 1bv32)[32:31], Gamma_#17; assert Gamma_ZF; - goto l000007d5_goto_l000007f6, l000007d5_goto_l00000809; + goto l000007d5_goto_l00000809, l000007d5_goto_l000007f6; l000007f6: assume {:captureState "l000007f6"} true; R30, Gamma_R30 := 2248bv64, true; @@ -490,7 +496,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#18, 1bv32), 0bv32), Gamma_#18; NF, Gamma_NF := bvadd32(#18, 1bv32)[32:31], Gamma_#18; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000809_goto_l000005d7, l00000809_goto_l00000831; + goto l00000809_goto_l00000831, l00000809_goto_l000005d7; l00000831: assume {:captureState "l00000831"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -500,7 +506,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#19, 1bv32), 0bv32), Gamma_#19; NF, Gamma_NF := bvadd32(#19, 1bv32)[32:31], Gamma_#19; assert Gamma_ZF; - goto l00000831_goto_l00000852, l00000831_goto_l00000862; + goto l00000831_goto_l00000862, l00000831_goto_l00000852; l00000852: assume {:captureState "l00000852"} true; R30, Gamma_R30 := 2240bv64, true; @@ -551,7 +557,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#22, 1bv32), 0bv32), Gamma_#22; NF, Gamma_NF := bvadd32(#22, 1bv32)[32:31], Gamma_#22; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000008c2_goto_l000005d7, l000008c2_goto_l000008ea; + goto l000008c2_goto_l000008ea, l000008c2_goto_l000005d7; l000008ea: assume {:captureState "l000008ea"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -571,7 +577,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#24, 1bv32), 0bv32), Gamma_#24; NF, Gamma_NF := bvadd32(#24, 1bv32)[32:31], Gamma_#24; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000091b_goto_l000005d7, l0000091b_goto_l00000943; + goto l0000091b_goto_l00000943, l0000091b_goto_l000005d7; l00000943: assume {:captureState "l00000943"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -581,7 +587,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#25, 1bv32), 0bv32), Gamma_#25; NF, Gamma_NF := bvadd32(#25, 1bv32)[32:31], Gamma_#25; assert Gamma_ZF; - goto l00000943_goto_l00000964, l00000943_goto_l0000097b; + goto l00000943_goto_l0000097b, l00000943_goto_l00000964; l00000964: assume {:captureState "l00000964"} true; R30, Gamma_R30 := 2208bv64, true; @@ -599,7 +605,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#26, 1bv32), 0bv32), Gamma_#26; NF, Gamma_NF := bvadd32(#26, 1bv32)[32:31], Gamma_#26; assert Gamma_ZF; - goto l0000097b_goto_l00000974, l0000097b_goto_l000009a1; + goto l0000097b_goto_l000009a1, l0000097b_goto_l00000974; l00000974: assume {:captureState "l00000974"} true; R30, Gamma_R30 := 2216bv64, true; @@ -632,7 +638,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000599: assume {:captureState "lmain_goto_l00000599"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -809,6 +815,9 @@ implementation main() assume {:captureState "l0000097b_goto_l000009a1"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000009a1; + main_return: + assume {:captureState "main_return"} true; + return; } procedure sub_seven(); @@ -845,6 +854,9 @@ implementation sub_seven() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000543"} true; + goto sub_seven_return; + sub_seven_return: + assume {:captureState "sub_seven_return"} true; return; } diff --git a/src/test/correct/jumptable3/gcc_O2/jumptable3.expected b/src/test/correct/jumptable3/gcc_O2/jumptable3.expected index be4f9228a..bb7c003c0 100644 --- a/src/test/correct/jumptable3/gcc_O2/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_O2/jumptable3.expected @@ -155,7 +155,7 @@ implementation main() l00000753: assume {:captureState "l00000753"} true; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000753_goto_l000006e8, l00000753_goto_l0000075c; + goto l00000753_goto_l0000075c, l00000753_goto_l000006e8; l000006e8: assume {:captureState "l000006e8"} true; R1, Gamma_R1 := 69632bv64, true; @@ -188,7 +188,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#6, 1bv32), 0bv32), Gamma_#6; NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; assert Gamma_ZF; - goto l00000644_goto_l00000331, l00000644_goto_l00000663; + goto l00000644_goto_l00000663, l00000644_goto_l00000331; l00000663: assume {:captureState "l00000663"} true; #7, Gamma_#7 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; @@ -197,7 +197,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#7, 1bv32), 0bv32), Gamma_#7; NF, Gamma_NF := bvadd32(#7, 1bv32)[32:31], Gamma_#7; assert Gamma_ZF; - goto l00000663_goto_l0000036b, l00000663_goto_l00000347; + goto l00000663_goto_l00000347, l00000663_goto_l0000036b; l00000715: assume {:captureState "l00000715"} true; #9, Gamma_#9 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; @@ -244,7 +244,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l0000075c_goto_l0000069c, l0000075c_goto_l0000077b; + goto l0000075c_goto_l0000077b, l0000075c_goto_l0000069c; l0000069c: assume {:captureState "l0000069c"} true; R1, Gamma_R1 := 69632bv64, true; @@ -259,7 +259,7 @@ implementation main() l0000077b: assume {:captureState "l0000077b"} true; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000077b_goto_l000005bc, l0000077b_goto_l00000784; + goto l0000077b_goto_l00000784, l0000077b_goto_l000005bc; l000005bc: assume {:captureState "l000005bc"} true; #5, Gamma_#5 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; @@ -268,7 +268,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#5, 1bv32), 0bv32), Gamma_#5; NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; assert Gamma_ZF; - goto l000005bc_goto_l000005d6, l000005bc_goto_l00000682; + goto l000005bc_goto_l00000682, l000005bc_goto_l000005d6; l000005d6: assume {:captureState "l000005d6"} true; R1, Gamma_R1 := 69632bv64, true; @@ -349,15 +349,15 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#13, 1bv32), 0bv32), Gamma_#13; NF, Gamma_NF := bvadd32(#13, 1bv32)[32:31], Gamma_#13; assert Gamma_ZF; - goto l000007a8_goto_l00000368, l000007a8_goto_l000006d0; + goto l000007a8_goto_l000006d0, l000007a8_goto_l00000368; l00000368: assume {:captureState "l00000368"} true; assert Gamma_R0; - goto l00000368_goto_l0000036b, l00000368_goto_l000005a3; + goto l00000368_goto_l000005a3, l00000368_goto_l0000036b; l0000036b: assume {:captureState "l0000036b"} true; R0, Gamma_R0 := 1bv64, true; - return; + goto main_return; l000005a3: assume {:captureState "l000005a3"} true; call rely(); @@ -380,7 +380,7 @@ implementation main() goto l00000360; l00000360: assume {:captureState "l00000360"} true; - return; + goto main_return; lmain_goto_l00000317: assume {:captureState "lmain_goto_l00000317"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -493,5 +493,8 @@ implementation main() assume {:captureState "l00000368_goto_l000005a3"} true; assume (bvnot1(bvcomp32(R0[32:0], 0bv32)) == 0bv1); goto l000005a3; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected index d3074e769..430488687 100644 --- a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected @@ -126,6 +126,9 @@ implementation add_six() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%0000126c"} true; + goto add_six_return; + add_six_return: + assume {:captureState "add_six_return"} true; return; } @@ -163,6 +166,9 @@ implementation add_two() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%0000123a"} true; + goto add_two_return; + add_two_return: + assume {:captureState "add_two_return"} true; return; } @@ -286,7 +292,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#5, 1bv32), 0bv32), Gamma_#5; NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; assert Gamma_ZF; - goto lmain_goto_l000012f4, lmain_goto_l0000133b; + goto lmain_goto_l0000133b, lmain_goto_l000012f4; l0000133b: assume {:captureState "l0000133b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -296,7 +302,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#6, 1bv32), 0bv32), Gamma_#6; NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000133b_goto_l00001332, l0000133b_goto_l00001363; + goto l0000133b_goto_l00001363, l0000133b_goto_l00001332; l00001363: assume {:captureState "l00001363"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -306,7 +312,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#7, 1bv32), 0bv32), Gamma_#7; NF, Gamma_NF := bvadd32(#7, 1bv32)[32:31], Gamma_#7; assert Gamma_ZF; - goto l00001363_goto_l00001384, l00001363_goto_l0000139e; + goto l00001363_goto_l0000139e, l00001363_goto_l00001384; l00001384: assume {:captureState "l00001384"} true; R30, Gamma_R30 := 2288bv64, true; @@ -344,7 +350,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#8, 1bv32), 0bv32), Gamma_#8; NF, Gamma_NF := bvadd32(#8, 1bv32)[32:31], Gamma_#8; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000139e_goto_l00001332, l0000139e_goto_l000013c6; + goto l0000139e_goto_l000013c6, l0000139e_goto_l00001332; l000013c6: assume {:captureState "l000013c6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -387,7 +393,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l00001426_goto_l00001447, l00001426_goto_l0000145e; + goto l00001426_goto_l0000145e, l00001426_goto_l00001447; l0000145e: assume {:captureState "l0000145e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -397,7 +403,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#12, 1bv32), 0bv32), Gamma_#12; NF, Gamma_NF := bvadd32(#12, 1bv32)[32:31], Gamma_#12; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000145e_goto_l00001332, l0000145e_goto_l00001486; + goto l0000145e_goto_l00001486, l0000145e_goto_l00001332; l00001486: assume {:captureState "l00001486"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -427,7 +433,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#15, 1bv32), 0bv32), Gamma_#15; NF, Gamma_NF := bvadd32(#15, 1bv32)[32:31], Gamma_#15; assert Gamma_ZF; - goto l000014db_goto_l000014fc, l000014db_goto_l00001508; + goto l000014db_goto_l00001508, l000014db_goto_l000014fc; l00001508: assume {:captureState "l00001508"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -447,7 +453,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#17, 1bv32), 0bv32), Gamma_#17; NF, Gamma_NF := bvadd32(#17, 1bv32)[32:31], Gamma_#17; assert Gamma_ZF; - goto l00001530_goto_l00001551, l00001530_goto_l00001564; + goto l00001530_goto_l00001564, l00001530_goto_l00001551; l00001551: assume {:captureState "l00001551"} true; R30, Gamma_R30 := 2248bv64, true; @@ -490,7 +496,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#18, 1bv32), 0bv32), Gamma_#18; NF, Gamma_NF := bvadd32(#18, 1bv32)[32:31], Gamma_#18; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00001564_goto_l00001332, l00001564_goto_l0000158c; + goto l00001564_goto_l0000158c, l00001564_goto_l00001332; l0000158c: assume {:captureState "l0000158c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -500,7 +506,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#19, 1bv32), 0bv32), Gamma_#19; NF, Gamma_NF := bvadd32(#19, 1bv32)[32:31], Gamma_#19; assert Gamma_ZF; - goto l0000158c_goto_l000015ad, l0000158c_goto_l000015bd; + goto l0000158c_goto_l000015bd, l0000158c_goto_l000015ad; l000015ad: assume {:captureState "l000015ad"} true; R30, Gamma_R30 := 2240bv64, true; @@ -518,7 +524,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#20, 1bv32), 0bv32), Gamma_#20; NF, Gamma_NF := bvadd32(#20, 1bv32)[32:31], Gamma_#20; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000015bd_goto_l00001332, l000015bd_goto_l000015e5; + goto l000015bd_goto_l000015e5, l000015bd_goto_l00001332; l000015e5: assume {:captureState "l000015e5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -528,7 +534,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#21, 1bv32), 0bv32), Gamma_#21; NF, Gamma_NF := bvadd32(#21, 1bv32)[32:31], Gamma_#21; assert Gamma_ZF; - goto l000015e5_goto_l00001606, l000015e5_goto_l0000161d; + goto l000015e5_goto_l0000161d, l000015e5_goto_l00001606; l00001606: assume {:captureState "l00001606"} true; R30, Gamma_R30 := 2228bv64, true; @@ -561,7 +567,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#23, 1bv32), 0bv32), Gamma_#23; NF, Gamma_NF := bvadd32(#23, 1bv32)[32:31], Gamma_#23; assert Gamma_ZF; - goto l00001645_goto_l00001666, l00001645_goto_l00001676; + goto l00001645_goto_l00001676, l00001645_goto_l00001666; l00001676: assume {:captureState "l00001676"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -632,7 +638,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000012f4: assume {:captureState "lmain_goto_l000012f4"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -809,6 +815,9 @@ implementation main() assume {:captureState "l000016d6_goto_l000016fc"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000016fc; + main_return: + assume {:captureState "main_return"} true; + return; } procedure sub_seven(); @@ -845,6 +854,9 @@ implementation sub_seven() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%0000129e"} true; + goto sub_seven_return; + sub_seven_return: + assume {:captureState "sub_seven_return"} true; return; } diff --git a/src/test/correct/jumptable3/gcc_pic/jumptable3.expected b/src/test/correct/jumptable3/gcc_pic/jumptable3.expected index 1a665e115..95c915903 100644 --- a/src/test/correct/jumptable3/gcc_pic/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_pic/jumptable3.expected @@ -131,6 +131,9 @@ implementation add_six() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000515"} true; + goto add_six_return; + add_six_return: + assume {:captureState "add_six_return"} true; return; } @@ -172,6 +175,9 @@ implementation add_two() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000004e1"} true; + goto add_two_return; + add_two_return: + assume {:captureState "add_two_return"} true; return; } @@ -297,7 +303,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#5, 1bv32), 0bv32), Gamma_#5; NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; assert Gamma_ZF; - goto lmain_goto_l0000059f, lmain_goto_l000005e7; + goto lmain_goto_l000005e7, lmain_goto_l0000059f; l000005e7: assume {:captureState "l000005e7"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -388,7 +394,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#10, 1bv32), 0bv32), Gamma_#10; NF, Gamma_NF := bvadd32(#10, 1bv32)[32:31], Gamma_#10; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000006aa_goto_l000005de, l000006aa_goto_l000006d2; + goto l000006aa_goto_l000006d2, l000006aa_goto_l000005de; l000006d2: assume {:captureState "l000006d2"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -398,7 +404,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l000006d2_goto_l000006f3, l000006d2_goto_l0000070a; + goto l000006d2_goto_l0000070a, l000006d2_goto_l000006f3; l0000070a: assume {:captureState "l0000070a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -418,7 +424,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#13, 1bv32), 0bv32), Gamma_#13; NF, Gamma_NF := bvadd32(#13, 1bv32)[32:31], Gamma_#13; assert Gamma_ZF; - goto l00000732_goto_l00000753, l00000732_goto_l0000075f; + goto l00000732_goto_l0000075f, l00000732_goto_l00000753; l0000075f: assume {:captureState "l0000075f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -428,7 +434,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#14, 1bv32), 0bv32), Gamma_#14; NF, Gamma_NF := bvadd32(#14, 1bv32)[32:31], Gamma_#14; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l0000075f_goto_l000005de, l0000075f_goto_l00000787; + goto l0000075f_goto_l00000787, l0000075f_goto_l000005de; l00000787: assume {:captureState "l00000787"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -438,7 +444,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#15, 1bv32), 0bv32), Gamma_#15; NF, Gamma_NF := bvadd32(#15, 1bv32)[32:31], Gamma_#15; assert Gamma_ZF; - goto l00000787_goto_l000007a8, l00000787_goto_l000007b4; + goto l00000787_goto_l000007b4, l00000787_goto_l000007a8; l000007b4: assume {:captureState "l000007b4"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -448,7 +454,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#16, 1bv32), 0bv32), Gamma_#16; NF, Gamma_NF := bvadd32(#16, 1bv32)[32:31], Gamma_#16; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000007b4_goto_l000005de, l000007b4_goto_l000007dc; + goto l000007b4_goto_l000007dc, l000007b4_goto_l000005de; l000007dc: assume {:captureState "l000007dc"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -511,7 +517,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#19, 1bv32), 0bv32), Gamma_#19; NF, Gamma_NF := bvadd32(#19, 1bv32)[32:31], Gamma_#19; assert Gamma_ZF; - goto l00000838_goto_l00000859, l00000838_goto_l00000869; + goto l00000838_goto_l00000869, l00000838_goto_l00000859; l00000859: assume {:captureState "l00000859"} true; R30, Gamma_R30 := 2304bv64, true; @@ -529,7 +535,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#20, 1bv32), 0bv32), Gamma_#20; NF, Gamma_NF := bvadd32(#20, 1bv32)[32:31], Gamma_#20; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000869_goto_l000005de, l00000869_goto_l00000891; + goto l00000869_goto_l00000891, l00000869_goto_l000005de; l00000891: assume {:captureState "l00000891"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -562,7 +568,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#22, 1bv32), 0bv32), Gamma_#22; NF, Gamma_NF := bvadd32(#22, 1bv32)[32:31], Gamma_#22; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000008c9_goto_l000005de, l000008c9_goto_l000008f1; + goto l000008c9_goto_l000008f1, l000008c9_goto_l000005de; l000008f1: assume {:captureState "l000008f1"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -582,7 +588,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#24, 1bv32), 0bv32), Gamma_#24; NF, Gamma_NF := bvadd32(#24, 1bv32)[32:31], Gamma_#24; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000922_goto_l000005de, l00000922_goto_l0000094a; + goto l00000922_goto_l0000094a, l00000922_goto_l000005de; l0000094a: assume {:captureState "l0000094a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -592,7 +598,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#25, 1bv32), 0bv32), Gamma_#25; NF, Gamma_NF := bvadd32(#25, 1bv32)[32:31], Gamma_#25; assert Gamma_ZF; - goto l0000094a_goto_l0000096b, l0000094a_goto_l00000982; + goto l0000094a_goto_l00000982, l0000094a_goto_l0000096b; l0000096b: assume {:captureState "l0000096b"} true; R30, Gamma_R30 := 2272bv64, true; @@ -610,7 +616,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#26, 1bv32), 0bv32), Gamma_#26; NF, Gamma_NF := bvadd32(#26, 1bv32)[32:31], Gamma_#26; assert Gamma_ZF; - goto l00000982_goto_l0000097b, l00000982_goto_l000009a8; + goto l00000982_goto_l000009a8, l00000982_goto_l0000097b; l0000097b: assume {:captureState "l0000097b"} true; R30, Gamma_R30 := 2280bv64, true; @@ -644,7 +650,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000059f: assume {:captureState "lmain_goto_l0000059f"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -821,6 +827,9 @@ implementation main() assume {:captureState "l00000982_goto_l000009a8"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000009a8; + main_return: + assume {:captureState "main_return"} true; + return; } procedure sub_seven(); @@ -861,6 +870,9 @@ implementation sub_seven() assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000549"} true; + goto sub_seven_return; + sub_seven_return: + assume {:captureState "sub_seven_return"} true; return; } diff --git a/src/test/correct/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected b/src/test/correct/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected index 212e558c4..4e71584ab 100644 --- a/src/test/correct/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected +++ b/src/test/correct/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected @@ -273,6 +273,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected b/src/test/correct/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected index 2181a0d83..6b661768e 100644 --- a/src/test/correct/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected +++ b/src/test/correct/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected @@ -273,6 +273,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/clang/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang/malloc_with_local.expected index 01185a1df..be981d714 100644 --- a/src/test/correct/malloc_with_local/clang/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang/malloc_with_local.expected @@ -266,6 +266,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected index 28d819ea5..46b03d849 100644 --- a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected @@ -314,6 +314,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected index a6a35f93d..7aa6ae708 100644 --- a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected @@ -266,6 +266,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected index a6a35f93d..7aa6ae708 100644 --- a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected @@ -266,6 +266,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected index 8fbd80b51..daa46eab2 100644 --- a/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected @@ -591,6 +591,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected index 4c167b62f..cba7a5afe 100644 --- a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected @@ -513,6 +513,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected index c44bb881b..19839c24c 100644 --- a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected @@ -591,6 +591,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected index c44bb881b..19839c24c 100644 --- a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected @@ -591,6 +591,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected index ae58bbf97..1c428d9f4 100644 --- a/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected @@ -563,6 +563,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected index 28d819ea5..46b03d849 100644 --- a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected @@ -314,6 +314,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected index 649e99111..a1deac2aa 100644 --- a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected @@ -563,6 +563,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected index 649e99111..a1deac2aa 100644 --- a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected @@ -563,6 +563,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected index 0805e74d9..82732088f 100644 --- a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected @@ -605,6 +605,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected index 4c167b62f..cba7a5afe 100644 --- a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected @@ -513,6 +513,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected index 819b0dbe8..caf08c32d 100644 --- a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected @@ -605,6 +605,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected index 819b0dbe8..caf08c32d 100644 --- a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected @@ -605,6 +605,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected index 7833a364e..9dd908e25 100644 --- a/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected @@ -590,6 +590,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#7, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#7, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -938,6 +941,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected index e40292528..320644b92 100644 --- a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected @@ -332,6 +332,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected index d6051b6c8..2ae525952 100644 --- a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected @@ -590,6 +590,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#7, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#7, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -938,6 +941,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected index d6051b6c8..2ae525952 100644 --- a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected @@ -590,6 +590,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#7, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#7, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 80bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -938,6 +941,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected index 2c897de28..559ff51fc 100644 --- a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected @@ -621,6 +621,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -1005,6 +1008,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected index 55448ebe4..9df3b983e 100644 --- a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected @@ -716,6 +716,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -1059,5 +1062,8 @@ implementation printCharValue() assume {:captureState "%00000293"} true; call __printf_chk(); assume false; //no return target + printCharValue_return: + assume {:captureState "printCharValue_return"} true; + return; } diff --git a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected index 5d8f3abb6..0c8e610fc 100644 --- a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected @@ -621,6 +621,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -1005,6 +1008,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected index 5d8f3abb6..0c8e610fc 100644 --- a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected @@ -621,6 +621,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 64bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } @@ -1005,6 +1008,9 @@ implementation printCharValue() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto printCharValue_return; + printCharValue_return: + assume {:captureState "printCharValue_return"} true; return; } diff --git a/src/test/correct/multi_malloc/clang/multi_malloc.expected b/src/test/correct/multi_malloc/clang/multi_malloc.expected index 2beff043b..1dea76fd5 100644 --- a/src/test/correct/multi_malloc/clang/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang/multi_malloc.expected @@ -400,6 +400,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected b/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected index b70d16d72..657b1018d 100644 --- a/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected @@ -225,6 +225,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected index a3b315d98..71d9cf865 100644 --- a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected @@ -400,6 +400,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected b/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected index a3b315d98..71d9cf865 100644 --- a/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected @@ -400,6 +400,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/gcc/multi_malloc.expected b/src/test/correct/multi_malloc/gcc/multi_malloc.expected index 6ac074ca4..b0e8a0597 100644 --- a/src/test/correct/multi_malloc/gcc/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc/multi_malloc.expected @@ -235,6 +235,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected index a3a5a2334..99544f4d5 100644 --- a/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected @@ -155,6 +155,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected index a81608960..4ed711cf1 100644 --- a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected @@ -235,6 +235,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected index a81608960..4ed711cf1 100644 --- a/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected @@ -235,6 +235,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/nestedif/clang/nestedif.expected b/src/test/correct/nestedif/clang/nestedif.expected index 3a508ccb9..ab32e4390 100644 --- a/src/test/correct/nestedif/clang/nestedif.expected +++ b/src/test/correct/nestedif/clang/nestedif.expected @@ -130,7 +130,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000379, lmain_goto_l0000037c; + goto lmain_goto_l0000037c, lmain_goto_l00000379; l0000037c: assume {:captureState "l0000037c"} true; R8, Gamma_R8 := 1bv64, true; @@ -142,7 +142,7 @@ implementation main() l0000037f: assume {:captureState "l0000037f"} true; assert Gamma_R8; - goto l0000037f_goto_l00000387, l0000037f_goto_l00000442; + goto l0000037f_goto_l00000442, l0000037f_goto_l00000387; l00000387: assume {:captureState "l00000387"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -153,7 +153,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l00000387_goto_l000003b2, l00000387_goto_l000003b5; + goto l00000387_goto_l000003b5, l00000387_goto_l000003b2; l000003b5: assume {:captureState "l000003b5"} true; R8, Gamma_R8 := 1bv64, true; @@ -226,7 +226,7 @@ implementation main() assume {:captureState "l00000403"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000379: assume {:captureState "lmain_goto_l00000379"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -275,5 +275,8 @@ implementation main() assume {:captureState "l000003f1_goto_l00000418"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000418; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/nestedif/clang_O2/nestedif.expected b/src/test/correct/nestedif/clang_O2/nestedif.expected index 93df8d220..6ad789189 100644 --- a/src/test/correct/nestedif/clang_O2/nestedif.expected +++ b/src/test/correct/nestedif/clang_O2/nestedif.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected index 5c184bca5..4f0bf3c3b 100644 --- a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected +++ b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected @@ -142,7 +142,7 @@ implementation main() l00000ab0: assume {:captureState "l00000ab0"} true; assert Gamma_R8; - goto l00000ab0_goto_l00000ab8, l00000ab0_goto_l00000b73; + goto l00000ab0_goto_l00000b73, l00000ab0_goto_l00000ab8; l00000ab8: assume {:captureState "l00000ab8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -153,7 +153,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l00000ab8_goto_l00000ae3, l00000ab8_goto_l00000ae6; + goto l00000ab8_goto_l00000ae6, l00000ab8_goto_l00000ae3; l00000ae6: assume {:captureState "l00000ae6"} true; R8, Gamma_R8 := 1bv64, true; @@ -188,7 +188,7 @@ implementation main() l00000b22: assume {:captureState "l00000b22"} true; assert Gamma_R8; - goto l00000b22_goto_l00000b2a, l00000b22_goto_l00000b49; + goto l00000b22_goto_l00000b49, l00000b22_goto_l00000b2a; l00000b49: assume {:captureState "l00000b49"} true; goto l00000b4a; @@ -226,7 +226,7 @@ implementation main() assume {:captureState "l00000b34"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000aaa: assume {:captureState "lmain_goto_l00000aaa"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -275,5 +275,8 @@ implementation main() assume {:captureState "l00000b22_goto_l00000b49"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000b49; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/nestedif/clang_pic/nestedif.expected b/src/test/correct/nestedif/clang_pic/nestedif.expected index 5c184bca5..4f0bf3c3b 100644 --- a/src/test/correct/nestedif/clang_pic/nestedif.expected +++ b/src/test/correct/nestedif/clang_pic/nestedif.expected @@ -142,7 +142,7 @@ implementation main() l00000ab0: assume {:captureState "l00000ab0"} true; assert Gamma_R8; - goto l00000ab0_goto_l00000ab8, l00000ab0_goto_l00000b73; + goto l00000ab0_goto_l00000b73, l00000ab0_goto_l00000ab8; l00000ab8: assume {:captureState "l00000ab8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -153,7 +153,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l00000ab8_goto_l00000ae3, l00000ab8_goto_l00000ae6; + goto l00000ab8_goto_l00000ae6, l00000ab8_goto_l00000ae3; l00000ae6: assume {:captureState "l00000ae6"} true; R8, Gamma_R8 := 1bv64, true; @@ -188,7 +188,7 @@ implementation main() l00000b22: assume {:captureState "l00000b22"} true; assert Gamma_R8; - goto l00000b22_goto_l00000b2a, l00000b22_goto_l00000b49; + goto l00000b22_goto_l00000b49, l00000b22_goto_l00000b2a; l00000b49: assume {:captureState "l00000b49"} true; goto l00000b4a; @@ -226,7 +226,7 @@ implementation main() assume {:captureState "l00000b34"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000aaa: assume {:captureState "lmain_goto_l00000aaa"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -275,5 +275,8 @@ implementation main() assume {:captureState "l00000b22_goto_l00000b49"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000b49; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/nestedif/gcc/nestedif.expected b/src/test/correct/nestedif/gcc/nestedif.expected index 5fea255ff..27090aae3 100644 --- a/src/test/correct/nestedif/gcc/nestedif.expected +++ b/src/test/correct/nestedif/gcc/nestedif.expected @@ -145,7 +145,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#6, 1bv32), 0bv32), Gamma_#6; NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; assert Gamma_ZF; - goto l0000036b_goto_l00000391, l0000036b_goto_l000003a6; + goto l0000036b_goto_l000003a6, l0000036b_goto_l00000391; l000003a6: assume {:captureState "l000003a6"} true; R0, Gamma_R0 := 7bv64, true; @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000391"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000345: assume {:captureState "lmain_goto_l00000345"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l0000036b_goto_l000003a6"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000003a6; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/nestedif/gcc_O2/nestedif.expected b/src/test/correct/nestedif/gcc_O2/nestedif.expected index 657d807d3..89d953131 100644 --- a/src/test/correct/nestedif/gcc_O2/nestedif.expected +++ b/src/test/correct/nestedif/gcc_O2/nestedif.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected index 9d14fb9bb..930878b90 100644 --- a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected +++ b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000a2d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000009e1: assume {:captureState "lmain_goto_l000009e1"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l00000a07_goto_l00000a42"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000a42; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/nestedif/gcc_pic/nestedif.expected b/src/test/correct/nestedif/gcc_pic/nestedif.expected index 9d14fb9bb..930878b90 100644 --- a/src/test/correct/nestedif/gcc_pic/nestedif.expected +++ b/src/test/correct/nestedif/gcc_pic/nestedif.expected @@ -168,7 +168,7 @@ implementation main() assume {:captureState "l00000a2d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000009e1: assume {:captureState "lmain_goto_l000009e1"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -193,5 +193,8 @@ implementation main() assume {:captureState "l00000a07_goto_l00000a42"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000a42; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected index cc5f1a6cc..bca09447a 100644 --- a/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected @@ -109,6 +109,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected index 90771f992..1741706e6 100644 --- a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected @@ -109,6 +109,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000002d3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected index 33769ca91..b2374a564 100644 --- a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected @@ -109,6 +109,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected index 3ad575555..af7697f33 100644 --- a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected @@ -118,6 +118,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected index 96cd9c8ba..2e99f2b5b 100644 --- a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected @@ -108,6 +108,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected index 811d0683e..17199ec93 100644 --- a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected @@ -109,6 +109,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000001bd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected index f485b88b2..319228b5e 100644 --- a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected @@ -108,6 +108,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected index bf4c0d23b..f85ba5852 100644 --- a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected @@ -116,6 +116,9 @@ implementation main() assert (memory_load32_le(mem, $y_addr) == y_old); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected index 7830f3c2e..c40d34660 100644 --- a/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected @@ -109,6 +109,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected index 88de4ed43..bdc65f4de 100644 --- a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected @@ -109,6 +109,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000002d3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected index cb22929dc..94e7430a2 100644 --- a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected @@ -109,6 +109,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected index 1c4931e1a..39b252df5 100644 --- a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected @@ -118,6 +118,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected index 4417a9539..9ba5860e2 100644 --- a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected @@ -108,6 +108,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected index 2a6a9c6db..f477e1421 100644 --- a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected @@ -109,6 +109,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000001bd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected index 82e4dc546..0142eba38 100644 --- a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected @@ -108,6 +108,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected index d4e29c9a8..6b1e1e3ed 100644 --- a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected @@ -116,6 +116,9 @@ implementation main() assert (memory_load32_le(mem, $x_addr) == x_old); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/clang/secret_write.expected b/src/test/correct/secret_write/clang/secret_write.expected index 42fcdbd2f..07af6ba51 100644 --- a/src/test/correct/secret_write/clang/secret_write.expected +++ b/src/test/correct/secret_write/clang/secret_write.expected @@ -171,6 +171,9 @@ implementation main() assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%0000033f"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/clang_O2/secret_write.expected b/src/test/correct/secret_write/clang_O2/secret_write.expected index 1b77f7aa7..8e2e61824 100644 --- a/src/test/correct/secret_write/clang_O2/secret_write.expected +++ b/src/test/correct/secret_write/clang_O2/secret_write.expected @@ -137,6 +137,9 @@ implementation main() assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%000002e7"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected index 524b7b30d..9bab60ad6 100644 --- a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected +++ b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected @@ -171,6 +171,9 @@ implementation main() assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%00000936"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/clang_pic/secret_write.expected b/src/test/correct/secret_write/clang_pic/secret_write.expected index 6558e00dd..596a91e32 100644 --- a/src/test/correct/secret_write/clang_pic/secret_write.expected +++ b/src/test/correct/secret_write/clang_pic/secret_write.expected @@ -190,6 +190,9 @@ implementation main() assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%00000360"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/gcc/secret_write.expected b/src/test/correct/secret_write/gcc/secret_write.expected index 829ea2006..0167677b9 100644 --- a/src/test/correct/secret_write/gcc/secret_write.expected +++ b/src/test/correct/secret_write/gcc/secret_write.expected @@ -180,6 +180,9 @@ implementation main() assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%000003b7"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/gcc_O2/secret_write.expected b/src/test/correct/secret_write/gcc_O2/secret_write.expected index 79f363dce..3ade518e1 100644 --- a/src/test/correct/secret_write/gcc_O2/secret_write.expected +++ b/src/test/correct/secret_write/gcc_O2/secret_write.expected @@ -137,6 +137,9 @@ implementation main() assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%000001ca"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected index 102265249..cf998c3a1 100644 --- a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected +++ b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected @@ -180,6 +180,9 @@ implementation main() assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%00000a45"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/secret_write/gcc_pic/secret_write.expected b/src/test/correct/secret_write/gcc_pic/secret_write.expected index 2c42ee32d..658635543 100644 --- a/src/test/correct/secret_write/gcc_pic/secret_write.expected +++ b/src/test/correct/secret_write/gcc_pic/secret_write.expected @@ -201,6 +201,9 @@ implementation main() assert bvsge32(memory_load32_le(mem, $z_addr), z_old); assume {:captureState "%000003bf"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/simple_jump/clang/simple_jump.expected b/src/test/correct/simple_jump/clang/simple_jump.expected index f03fbfe30..3220b9d4b 100644 --- a/src/test/correct/simple_jump/clang/simple_jump.expected +++ b/src/test/correct/simple_jump/clang/simple_jump.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000334"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000326: assume {:captureState "lmain_goto_l00000326"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000032c_goto_l0000034b"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000034b; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/simple_jump/clang_O2/simple_jump.expected b/src/test/correct/simple_jump/clang_O2/simple_jump.expected index 93df8d220..6ad789189 100644 --- a/src/test/correct/simple_jump/clang_O2/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_O2/simple_jump.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected index 10b0b4c7e..fd482b3c1 100644 --- a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000946"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000938: assume {:captureState "lmain_goto_l00000938"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000093e_goto_l0000095d"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000095d; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/simple_jump/clang_pic/simple_jump.expected b/src/test/correct/simple_jump/clang_pic/simple_jump.expected index 10b0b4c7e..fd482b3c1 100644 --- a/src/test/correct/simple_jump/clang_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_pic/simple_jump.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000946"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000938: assume {:captureState "lmain_goto_l00000938"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000093e_goto_l0000095d"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000095d; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/simple_jump/gcc/simple_jump.expected b/src/test/correct/simple_jump/gcc/simple_jump.expected index afb8cef39..300a26ba3 100644 --- a/src/test/correct/simple_jump/gcc/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc/simple_jump.expected @@ -119,7 +119,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000030a, lmain_goto_l0000031f; + goto lmain_goto_l0000031f, lmain_goto_l0000030a; l0000031f: assume {:captureState "l0000031f"} true; R0, Gamma_R0 := 6bv64, true; @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l0000030a"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000030a: assume {:captureState "lmain_goto_l0000030a"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l0000031f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000031f; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/simple_jump/gcc_O2/simple_jump.expected b/src/test/correct/simple_jump/gcc_O2/simple_jump.expected index 657d807d3..89d953131 100644 --- a/src/test/correct/simple_jump/gcc_O2/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_O2/simple_jump.expected @@ -68,6 +68,9 @@ implementation main() lmain: assume {:captureState "lmain"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected index 39653851f..13fba5eb2 100644 --- a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected @@ -119,7 +119,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000008e1, lmain_goto_l000008f6; + goto lmain_goto_l000008f6, lmain_goto_l000008e1; l000008f6: assume {:captureState "l000008f6"} true; R0, Gamma_R0 := 6bv64, true; @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l000008e1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000008e1: assume {:captureState "lmain_goto_l000008e1"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l000008f6"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000008f6; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/simple_jump/gcc_pic/simple_jump.expected b/src/test/correct/simple_jump/gcc_pic/simple_jump.expected index 39653851f..13fba5eb2 100644 --- a/src/test/correct/simple_jump/gcc_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_pic/simple_jump.expected @@ -119,7 +119,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000008e1, lmain_goto_l000008f6; + goto lmain_goto_l000008f6, lmain_goto_l000008e1; l000008f6: assume {:captureState "l000008f6"} true; R0, Gamma_R0 := 6bv64, true; @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l000008e1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000008e1: assume {:captureState "lmain_goto_l000008e1"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l000008f6"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000008f6; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/clang/switch.expected b/src/test/correct/switch/clang/switch.expected index 37dffcd06..ad2745ee3 100644 --- a/src/test/correct/switch/clang/switch.expected +++ b/src/test/correct/switch/clang/switch.expected @@ -189,7 +189,7 @@ implementation main() l0000037b: assume {:captureState "l0000037b"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000035a: assume {:captureState "lmain_goto_l0000035a"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -222,5 +222,8 @@ implementation main() assume {:captureState "l000003ca_goto_l000003d7"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l000003d7; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/clang_O2/switch.expected b/src/test/correct/switch/clang_O2/switch.expected index 658b3ad9b..93b294099 100644 --- a/src/test/correct/switch/clang_O2/switch.expected +++ b/src/test/correct/switch/clang_O2/switch.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/switch/clang_no_plt_no_pic/switch.expected b/src/test/correct/switch/clang_no_plt_no_pic/switch.expected index aaecc750f..6a652efbf 100644 --- a/src/test/correct/switch/clang_no_plt_no_pic/switch.expected +++ b/src/test/correct/switch/clang_no_plt_no_pic/switch.expected @@ -152,7 +152,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l00000a50_goto_l00000a79, l00000a50_goto_l00000a7c; + goto l00000a50_goto_l00000a7c, l00000a50_goto_l00000a79; l00000a7c: assume {:captureState "l00000a7c"} true; R8, Gamma_R8 := 1bv64, true; @@ -189,7 +189,7 @@ implementation main() l00000a30: assume {:captureState "l00000a30"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000a0f: assume {:captureState "lmain_goto_l00000a0f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -222,5 +222,8 @@ implementation main() assume {:captureState "l00000a7f_goto_l00000a8c"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000a8c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/clang_pic/switch.expected b/src/test/correct/switch/clang_pic/switch.expected index aaecc750f..6a652efbf 100644 --- a/src/test/correct/switch/clang_pic/switch.expected +++ b/src/test/correct/switch/clang_pic/switch.expected @@ -152,7 +152,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l00000a50_goto_l00000a79, l00000a50_goto_l00000a7c; + goto l00000a50_goto_l00000a7c, l00000a50_goto_l00000a79; l00000a7c: assume {:captureState "l00000a7c"} true; R8, Gamma_R8 := 1bv64, true; @@ -189,7 +189,7 @@ implementation main() l00000a30: assume {:captureState "l00000a30"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000a0f: assume {:captureState "lmain_goto_l00000a0f"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -222,5 +222,8 @@ implementation main() assume {:captureState "l00000a7f_goto_l00000a8c"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000a8c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/gcc/switch.expected b/src/test/correct/switch/gcc/switch.expected index d0ab53b49..dbcad0f6e 100644 --- a/src/test/correct/switch/gcc/switch.expected +++ b/src/test/correct/switch/gcc/switch.expected @@ -123,7 +123,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000339, lmain_goto_l0000036b; + goto lmain_goto_l0000036b, lmain_goto_l00000339; l0000036b: assume {:captureState "l0000036b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); @@ -155,7 +155,7 @@ implementation main() l0000034c: assume {:captureState "l0000034c"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000339: assume {:captureState "lmain_goto_l00000339"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -172,5 +172,8 @@ implementation main() assume {:captureState "l0000036b_goto_l00000391"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000391; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/gcc_O2/switch.expected b/src/test/correct/switch/gcc_O2/switch.expected index 628d250a1..678775285 100644 --- a/src/test/correct/switch/gcc_O2/switch.expected +++ b/src/test/correct/switch/gcc_O2/switch.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected b/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected index e9ad9301f..b0e94c9ff 100644 --- a/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected +++ b/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected @@ -155,7 +155,7 @@ implementation main() l000009ab: assume {:captureState "l000009ab"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000998: assume {:captureState "lmain_goto_l00000998"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -172,5 +172,8 @@ implementation main() assume {:captureState "l000009ca_goto_l000009f0"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000009f0; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch/gcc_pic/switch.expected b/src/test/correct/switch/gcc_pic/switch.expected index e9ad9301f..b0e94c9ff 100644 --- a/src/test/correct/switch/gcc_pic/switch.expected +++ b/src/test/correct/switch/gcc_pic/switch.expected @@ -155,7 +155,7 @@ implementation main() l000009ab: assume {:captureState "l000009ab"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000998: assume {:captureState "lmain_goto_l00000998"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -172,5 +172,8 @@ implementation main() assume {:captureState "l000009ca_goto_l000009f0"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000009f0; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/switch2/clang_O2/switch2.expected b/src/test/correct/switch2/clang_O2/switch2.expected index 03b9b58a2..35fc699c1 100644 --- a/src/test/correct/switch2/clang_O2/switch2.expected +++ b/src/test/correct/switch2/clang_O2/switch2.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/switch2/gcc/switch2.expected b/src/test/correct/switch2/gcc/switch2.expected index 4fe6e5b69..0b80a0dc2 100644 --- a/src/test/correct/switch2/gcc/switch2.expected +++ b/src/test/correct/switch2/gcc/switch2.expected @@ -230,7 +230,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#10, 1bv32), 0bv32), Gamma_#10; NF, Gamma_NF := bvadd32(#10, 1bv32)[32:31], Gamma_#10; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l000004e2_goto_l000003e2, l000004e2_goto_l0000050a; + goto l000004e2_goto_l0000050a, l000004e2_goto_l000003e2; l0000050a: assume {:captureState "l0000050a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -283,7 +283,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000003d0: assume {:captureState "lmain_goto_l000003d0"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -348,6 +348,9 @@ implementation main() assume {:captureState "l00000530_goto_l00000556"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000556; + main_return: + assume {:captureState "main_return"} true; + return; } procedure r(); @@ -374,6 +377,9 @@ implementation r() lr: assume {:captureState "lr"} true; R0, Gamma_R0 := 1bv64, true; + goto r_return; + r_return: + assume {:captureState "r_return"} true; return; } diff --git a/src/test/correct/switch2/gcc_O2/switch2.expected b/src/test/correct/switch2/gcc_O2/switch2.expected index d51a51b6c..c3c4db385 100644 --- a/src/test/correct/switch2/gcc_O2/switch2.expected +++ b/src/test/correct/switch2/gcc_O2/switch2.expected @@ -64,6 +64,9 @@ implementation main() { lmain: assume {:captureState "lmain"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected index 11744cb51..7b5b056df 100644 --- a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected +++ b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected @@ -200,7 +200,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#8, 1bv32), 0bv32), Gamma_#8; NF, Gamma_NF := bvadd32(#8, 1bv32)[32:31], Gamma_#8; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000cc6_goto_l00000c41, l00000cc6_goto_l00000cee; + goto l00000cc6_goto_l00000cee, l00000cc6_goto_l00000c41; l00000cee: assume {:captureState "l00000cee"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -210,7 +210,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#9, 1bv32), 0bv32), Gamma_#9; NF, Gamma_NF := bvadd32(#9, 1bv32)[32:31], Gamma_#9; assert Gamma_ZF; - goto l00000cee_goto_l00000d0f, l00000cee_goto_l00000d41; + goto l00000cee_goto_l00000d41, l00000cee_goto_l00000d0f; l00000d0f: assume {:captureState "l00000d0f"} true; R30, Gamma_R30 := 1944bv64, true; @@ -230,7 +230,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#10, 1bv32), 0bv32), Gamma_#10; NF, Gamma_NF := bvadd32(#10, 1bv32)[32:31], Gamma_#10; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000d41_goto_l00000c41, l00000d41_goto_l00000d69; + goto l00000d41_goto_l00000d69, l00000d41_goto_l00000c41; l00000d69: assume {:captureState "l00000d69"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -240,7 +240,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l00000d69_goto_l00000d23, l00000d69_goto_l00000d8f; + goto l00000d69_goto_l00000d8f, l00000d69_goto_l00000d23; l00000d23: assume {:captureState "l00000d23"} true; R0, Gamma_R0 := 1bv64, true; @@ -283,7 +283,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000c2f: assume {:captureState "lmain_goto_l00000c2f"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -348,6 +348,9 @@ implementation main() assume {:captureState "l00000d8f_goto_l00000db5"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000db5; + main_return: + assume {:captureState "main_return"} true; + return; } procedure r(); @@ -374,6 +377,9 @@ implementation r() lr: assume {:captureState "lr"} true; R0, Gamma_R0 := 1bv64, true; + goto r_return; + r_return: + assume {:captureState "r_return"} true; return; } diff --git a/src/test/correct/switch2/gcc_pic/switch2.expected b/src/test/correct/switch2/gcc_pic/switch2.expected index 11744cb51..7b5b056df 100644 --- a/src/test/correct/switch2/gcc_pic/switch2.expected +++ b/src/test/correct/switch2/gcc_pic/switch2.expected @@ -200,7 +200,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#8, 1bv32), 0bv32), Gamma_#8; NF, Gamma_NF := bvadd32(#8, 1bv32)[32:31], Gamma_#8; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000cc6_goto_l00000c41, l00000cc6_goto_l00000cee; + goto l00000cc6_goto_l00000cee, l00000cc6_goto_l00000c41; l00000cee: assume {:captureState "l00000cee"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -210,7 +210,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#9, 1bv32), 0bv32), Gamma_#9; NF, Gamma_NF := bvadd32(#9, 1bv32)[32:31], Gamma_#9; assert Gamma_ZF; - goto l00000cee_goto_l00000d0f, l00000cee_goto_l00000d41; + goto l00000cee_goto_l00000d41, l00000cee_goto_l00000d0f; l00000d0f: assume {:captureState "l00000d0f"} true; R30, Gamma_R30 := 1944bv64, true; @@ -230,7 +230,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#10, 1bv32), 0bv32), Gamma_#10; NF, Gamma_NF := bvadd32(#10, 1bv32)[32:31], Gamma_#10; assert ((Gamma_NF && Gamma_VF) && Gamma_ZF); - goto l00000d41_goto_l00000c41, l00000d41_goto_l00000d69; + goto l00000d41_goto_l00000d69, l00000d41_goto_l00000c41; l00000d69: assume {:captureState "l00000d69"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -240,7 +240,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#11, 1bv32), 0bv32), Gamma_#11; NF, Gamma_NF := bvadd32(#11, 1bv32)[32:31], Gamma_#11; assert Gamma_ZF; - goto l00000d69_goto_l00000d23, l00000d69_goto_l00000d8f; + goto l00000d69_goto_l00000d8f, l00000d69_goto_l00000d23; l00000d23: assume {:captureState "l00000d23"} true; R0, Gamma_R0 := 1bv64, true; @@ -283,7 +283,7 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000c2f: assume {:captureState "lmain_goto_l00000c2f"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -348,6 +348,9 @@ implementation main() assume {:captureState "l00000d8f_goto_l00000db5"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000db5; + main_return: + assume {:captureState "main_return"} true; + return; } procedure r(); @@ -374,6 +377,9 @@ implementation r() lr: assume {:captureState "lr"} true; R0, Gamma_R0 := 1bv64, true; + goto r_return; + r_return: + assume {:captureState "r_return"} true; return; } diff --git a/src/test/correct/syscall/clang/syscall.expected b/src/test/correct/syscall/clang/syscall.expected index 0175f2f8e..adf6e03cb 100644 --- a/src/test/correct/syscall/clang/syscall.expected +++ b/src/test/correct/syscall/clang/syscall.expected @@ -162,6 +162,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected b/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected index 90781988c..39d58fdb6 100644 --- a/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected +++ b/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected @@ -162,6 +162,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/syscall/clang_pic/syscall.expected b/src/test/correct/syscall/clang_pic/syscall.expected index 90781988c..39d58fdb6 100644 --- a/src/test/correct/syscall/clang_pic/syscall.expected +++ b/src/test/correct/syscall/clang_pic/syscall.expected @@ -162,6 +162,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/syscall/gcc/syscall.expected b/src/test/correct/syscall/gcc/syscall.expected index 7c763b860..335b767c1 100644 --- a/src/test/correct/syscall/gcc/syscall.expected +++ b/src/test/correct/syscall/gcc/syscall.expected @@ -157,6 +157,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/syscall/gcc_O2/syscall.expected b/src/test/correct/syscall/gcc_O2/syscall.expected index fcb66403d..616be9705 100644 --- a/src/test/correct/syscall/gcc_O2/syscall.expected +++ b/src/test/correct/syscall/gcc_O2/syscall.expected @@ -1,8 +1,4 @@ -var {:extern} Gamma_R16: bool; -var {:extern} Gamma_R17: bool; var {:extern} Gamma_mem: [bv64]bool; -var {:extern} R16: bv64; -var {:extern} R17: bv64; var {:extern} mem: [bv64]bv8; const {:extern} $_IO_stdin_used_addr: bv64; axiom ($_IO_stdin_used_addr == 1960bv64); @@ -45,7 +41,6 @@ procedure {:extern} guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); - modifies Gamma_R16, Gamma_R17, R16, R17; free requires (memory_load64_le(mem, 69632bv64) == 0bv64); free requires (memory_load64_le(mem, 69640bv64) == 69640bv64); free requires (memory_load8_le(mem, 1960bv64) == 1bv8); diff --git a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected index 0af6d545b..200605ef8 100644 --- a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected +++ b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected @@ -157,6 +157,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/syscall/gcc_pic/syscall.expected b/src/test/correct/syscall/gcc_pic/syscall.expected index 0af6d545b..200605ef8 100644 --- a/src/test/correct/syscall/gcc_pic/syscall.expected +++ b/src/test/correct/syscall/gcc_pic/syscall.expected @@ -157,6 +157,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected index 4c987715b..62f7b98ac 100644 --- a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected @@ -139,7 +139,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000322, lmain_goto_l00000325; + goto lmain_goto_l00000325, lmain_goto_l00000322; l00000325: assume {:captureState "l00000325"} true; R8, Gamma_R8 := 1bv64, true; @@ -170,7 +170,7 @@ implementation main() assume {:captureState "l00000343"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000322: assume {:captureState "lmain_goto_l00000322"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -187,5 +187,8 @@ implementation main() assume {:captureState "l00000328_goto_l00000358"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000358; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected index 2e22216b9..05b23af86 100644 --- a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected @@ -132,7 +132,7 @@ implementation main() goto l000002eb; l000002eb: assume {:captureState "l000002eb"} true; - return; + goto main_return; lmain_goto_l000002e5: assume {:captureState "lmain_goto_l000002e5"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -141,5 +141,8 @@ implementation main() assume {:captureState "lmain_goto_l000002e8"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000002e8; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected index 53d1fb153..16225a823 100644 --- a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected @@ -151,7 +151,7 @@ implementation main() l00000943: assume {:captureState "l00000943"} true; assert Gamma_R8; - goto l00000943_goto_l0000094b, l00000943_goto_l00000973; + goto l00000943_goto_l00000973, l00000943_goto_l0000094b; l0000094b: assume {:captureState "l0000094b"} true; R8, Gamma_R8 := 1bv64, true; @@ -170,7 +170,7 @@ implementation main() assume {:captureState "l0000095e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000093d: assume {:captureState "lmain_goto_l0000093d"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -187,5 +187,8 @@ implementation main() assume {:captureState "l00000943_goto_l00000973"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000973; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected index e0851a5c3..6ace33958 100644 --- a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected @@ -148,7 +148,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l0000032d, lmain_goto_l00000330; + goto lmain_goto_l00000330, lmain_goto_l0000032d; l00000330: assume {:captureState "l00000330"} true; R8, Gamma_R8 := 1bv64, true; @@ -179,7 +179,7 @@ implementation main() assume {:captureState "l0000034e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l0000032d: assume {:captureState "lmain_goto_l0000032d"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -196,5 +196,8 @@ implementation main() assume {:captureState "l00000333_goto_l00000363"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000363; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected index 042817109..306130a16 100644 --- a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected @@ -131,7 +131,7 @@ implementation main() goto l00000304; l00000304: assume {:captureState "l00000304"} true; - return; + goto main_return; lmain_goto_l000002fa: assume {:captureState "lmain_goto_l000002fa"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -140,5 +140,8 @@ implementation main() assume {:captureState "lmain_goto_l00000309"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l00000309; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected index cc3f785b6..5110cd257 100644 --- a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected @@ -119,7 +119,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#1, 1bv32), 0bv32), Gamma_#1; NF, Gamma_NF := bvadd32(#1, 1bv32)[32:31], Gamma_#1; assert Gamma_ZF; - goto lmain_goto_l000001cf, lmain_goto_l000001d2; + goto lmain_goto_l000001d2, lmain_goto_l000001cf; l000001d2: assume {:captureState "l000001d2"} true; R0, Gamma_R0 := 1bv64, true; @@ -130,7 +130,7 @@ implementation main() goto l000001d5; l000001d5: assume {:captureState "l000001d5"} true; - return; + goto main_return; lmain_goto_l000001cf: assume {:captureState "lmain_goto_l000001cf"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l000001d2"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000001d2; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected index a899e0a02..7c57465d3 100644 --- a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected @@ -120,7 +120,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000008b3, lmain_goto_l000008c2; + goto lmain_goto_l000008c2, lmain_goto_l000008b3; l000008b3: assume {:captureState "l000008b3"} true; R0, Gamma_R0 := 1bv64, true; @@ -131,7 +131,7 @@ implementation main() goto l000008bd; l000008bd: assume {:captureState "l000008bd"} true; - return; + goto main_return; lmain_goto_l000008b3: assume {:captureState "lmain_goto_l000008b3"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -140,5 +140,8 @@ implementation main() assume {:captureState "lmain_goto_l000008c2"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l000008c2; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected index c6db86754..8bfc79117 100644 --- a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected @@ -139,7 +139,7 @@ implementation main() goto l00000305; l00000305: assume {:captureState "l00000305"} true; - return; + goto main_return; lmain_goto_l000002fb: assume {:captureState "lmain_goto_l000002fb"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -148,5 +148,8 @@ implementation main() assume {:captureState "lmain_goto_l0000030a"} true; assume (bvcomp1(ZF, 1bv1) == 0bv1); goto l0000030a; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected index 05d75cf8e..e3109bb81 100644 --- a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected @@ -114,6 +114,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected index 9af1fc2c4..def7059ce 100644 --- a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected @@ -114,6 +114,9 @@ implementation main() assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000002d3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected index e4ccca552..2fc4ba03c 100644 --- a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected @@ -114,6 +114,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected index ac6b61b78..ec89a4609 100644 --- a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected @@ -123,6 +123,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected index 0a1ec6d9b..e86621d18 100644 --- a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected @@ -113,6 +113,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected index 556ad567e..3c92bb631 100644 --- a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected @@ -114,6 +114,9 @@ implementation main() assert ((bvadd64(R1, 20bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000001bd"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected index 053ed1d56..bd8024487 100644 --- a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected @@ -113,6 +113,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected index c02957a55..d338f7edb 100644 --- a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected @@ -121,6 +121,9 @@ implementation main() assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/clang/basicassign.expected b/src/test/incorrect/basicassign/clang/basicassign.expected index 9ab8a7062..a5d10be7d 100644 --- a/src/test/incorrect/basicassign/clang/basicassign.expected +++ b/src/test/incorrect/basicassign/clang/basicassign.expected @@ -136,6 +136,9 @@ implementation main() assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); assume {:captureState "%00000337"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_O2/basicassign.expected b/src/test/incorrect/basicassign/clang_O2/basicassign.expected index 04f35a1f3..888259baf 100644 --- a/src/test/incorrect/basicassign/clang_O2/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_O2/basicassign.expected @@ -116,6 +116,9 @@ implementation main() assert (L(mem, bvadd64(R10, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 60bv64), Gamma_R8); assume {:captureState "%000002f3"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected index 135a1f478..b2af386e6 100644 --- a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected @@ -136,6 +136,9 @@ implementation main() assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); assume {:captureState "%00000924"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_pic/basicassign.expected b/src/test/incorrect/basicassign/clang_pic/basicassign.expected index 570f828e1..f716e7061 100644 --- a/src/test/incorrect/basicassign/clang_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_pic/basicassign.expected @@ -155,6 +155,9 @@ implementation main() assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assume {:captureState "%00000358"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc/basicassign.expected b/src/test/incorrect/basicassign/gcc/basicassign.expected index 67c9fd8ee..c22110769 100644 --- a/src/test/incorrect/basicassign/gcc/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc/basicassign.expected @@ -145,6 +145,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000003c2"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc_O2/basicassign.expected b/src/test/incorrect/basicassign/gcc_O2/basicassign.expected index bfa1cf91d..80a1c17bf 100644 --- a/src/test/incorrect/basicassign/gcc_O2/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_O2/basicassign.expected @@ -116,6 +116,9 @@ implementation main() assert (L(mem, bvadd64(#1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(#1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(#1, 4bv64), Gamma_R2); assume {:captureState "%000001cf"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected index bbebca37e..088a95f09 100644 --- a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected @@ -145,6 +145,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%00000a5d"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc_pic/basicassign.expected b/src/test/incorrect/basicassign/gcc_pic/basicassign.expected index d0cdbad3c..49dedf767 100644 --- a/src/test/incorrect/basicassign/gcc_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_pic/basicassign.expected @@ -167,6 +167,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assume {:captureState "%000003cb"} true; R0, Gamma_R0 := 0bv64, true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/clang/basicassign1.expected b/src/test/incorrect/basicassign1/clang/basicassign1.expected index 7b7067e55..7b83e9207 100644 --- a/src/test/incorrect/basicassign1/clang/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang/basicassign1.expected @@ -125,6 +125,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%0000033c"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected b/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected index a49f74f09..12d4bdc79 100644 --- a/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected @@ -101,6 +101,9 @@ implementation main() assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%000002de"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected index c1153b7f3..c948f49a3 100644 --- a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected @@ -125,6 +125,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%00000936"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected b/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected index 3e1253cd2..5d7e2dde1 100644 --- a/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected @@ -139,6 +139,9 @@ implementation main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assume {:captureState "%00000352"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/gcc/basicassign1.expected b/src/test/incorrect/basicassign1/gcc/basicassign1.expected index 572c9f872..0db4d5794 100644 --- a/src/test/incorrect/basicassign1/gcc/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc/basicassign1.expected @@ -127,6 +127,9 @@ implementation main() assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected index 25f2cc8d9..7b13da931 100644 --- a/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected @@ -101,6 +101,9 @@ implementation main() assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assume {:captureState "%000001c5"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected index abc753acb..db58cec39 100644 --- a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected @@ -127,6 +127,9 @@ implementation main() assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected index 7824e9e95..79c867321 100644 --- a/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected @@ -141,6 +141,9 @@ implementation main() assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/clang/basicassign2.expected b/src/test/incorrect/basicassign2/clang/basicassign2.expected index e06a514ac..37d312109 100644 --- a/src/test/incorrect/basicassign2/clang/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang/basicassign2.expected @@ -122,6 +122,9 @@ implementation main() assume {:captureState "%00000337"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected b/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected index 551197251..9f2c9666a 100644 --- a/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected @@ -98,6 +98,9 @@ implementation main() assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R8), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R8); assume {:captureState "%000002de"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected index 5755fb3bf..b646c4b22 100644 --- a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected @@ -122,6 +122,9 @@ implementation main() assume {:captureState "%00000931"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected b/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected index 34024cf4c..b3790d4d1 100644 --- a/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected @@ -132,6 +132,9 @@ implementation main() assume {:captureState "%0000034d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/gcc/basicassign2.expected b/src/test/incorrect/basicassign2/gcc/basicassign2.expected index 480c1d306..6fcaa8b9b 100644 --- a/src/test/incorrect/basicassign2/gcc/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc/basicassign2.expected @@ -124,6 +124,9 @@ implementation main() assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected index 4b88b7423..8850dc83b 100644 --- a/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected @@ -98,6 +98,9 @@ implementation main() assert (L(mem, bvadd64(R1, 24bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R1, 24bv64), R2), gamma_store64(Gamma_mem, bvadd64(R1, 24bv64), Gamma_R2); assume {:captureState "%000001c5"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected index 1711ce3d2..97e05f878 100644 --- a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected @@ -124,6 +124,9 @@ implementation main() assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected index 366d025b8..2254b9f14 100644 --- a/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected @@ -134,6 +134,9 @@ implementation main() assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/clang/basicassign3.expected b/src/test/incorrect/basicassign3/clang/basicassign3.expected index ef1c38d25..da8cddd12 100644 --- a/src/test/incorrect/basicassign3/clang/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang/basicassign3.expected @@ -123,6 +123,9 @@ implementation main() assume {:captureState "%00000337"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected b/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected index 5a813d070..cb11dd00a 100644 --- a/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected @@ -99,6 +99,9 @@ implementation main() assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 56bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assume {:captureState "%000002de"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected index 7db9fa80d..c751f7f0e 100644 --- a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected @@ -123,6 +123,9 @@ implementation main() assume {:captureState "%00000931"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected b/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected index 11bbf80c3..1bb3ed2cf 100644 --- a/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected @@ -137,6 +137,9 @@ implementation main() assume {:captureState "%0000034d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/gcc/basicassign3.expected b/src/test/incorrect/basicassign3/gcc/basicassign3.expected index 6ac5ac301..9dfb3b9fe 100644 --- a/src/test/incorrect/basicassign3/gcc/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc/basicassign3.expected @@ -125,6 +125,9 @@ implementation main() assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected index ee12b7189..8005960eb 100644 --- a/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected @@ -99,6 +99,9 @@ implementation main() assert (L(mem, bvadd64(R1, 17bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R1, 17bv64), R2[8:0]), gamma_store8(Gamma_mem, bvadd64(R1, 17bv64), Gamma_R2); assume {:captureState "%000001c5"} true; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected index 9081fc963..058f87d1f 100644 --- a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected @@ -125,6 +125,9 @@ implementation main() assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected index dc7cd4e60..e5f28f911 100644 --- a/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected @@ -139,6 +139,9 @@ implementation main() assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/iflocal/clang/iflocal.expected b/src/test/incorrect/iflocal/clang/iflocal.expected index 51ff8ac39..9e64ca4aa 100644 --- a/src/test/incorrect/iflocal/clang/iflocal.expected +++ b/src/test/incorrect/iflocal/clang/iflocal.expected @@ -124,7 +124,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000334, lmain_goto_l00000337; + goto lmain_goto_l00000337, lmain_goto_l00000334; l00000337: assume {:captureState "l00000337"} true; R8, Gamma_R8 := 1bv64, true; @@ -136,7 +136,7 @@ implementation main() l0000033a: assume {:captureState "l0000033a"} true; assert Gamma_R8; - goto l0000033a_goto_l00000342, l0000033a_goto_l00000359; + goto l0000033a_goto_l00000359, l0000033a_goto_l00000342; l00000359: assume {:captureState "l00000359"} true; goto l0000035a; @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000342"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000334: assume {:captureState "lmain_goto_l00000334"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000033a_goto_l00000359"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000359; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected index 49930b245..fe970c7e9 100644 --- a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000964"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000956: assume {:captureState "lmain_goto_l00000956"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000095c_goto_l0000097b"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000097b; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/iflocal/clang_pic/iflocal.expected b/src/test/incorrect/iflocal/clang_pic/iflocal.expected index 49930b245..fe970c7e9 100644 --- a/src/test/incorrect/iflocal/clang_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/clang_pic/iflocal.expected @@ -150,7 +150,7 @@ implementation main() assume {:captureState "l00000964"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000956: assume {:captureState "lmain_goto_l00000956"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -167,5 +167,8 @@ implementation main() assume {:captureState "l0000095c_goto_l0000097b"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000097b; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/iflocal/gcc/iflocal.expected b/src/test/incorrect/iflocal/gcc/iflocal.expected index 605b66fa7..78557ab71 100644 --- a/src/test/incorrect/iflocal/gcc/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc/iflocal.expected @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l00000318"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000318: assume {:captureState "lmain_goto_l00000318"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l0000032d"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l0000032d; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected index 4bf716667..0ce1d7ed2 100644 --- a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l000008ff"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000008ff: assume {:captureState "lmain_goto_l000008ff"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l00000914"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000914; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/iflocal/gcc_pic/iflocal.expected b/src/test/incorrect/iflocal/gcc_pic/iflocal.expected index 4bf716667..0ce1d7ed2 100644 --- a/src/test/incorrect/iflocal/gcc_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc_pic/iflocal.expected @@ -130,7 +130,7 @@ implementation main() assume {:captureState "l000008ff"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000008ff: assume {:captureState "lmain_goto_l000008ff"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -139,5 +139,8 @@ implementation main() assume {:captureState "lmain_goto_l00000914"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000914; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected b/src/test/incorrect/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected index 9a6191d97..e2a86f07c 100644 --- a/src/test/incorrect/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected +++ b/src/test/incorrect/malloc_memcpy_strlen_memset_free/clang_O2/malloc_memcpy_strlen_memset_free.expected @@ -289,6 +289,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected b/src/test/incorrect/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected index b5e8b4dec..699c5028e 100644 --- a/src/test/incorrect/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected +++ b/src/test/incorrect/malloc_memcpy_strlen_memset_free/gcc_O2/malloc_memcpy_strlen_memset_free.expected @@ -287,6 +287,9 @@ implementation main() R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; + goto main_return; + main_return: + assume {:captureState "main_return"} true; return; } diff --git a/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected index e9595727d..c58d474bb 100644 --- a/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected @@ -152,7 +152,7 @@ implementation main() l00000396: assume {:captureState "l00000396"} true; assert Gamma_R8; - goto l00000396_goto_l0000039e, l00000396_goto_l0000045d; + goto l00000396_goto_l0000045d, l00000396_goto_l0000039e; l0000045d: assume {:captureState "l0000045d"} true; goto l0000045e; @@ -174,7 +174,7 @@ implementation main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; assert Gamma_ZF; - goto l0000039e_goto_l000003ce, l0000039e_goto_l000003d1; + goto l0000039e_goto_l000003d1, l0000039e_goto_l000003ce; l000003d1: assume {:captureState "l000003d1"} true; R8, Gamma_R8 := 1bv64, true; @@ -186,7 +186,7 @@ implementation main() l000003d4: assume {:captureState "l000003d4"} true; assert Gamma_R8; - goto l000003d4_goto_l000003dc, l000003d4_goto_l00000448; + goto l000003d4_goto_l00000448, l000003d4_goto_l000003dc; l00000448: assume {:captureState "l00000448"} true; goto l00000449; @@ -206,7 +206,7 @@ implementation main() NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; R8, Gamma_R8 := zero_extend32_32(bvadd32(#6, 1bv32)), Gamma_#6; assert Gamma_ZF; - goto l000003dc_goto_l00000407, l000003dc_goto_l0000040a; + goto l000003dc_goto_l0000040a, l000003dc_goto_l00000407; l0000040a: assume {:captureState "l0000040a"} true; R8, Gamma_R8 := 1bv64, true; @@ -234,7 +234,7 @@ implementation main() assume {:captureState "l00000415"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000390: assume {:captureState "lmain_goto_l00000390"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -283,5 +283,8 @@ implementation main() assume {:captureState "l0000040d_goto_l0000042c"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l0000042c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected index fb1393842..02557b876 100644 --- a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected @@ -140,7 +140,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000ae0, lmain_goto_l00000ae3; + goto lmain_goto_l00000ae3, lmain_goto_l00000ae0; l00000ae3: assume {:captureState "l00000ae3"} true; R8, Gamma_R8 := 1bv64, true; @@ -206,7 +206,7 @@ implementation main() NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; R8, Gamma_R8 := zero_extend32_32(bvadd32(#6, 1bv32)), Gamma_#6; assert Gamma_ZF; - goto l00000b2c_goto_l00000b57, l00000b2c_goto_l00000b5a; + goto l00000b2c_goto_l00000b5a, l00000b2c_goto_l00000b57; l00000b5a: assume {:captureState "l00000b5a"} true; R8, Gamma_R8 := 1bv64, true; @@ -234,7 +234,7 @@ implementation main() assume {:captureState "l00000b65"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000ae0: assume {:captureState "lmain_goto_l00000ae0"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -283,5 +283,8 @@ implementation main() assume {:captureState "l00000b5d_goto_l00000b7c"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000b7c; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected index 21323328b..6bf072afb 100644 --- a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected @@ -162,7 +162,7 @@ implementation main() NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; R8, Gamma_R8 := zero_extend32_32(bvadd32(#4, 1bv32)), Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l000003ab, lmain_goto_l000003ae; + goto lmain_goto_l000003ae, lmain_goto_l000003ab; l000003ae: assume {:captureState "l000003ae"} true; R8, Gamma_R8 := 1bv64, true; @@ -240,7 +240,7 @@ implementation main() l0000042a: assume {:captureState "l0000042a"} true; assert Gamma_R8; - goto l0000042a_goto_l00000432, l0000042a_goto_l00000449; + goto l0000042a_goto_l00000449, l0000042a_goto_l00000432; l00000449: assume {:captureState "l00000449"} true; goto l0000044a; @@ -258,7 +258,7 @@ implementation main() assume {:captureState "l00000432"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l000003ab: assume {:captureState "lmain_goto_l000003ab"} true; assume (bvcomp1(ZF, 1bv1) != 0bv1); @@ -307,5 +307,8 @@ implementation main() assume {:captureState "l0000042a_goto_l00000449"} true; assume (bvcomp1(R8[1:0], 1bv1) == 0bv1); goto l00000449; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected index 6ce2aa734..f3fac9965 100644 --- a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected @@ -138,7 +138,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000381, lmain_goto_l00000414; + goto lmain_goto_l00000414, lmain_goto_l00000381; l00000414: assume {:captureState "l00000414"} true; R0, Gamma_R0 := 3bv64, true; @@ -187,7 +187,7 @@ implementation main() assume {:captureState "l000003d8"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000381: assume {:captureState "lmain_goto_l00000381"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -212,5 +212,8 @@ implementation main() assume {:captureState "l000003b2_goto_l000003ed"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000003ed; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected index 7fb79cb20..2a1a9c7d2 100644 --- a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected @@ -138,7 +138,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#4, 1bv32), 0bv32), Gamma_#4; NF, Gamma_NF := bvadd32(#4, 1bv32)[32:31], Gamma_#4; assert Gamma_ZF; - goto lmain_goto_l00000a79, lmain_goto_l00000b0c; + goto lmain_goto_l00000b0c, lmain_goto_l00000a79; l00000b0c: assume {:captureState "l00000b0c"} true; R0, Gamma_R0 := 3bv64, true; @@ -173,7 +173,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#6, 1bv32), 0bv32), Gamma_#6; NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; assert Gamma_ZF; - goto l00000aaa_goto_l00000ad0, l00000aaa_goto_l00000ae5; + goto l00000aaa_goto_l00000ae5, l00000aaa_goto_l00000ad0; l00000ae5: assume {:captureState "l00000ae5"} true; R0, Gamma_R0 := 69632bv64, true; @@ -187,7 +187,7 @@ implementation main() assume {:captureState "l00000ad0"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000a79: assume {:captureState "lmain_goto_l00000a79"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -212,5 +212,8 @@ implementation main() assume {:captureState "l00000aaa_goto_l00000ae5"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l00000ae5; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected index 9caf56473..476bfca22 100644 --- a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected @@ -170,7 +170,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#5, 1bv32), 0bv32), Gamma_#5; NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; assert Gamma_ZF; - goto l00000383_goto_l000003b5, l00000383_goto_l0000040b; + goto l00000383_goto_l0000040b, l00000383_goto_l000003b5; l0000040b: assume {:captureState "l0000040b"} true; R0, Gamma_R0 := 5bv64, true; @@ -186,7 +186,7 @@ implementation main() ZF, Gamma_ZF := bvcomp32(bvadd32(#6, 1bv32), 0bv32), Gamma_#6; NF, Gamma_NF := bvadd32(#6, 1bv32)[32:31], Gamma_#6; assert Gamma_ZF; - goto l000003b5_goto_l000003db, l000003b5_goto_l000003f0; + goto l000003b5_goto_l000003f0, l000003b5_goto_l000003db; l000003f0: assume {:captureState "l000003f0"} true; R0, Gamma_R0 := 65536bv64, true; @@ -201,7 +201,7 @@ implementation main() assume {:captureState "l000003db"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; - return; + goto main_return; lmain_goto_l00000383: assume {:captureState "lmain_goto_l00000383"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) != 0bv1); @@ -226,5 +226,8 @@ implementation main() assume {:captureState "l000003b5_goto_l000003f0"} true; assume (bvnot1(bvcomp1(ZF, 1bv1)) == 0bv1); goto l000003f0; + main_return: + assume {:captureState "main_return"} true; + return; } diff --git a/src/test/scala/ir/IntrusiveListPublicInterfaceTest.scala b/src/test/scala/ir/IntrusiveListPublicInterfaceTest.scala new file mode 100644 index 000000000..49592975e --- /dev/null +++ b/src/test/scala/ir/IntrusiveListPublicInterfaceTest.scala @@ -0,0 +1,165 @@ +package ir +import org.scalatest.funsuite.AnyFunSuite +import intrusivelist.{IntrusiveList, IntrusiveListElement} + +case class Elem(val t: Int) extends IntrusiveListElement[Elem] + +class IntrusiveListPublicInterfaceTest extends AnyFunSuite { + + def getSequentialList(elems: Int = 15) : IntrusiveList[Elem] = { + val x = IntrusiveList[Elem]() + + for (i <- 0 until elems) { + x.append(Elem(i)) + } + x + } + + test("append size iter vals") { + + val x = IntrusiveList[Elem]() + + for (i <- 0 until 15) { + assert(x.size == i) + x.append(Elem(i)) + assert(x.size == i + 1) + } + + var j = 0 + for (v <- x) { + assert(v.t == j) + j += 1 + } + + assert(x(0).t == 0) + assert(x(1).t == 1) + assert(x(5).t == 5) + + } + + test("Append") { + val x = IntrusiveList[Elem]() + val toInsert = Elem(10) + val f = x.append(toInsert) + assert(x.size == 1) + assert(f eq toInsert) + + x.append(Elem(11)) + x.append(Elem(12)) + x.append(Elem(13)) + x.append(Elem(14)) + + x.foreach(println(_)) + + val y = x.head() + assert(y.t == 10) + assert(x.back().t == 14) + } + + test("Clear") { + val l = getSequentialList(15) + assert(l.size == 15) + l.clear() + assert(l.size == 0) + + for (e <- l) { + assert(false) + } + } + + test("Replace diff") { + val l = getSequentialList(5) + val old = Array.from(l) + assert(l(2).t == 2) + assert(l.size == 5) + l.replace(l(2), Elem(100)) + assert(l.size == 5) + assert(l(2).t == 100) + + for (i <- 0 until 5) { + if (i != 2) { + assert(l(i) == old(i)) + } + } + } + + test("Replace same") { + val l = getSequentialList(5) + val old = Array.from(l) + + assert(l(2).t == 2) + l.replace(l(2), l(2)) + assert(l.size == 5) + + for (i <- 0 until 5) { + assert(l(i) == old(i)) + } + } + + test("Swap list elems remove/insertAfter") { + val l = getSequentialList(5) + val old = Array.from(l) + + assert(l(2).t == 2) + val removed = l.remove(l(2)) + l.insertAfter(l(2), removed) + assert(l.size == 5) + assert(l(2).t == 3) + assert(l(3).t == 2) + + for (i <- 0 until 5) { + if (i != 2 && i != 3) { + assert(l(i) == old(i)) + } + } + } + + test("Prepend") { + val l = IntrusiveList[Elem]() + for (i <- 0 until 5) { + l.prepend(Elem(i)) + } + assert(l.size == 5) + + for (i <- 0 until 5) { + assert(l(i).t == 4 - i) + } + } + + test("prep/append") { + val l = IntrusiveList[Elem]() + for (i <- 0 until 5) { + l.prepend(Elem(i)) + l.append(Elem(i)) + } + assert(l.size == 10) + + for (i <- 0 until 5) { + assert(l(i).t == 4 - i) + } + for (i <- 0 until 5) { + assert(l(5 + i).t == i) + } + } + + test("iteratorFrom") { + val l = getSequentialList(10) + val it = l.iteratorFrom(l(2)) + assert(it.hasNext) + assert(it.next().t == 2) + assert(l.iteratorFrom(l(2)).length == 8) + assert(it.length == 7) + } + + test("addAll") { + val l = getSequentialList(3) + val toAdd = List(Elem(3),Elem(4),Elem(5)) + l.addAll(toAdd) + + for (i <- 0 until 6) { + assert(l(i).t == i) + } + } + + +} diff --git a/src/test/scala/ir/IntrusiveListTest.scala b/src/test/scala/ir/IntrusiveListTest.scala new file mode 100644 index 000000000..689ec3bd6 --- /dev/null +++ b/src/test/scala/ir/IntrusiveListTest.scala @@ -0,0 +1,74 @@ +package intrusivelist + +import org.scalatest.funsuite.AnyFunSuite + +case class Elem(val t: Float) extends IntrusiveListElement[Elem] +class IntrusiveListElemTest extends AnyFunSuite { + + test("basic") { + val x = IntrusiveList[Elem]() + val toInsert = Elem(10) + val f: IntrusiveListElement[Elem] = x.append(toInsert) + assert(x.size == 1) + assert(f.last() == f) + assert(f eq toInsert) + } + + test("ListElem traversal") { + val x = Elem(10); + val p1 = x.insertBefore(Elem(9)) + assert(p1.hasNext) + assert(x.hasPrev) + assert(p1.getNext eq x) + + assert(x.getPrev eq p1) + assert(x.getPrev == Elem(9)) + val p2 = p1.insertBefore(Elem(8)) + assert(p2.getNext eq p1) + assert(p1.getPrev eq p2) + val p3 = p2.insertBefore(Elem(7)) + + assert(x.last() == x) + assert(p3.first() == p3) + + assert(p3.getNext eq p2) + assert(p2.getPrev eq p3) + + assert(x.first() eq p3) + assert(p3.last() eq x) + + p2.insertAfter(Elem(8.5)) + assert(p3.last() eq x) + + p3.insertAfter(Elem(7.5)) + assert(x.first() eq p3) + } + + test("ListElem remove") { + val p0 = Elem(10) + val p1 = p0.insertAfter(Elem(9)) + val p2 = p1.insertAfter(Elem(8)) + val p3 = p2.insertAfter(Elem(7)) + + p2.remove() + assert(p3.first() == p0) + assert(p0.last() == p3) + } + + test("ListElem remove2") { + val p0 = Elem(10) + val p1 = p0.insertAfter(Elem(9)) + val p2 = p1.insertAfter(Elem(8)) + val p3 = p2.insertAfter(Elem(7)) + + p2.remove() + assert(p3.first() == p0) + assert(p0.last() == p3) + } + + + + // test("IntrusiveList insertRemove") + + +}