Skip to content

Commit

Permalink
[SystemZ][z/OS] Additional test coverage for validating dialect instr…
Browse files Browse the repository at this point in the history
…uctions for SystemZ

- There are certain instructions most notably those with extended mnemonics that restricted to only the gnu/att variant
- There are also certain instruction aliases/mnemonic aliases that are restricted only to the HLASM variant (see https://reviews.llvm.org/D97581, https://reviews.llvm.org/D94250 and https://reviews.llvm.org/D92185 for reference)
- This patch adds a few tests to check for the behaviour introduced in the above patches. The testing coverage could not be added in at the same time, due to parallel work being done introducing the HLASM syntax

Reviewed By: uweigand, abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D112172
  • Loading branch information
aniprasad committed Oct 21, 2021
1 parent 3ea7877 commit fa111d3
Show file tree
Hide file tree
Showing 6 changed files with 443 additions and 0 deletions.
60 changes: 60 additions & 0 deletions llvm/test/MC/SystemZ/insn-bad-zos-z13.s
@@ -0,0 +1,60 @@
*For z13 only.
*RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=z13 < %s 2> %t
*RUN: FileCheck < %t %s
*RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=arch11 < %s 2> %t
*RUN: FileCheck < %t %s


*CHECK-COUNT-6: error: invalid instruction
lochihe 1,2
locghihe 1,2
lochhihe 1,2
locfhrhe 1,3
locfhhe 1,2(3)
stocfhhe 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
lochile 1,2
locghile 1,2
lochhile 1,2
locfhrle 1,3
locfhle 1,2(3)
stocfhle 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
lochilh 1,2
locghilh 1,2
lochhilh 1,2
locfhrlh 1,3
locfhlh 1,2(3)
stocfhlh 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
lochinhe 1,2
locghinhe 1,2
lochhinhe 1,2
locfhrnhe 1,3
locfhnhe 1,2(3)
stocfhnhe 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
lochinle 1,2
locghinle 1,2
lochhinle 1,2
locfhrnle 1,3
locfhnle 1,2(3)
stocfhnle 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
lochinlh 1,2
locghinlh 1,2
lochhinlh 1,2
locfhrnlh 1,3
locfhnlh 1,2(3)
stocfhnlh 1,2(3)

23 changes: 23 additions & 0 deletions llvm/test/MC/SystemZ/insn-bad-zos-z14.s
@@ -0,0 +1,23 @@
* For z14 only.
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=z14 < %s 2> %t
* RUN: FileCheck < %t %s
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=arch12 < %s 2> %t
* RUN: FileCheck < %t %s

*CHECK: error: invalid instruction
binle 0(1)

*CHECK: error: invalid instruction
binhe 0(1)

*CHECK: error: invalid instruction
bilh 0(1)

*CHECK: error: invalid instruction
binlh 0(1)

*CHECK: error: invalid instruction
bihe 0(1)

*CHECK: error: invalid instruction
bile 0(1)
41 changes: 41 additions & 0 deletions llvm/test/MC/SystemZ/insn-bad-zos-z15.s
@@ -0,0 +1,41 @@
* For z15 only.
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=z15 < %s 2> %t
* RUN: FileCheck < %t %s
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=arch13 < %s 2> %t
* RUN: FileCheck < %t %s

*CHECK-COUNT-3: error: invalid instruction
selrnle 0,1,2
selfhrnle 0,1,2
selgrnle 0,1,2


*CHECK-COUNT-3: error: invalid instruction
selrnhe 0,1,2
selfhrnhe 0,1,2
selgrnhe 0,1,2


*CHECK-COUNT-3: error: invalid instruction
selrnlh 0,1,2
selfhrnlh 0,1,2
selgrnlh 0,1,2


*CHECK-COUNT-3: error: invalid instruction
selrlh 0,1,2
selfhrlh 0,1,2
selgrlh 0,1,2


*CHECK-COUNT-3: error: invalid instruction
selrhe 0,1,2
selfhrhe 0,1,2
selgrhe 0,1,2


*CHECK-COUNT-3: error: invalid instruction
selrle 0,1,2
selfhrle 0,1,2
selgrle 0,1,2

59 changes: 59 additions & 0 deletions llvm/test/MC/SystemZ/insn-bad-zos-z196.s
@@ -0,0 +1,59 @@
* For z196 and above.
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=z196 < %s 2> %t
* RUN: FileCheck < %t %s
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=arch9 < %s 2> %t
* RUN: FileCheck < %t %s

*CHECK-COUNT-6: error: invalid instruction
locrhe 1,2
locgrhe 1,2
loche 1,2(3)
locghe 1,2(3)
stoche 1,2(3)
stocghe 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
locrle 1,2
locgrle 1,2
locle 1,2(3)
locgle 1,2(3)
stocle 1,2(3)
stocgle 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
locrlh 1,2
locgrlh 1,2
loclh 1,2(3)
locglh 1,2(3)
stoclh 1,2(3)
stocglh 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
locrnhe 1,2
locgrnhe 1,2
locnhe 1,2(3)
locgnhe 1,2(3)
stocnhe 1,2(3)
stocgnhe 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
locrnle 1,2
locgrnle 1,2
locnle 1,2(3)
locgnle 1,2(3)
stocnle 1,2(3)
stocgnle 1,2(3)


*CHECK-COUNT-6: error: invalid instruction
locrnlh 1,2
locgrnlh 1,2
locnlh 1,2(3)
locgnlh 1,2(3)
stocnlh 1,2(3)
stocgnlh 1,2(3)

158 changes: 158 additions & 0 deletions llvm/test/MC/SystemZ/insn-bad-zos.s
@@ -0,0 +1,158 @@
* For z10 only.
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=z10 < %s 2> %t
* RUN: FileCheck < %t %s
* RUN: not llvm-mc -triple s390x-ibm-zos -mcpu=arch8 < %s 2> %t
* RUN: FileCheck < %t %s

*CHECK: error: invalid instruction
jgnop foo

*CHECK: error: invalid instruction
jg foo

*CHECK-COUNT-22: error: invalid instruction
jnle foo
brnle foo
jgnle foo
brnlel foo
bnle 0(1)
bnler 1
crjnle 1,2,*+100
cgrjnle 1,2,*+100
cijnle 1,100,*+200
cgijnle 1,100,*+200
clrjnle 1,2,*+200
clgrjnle 1,2,*+200
clijnle 1,100,*+100
clgijnle 1,100,*+100
crtnle 0,foo
cgrtnle 0,foo
clrtnle 0,foo
clgrtnle 0,foo
citnle 1,foo
cgitnle 1,foo
clfitnle 1,foo
clgitnle 1,foo


*CHECK-COUNT-22: error: invalid instruction
jnhe foo
brnhe foo
jgnhe foo
brnhel foo
bnhe 0(1)
bnher 1
crjnhe 1,2,*+100
cgrjnhe 1,2,*+100
cijnhe 1,100,*+200
clgijnle 1,100,*+100
cgijnhe 1,100,*+200
clrjnhe 1,2,*+200
clgrjnhe 1,2,*+200
clijnhe 1,100,*+100
crtnhe 0,1
cgrtnhe 0,1
clrtnhe 0,1
clgrtnhe 0,1
citnhe 1,1
cgitnhe 1,1
clfitnhe 1,1
clgitnhe 1,1


*CHECK-COUNT-22: error: invalid instruction
jnlh foo
brnlh foo
jgnlh foo
brnlhl foo
bnlh 0(1)
bnlhr 1
crjnlh 1,2,*+200
cgrjnlh 1,2,*+200
cijnlh 1,100,*+200
cgijnlh 1,100,*+200
clrjnlh 1,2,*+200
clgrjnlh 1,2,*+200
clijnlh 1,100,*+100
clgijnlh 1,100,*+100
crtnlh 0,1
cgrtnlh 0,1
clrtnlh 0,1
clgrtnlh 0,1
citnlh 1,1
cgitnlh 1,1
clfitnlh 1,1
clgitnlh 1,1

*CHECK-COUNT-22: error: invalid instruction
brlh foo
jglh foo
jllh foo
brlhl foo
blh 0(1)
blhr 1
crjlh 1,2,*+100
cgrjlh 1,2,*+100
cijlh 1,100,*+200
cgijlh 1,100,*+200
clrjlh 1,2,*+200
clgrjlh 1,2,*+200
clijlh 1,100,*+100
clgijlh 1,100,*+100
crtlh 0,1
cgrtlh 0,1
clrtlh 0,1
clgrtlh 0,1
citlh 1,1
cgitlh 1,1
clfitlh 1,1
clgitlh 1,1

*CHECK-COUNT-22: error: invalid instruction
jhe foo
brhe foo
jghe foo
brhel foo
bhe 0(1)
bher 1
crjhe 1,2,*+200
cgrjhe 1,2,*+200
cijhe 1,100,*+200
cgijhe 1,100,*+200
clrjhe 1,2,*+200
clgrjhe 1,2,*+200
clijhe 1,100,*+100
clgijhe 1,100,*+100
crthe 0,1
cgrthe 0,1
clrthe 0,1
clgrthe 0,1
cithe 1,1
cgithe 1,1
clfithe 1,1
clgithe 1,1

*CHECK-COUNT-22: error: invalid instruction
brle foo
jgle foo
jlle foo
brlel foo
ble 0(1)
bler 1
crjle 1,2,*+200
cgrjle 1,2,*+200
cijle 1,100,*+200
cgijle 1,100,*+200
clrjle 1,2,*+200
clgrjle 1,2,*+200
clijle 1,100,*+200
clgijle 1,100,*+100
crtle 0,1
cgrtle 0,1
clrtle 0,1
clgrtle 0,1
citle 1,1
cgitle 1,1
clfitle 1,1
clgitle 1,1

0 comments on commit fa111d3

Please sign in to comment.