Use compressed code if the target supports it.
[riscv-tests.git] / debug / programs / step.S
index 6601548a5614fe158693dbbb3464a6f1b0dd9fc7..3e7b42e26c5dbbb517614d5cb2232700e7d239d4 100644 (file)
@@ -11,14 +11,18 @@ main:
         nop                             // 0x14
 one:
         beq     zero, t0, one           // 0x18
-        jal     two                     // 0x1c
+        // Use t0 instead of ra to force a 32-bit opcode in C mode. Otherwise
+        // 32-bit and 64-bit binaries end up with different instructions (I
+        // didn't pursue this).
+        jal     t0, two                 // 0x1c
 
 three:
         .word   0                       // 0x20
         nop                             // 0x24
 
 two:
-        ret                             // 0x28
+        jr      t0                      // 0x28
 
+        .align  2
 trap_entry:
         j       trap_entry              // 0x2c