[llvm] ea8b2cb - [AVR] Add disassembly tests for supported instructions
Ayke van Laethem via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 5 03:41:06 PST 2020
Author: Ayke van Laethem
Date: 2020-02-05T12:38:51+01:00
New Revision: ea8b2cb9bf5e79bfc9cc49c463b1f5ac9f7e5638
URL: https://github.com/llvm/llvm-project/commit/ea8b2cb9bf5e79bfc9cc49c463b1f5ac9f7e5638
DIFF: https://github.com/llvm/llvm-project/commit/ea8b2cb9bf5e79bfc9cc49c463b1f5ac9f7e5638.diff
LOG: [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
Added:
Modified:
llvm/test/MC/AVR/inst-break.s
llvm/test/MC/AVR/inst-des.s
llvm/test/MC/AVR/inst-eicall.s
llvm/test/MC/AVR/inst-eijmp.s
llvm/test/MC/AVR/inst-family-set-clr-flag.s
llvm/test/MC/AVR/inst-icall.s
llvm/test/MC/AVR/inst-ijmp.s
llvm/test/MC/AVR/inst-nop.s
llvm/test/MC/AVR/inst-ret.s
llvm/test/MC/AVR/inst-reti.s
llvm/test/MC/AVR/inst-sleep.s
llvm/test/MC/AVR/inst-wdr.s
Removed:
################################################################################
diff --git a/llvm/test/MC/AVR/inst-break.s b/llvm/test/MC/AVR/inst-break.s
index 09f572aa79df..059a309b9fc2 100644
--- a/llvm/test/MC/AVR/inst-break.s
+++ b/llvm/test/MC/AVR/inst-break.s
@@ -1,4 +1,5 @@
; 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
diff --git a/llvm/test/MC/AVR/inst-des.s b/llvm/test/MC/AVR/inst-des.s
index 1a2dffac957a..1e9a92534a9d 100644
--- a/llvm/test/MC/AVR/inst-des.s
+++ b/llvm/test/MC/AVR/inst-des.s
@@ -1,4 +1,5 @@
; 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
diff --git a/llvm/test/MC/AVR/inst-eicall.s b/llvm/test/MC/AVR/inst-eicall.s
index 007b9974d381..bbcabfdc7775 100644
--- a/llvm/test/MC/AVR/inst-eicall.s
+++ b/llvm/test/MC/AVR/inst-eicall.s
@@ -1,4 +1,5 @@
; 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
diff --git a/llvm/test/MC/AVR/inst-eijmp.s b/llvm/test/MC/AVR/inst-eijmp.s
index 4fee31616d0f..942af21fb930 100644
--- a/llvm/test/MC/AVR/inst-eijmp.s
+++ b/llvm/test/MC/AVR/inst-eijmp.s
@@ -1,4 +1,5 @@
; 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
diff --git a/llvm/test/MC/AVR/inst-family-set-clr-flag.s b/llvm/test/MC/AVR/inst-family-set-clr-flag.s
index 782aedfa0265..ef80b10b1b99 100644
--- a/llvm/test/MC/AVR/inst-family-set-clr-flag.s
+++ b/llvm/test/MC/AVR/inst-family-set-clr-flag.s
@@ -1,4 +1,5 @@
; 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
diff --git a/llvm/test/MC/AVR/inst-icall.s b/llvm/test/MC/AVR/inst-icall.s
index 6a4b32c9fcc5..2f25c82028fd 100644
--- a/llvm/test/MC/AVR/inst-icall.s
+++ b/llvm/test/MC/AVR/inst-icall.s
@@ -1,4 +1,5 @@
; RUN: llvm-mc -triple avr -mattr=ijmpcall -show-encoding < %s | FileCheck %s
+; RUN: llvm-mc -filetype=obj -triple avr -mattr=ijmpcall < %s | llvm-objdump -d -mattr=ijmpcall - | FileCheck -check-prefix=CHECK-INST %s
foo:
@@ -6,3 +7,5 @@ foo:
icall
; CHECK: icall ; encoding: [0x09,0x95]
+
+; CHECK-INST: icall
diff --git a/llvm/test/MC/AVR/inst-ijmp.s b/llvm/test/MC/AVR/inst-ijmp.s
index 0f2697693b4e..c16eea415e4e 100644
--- a/llvm/test/MC/AVR/inst-ijmp.s
+++ b/llvm/test/MC/AVR/inst-ijmp.s
@@ -1,4 +1,5 @@
; RUN: llvm-mc -triple avr -mattr=ijmpcall -show-encoding < %s | FileCheck %s
+; RUN: llvm-mc -filetype=obj -triple avr -mattr=ijmpcall < %s | llvm-objdump -d -mattr=ijmpcall - | FileCheck -check-prefix=CHECK-INST %s
foo:
@@ -6,3 +7,5 @@ foo:
ijmp
; CHECK: ijmp ; encoding: [0x09,0x94]
+
+; CHECK-INST: ijmp
diff --git a/llvm/test/MC/AVR/inst-nop.s b/llvm/test/MC/AVR/inst-nop.s
index 7ec127ae7c8f..5e09fed91cfa 100644
--- a/llvm/test/MC/AVR/inst-nop.s
+++ b/llvm/test/MC/AVR/inst-nop.s
@@ -1,4 +1,5 @@
; 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:
@@ -6,3 +7,5 @@ foo:
nop
; CHECK: nop ; encoding: [0x00,0x00]
+
+; CHECK-INST: nop
diff --git a/llvm/test/MC/AVR/inst-ret.s b/llvm/test/MC/AVR/inst-ret.s
index a12c985b532d..d39821c59d4f 100644
--- a/llvm/test/MC/AVR/inst-ret.s
+++ b/llvm/test/MC/AVR/inst-ret.s
@@ -1,4 +1,5 @@
; 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:
@@ -6,3 +7,5 @@ foo:
ret
; CHECK: ret ; encoding: [0x08,0x95]
+
+; CHECK-INST: ret
diff --git a/llvm/test/MC/AVR/inst-reti.s b/llvm/test/MC/AVR/inst-reti.s
index 8490658ce85a..43d0571e738d 100644
--- a/llvm/test/MC/AVR/inst-reti.s
+++ b/llvm/test/MC/AVR/inst-reti.s
@@ -1,4 +1,5 @@
; 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:
@@ -6,3 +7,5 @@ foo:
reti
; CHECK: reti ; encoding: [0x18,0x95]
+
+; CHECK-INST: reti
diff --git a/llvm/test/MC/AVR/inst-sleep.s b/llvm/test/MC/AVR/inst-sleep.s
index f1d18e6e4bd6..1483a8831cc3 100644
--- a/llvm/test/MC/AVR/inst-sleep.s
+++ b/llvm/test/MC/AVR/inst-sleep.s
@@ -1,4 +1,5 @@
; 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:
@@ -6,3 +7,5 @@ foo:
sleep
; CHECK: sleep ; encoding: [0x88,0x95]
+
+; CHECK-INST: sleep
diff --git a/llvm/test/MC/AVR/inst-wdr.s b/llvm/test/MC/AVR/inst-wdr.s
index d63363a3287a..66a1544ce5c4 100644
--- a/llvm/test/MC/AVR/inst-wdr.s
+++ b/llvm/test/MC/AVR/inst-wdr.s
@@ -1,4 +1,5 @@
; 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:
@@ -6,3 +7,5 @@ foo:
wdr
; CHECK: wdr ; encoding: [0xa8,0x95]
+
+; CHECK-INST: wdr
More information about the llvm-commits
mailing list