.include "exit_return.s" .global _start _start: # Set base value of a0 to 'test failed' addi a0, zero, 1 # Construct value that ra should have in t0 auipc t0, 0 addi t0, t0, 12 # Jump and link jal ra, fn0 exret fnNeg: # All good addi a0, zero, 0 exret fn0: # Check ra value with our t0 construct beq t0, ra, eq0 exret eq0: # Try to jump back to a negative offset jal ra, fnNeg