Unverified Commit ea8b2cb9 authored by Ayke van Laethem's avatar Ayke van Laethem
Browse files

[AVR] Add disassembly tests for supported instructions

The disassembler of the AVR backend is incomplete: most instructions do
not correctly disassemble yet.

This patch is the first in a series to add disassembly support to the
AVR backend. It starts with adding disassembler tests for instructions
that already disassemble correctly.

Differential Revision: https://reviews.llvm.org/D73911
parent 2f1ca30f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
; RUN: llvm-mc -triple avr -mattr=break -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr -mattr=break < %s | llvm-objdump -d -mattr=break - | FileCheck -check-prefix=CHECK-INST %s


foo:
@@ -6,3 +7,5 @@ foo:
  break

; CHECK: break                  ; encoding: [0x98,0x95]

; CHECK-INST: break
+6 −0
Original line number Diff line number Diff line
; RUN: llvm-mc -triple avr -mattr=des -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr -mattr=des < %s | llvm-objdump -d -mattr=des - | FileCheck -check-prefix=CHECK-INST %s


foo:
@@ -12,3 +13,8 @@ foo:
; CHECK: des 6                  ; encoding: [0x6b,0x94]
; CHECK: des 1                  ; encoding: [0x1b,0x94]
; CHECK: des 8                  ; encoding: [0x8b,0x94]

; CHECK-INST: des 0
; CHECK-INST: des 6
; CHECK-INST: des 1
; CHECK-INST: des 8
+3 −0
Original line number Diff line number Diff line
; RUN: llvm-mc -triple avr -mattr=eijmpcall -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr -mattr=eijmpcall < %s | llvm-objdump -d -mattr=eijmpcall - | FileCheck -check-prefix=CHECK-INST %s


foo:
@@ -6,3 +7,5 @@ foo:
  eicall

; CHECK: eicall                  ; encoding: [0x19,0x95]

; CHECK-INST: eicall
+3 −0
Original line number Diff line number Diff line
; RUN: llvm-mc -triple avr -mattr=eijmpcall -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr -mattr=eijmpcall < %s | llvm-objdump -d -mattr=eijmpcall - | FileCheck -check-prefix=CHECK-INST %s


foo:
@@ -6,3 +7,5 @@ foo:
  eijmp

; CHECK: eijmp                  ; encoding: [0x19,0x94]

; CHECK-INST: eijmp
+35 −0
Original line number Diff line number Diff line
; RUN: llvm-mc -triple avr -show-encoding < %s | FileCheck %s
; RUN: llvm-mc -filetype=obj -triple avr < %s | llvm-objdump -d - | FileCheck -check-prefix=CHECK-INST %s

foo:

@@ -103,3 +104,37 @@ cli
; CHECK: clt               ; encoding: [0xe8,0x94]
; CHECK: cli               ; encoding: [0xf8,0x94]
; CHECK: cli               ; encoding: [0xf8,0x94]

; CHECK-INST: sec
; CHECK-INST: sec
; CHECK-INST: sez
; CHECK-INST: sez
; CHECK-INST: sen
; CHECK-INST: sen
; CHECK-INST: sev
; CHECK-INST: sev
; CHECK-INST: ses
; CHECK-INST: ses
; CHECK-INST: seh
; CHECK-INST: seh
; CHECK-INST: set
; CHECK-INST: set
; CHECK-INST: sei
; CHECK-INST: sei

; CHECK-INST: clc
; CHECK-INST: clc
; CHECK-INST: clz
; CHECK-INST: clz
; CHECK-INST: cln
; CHECK-INST: cln
; CHECK-INST: clv
; CHECK-INST: clv
; CHECK-INST: cls
; CHECK-INST: cls
; CHECK-INST: clh
; CHECK-INST: clh
; CHECK-INST: clt
; CHECK-INST: clt
; CHECK-INST: cli
; CHECK-INST: cli
Loading