Skip to content

Commit 94923e1

Browse files
author
H. Peter Anvin (Intel)
committed
travis: improve the RET instruction test
Split the RET instruction test by mode for ease of disassembly, and test more subcases. Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
1 parent e19c989 commit 94923e1

File tree

10 files changed

+111
-56
lines changed

10 files changed

+111
-56
lines changed

test/ret.asm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
retd
3737
retnd
3838
retfd
39+
o16 ret
40+
o16 retn
41+
o16 retf
42+
o32 ret
43+
o32 retn
44+
o32 retf
3945
%ifdef ERROR
4046
retq
4147
retnq

travis/test/ret-16.bin.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
������f�f�f����f�f�f�

travis/test/ret-16.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
./travis/test/ret.asm:16: error: instruction not supported in 16-bit mode
2-
./travis/test/ret.asm:17: error: instruction not supported in 16-bit mode
3-
./travis/test/ret.asm:18: error: instruction not supported in 16-bit mode
4-
./travis/test/ret.asm:56: error: instruction not supported in 16-bit mode
5-
./travis/test/ret.asm:57: error: instruction not supported in 16-bit mode
6-
./travis/test/ret.asm:58: error: instruction not supported in 16-bit mode
1+
./travis/test/ret.asm:26: error: instruction not supported in 16-bit mode
2+
./travis/test/ret.asm:27: error: instruction not supported in 16-bit mode
3+
./travis/test/ret.asm:28: error: instruction not supported in 16-bit mode
4+
./travis/test/ret.asm:29: error: invalid operands in 16-bit mode
5+
./travis/test/ret.asm:30: error: invalid operands in 16-bit mode
6+
./travis/test/ret.asm:31: error: invalid operands in 16-bit mode

travis/test/ret-32.bin.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
���f�f�f����f�f�f����

travis/test/ret-32.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
./travis/test/ret.asm:35: error: instruction not supported in 32-bit mode
2-
./travis/test/ret.asm:36: error: instruction not supported in 32-bit mode
3-
./travis/test/ret.asm:37: error: instruction not supported in 32-bit mode
1+
./travis/test/ret.asm:54: error: instruction not supported in 32-bit mode
2+
./travis/test/ret.asm:55: error: instruction not supported in 32-bit mode
43
./travis/test/ret.asm:56: error: instruction not supported in 32-bit mode
5-
./travis/test/ret.asm:57: error: instruction not supported in 32-bit mode
6-
./travis/test/ret.asm:58: error: instruction not supported in 32-bit mode
4+
./travis/test/ret.asm:57: error: invalid operands in 32-bit mode
5+
./travis/test/ret.asm:58: error: invalid operands in 32-bit mode
6+
./travis/test/ret.asm:59: error: invalid operands in 32-bit mode

travis/test/ret-64.bin.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
���f�f�f�f�f�f�����H���H�

travis/test/ret-64.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
./travis/test/ret.asm:51: error: instruction not supported in 64-bit mode
2-
./travis/test/ret.asm:52: error: instruction not supported in 64-bit mode
1+
./travis/test/ret.asm:76: error: instruction not supported in 64-bit mode
2+
./travis/test/ret.asm:77: error: instruction not supported in 64-bit mode

travis/test/ret.asm

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
;; All the flavors of RET
1+
;; All the flavors of RET
22

3-
%ifdef TEST_BITS_16
3+
%ifndef TEST_BITS
4+
%define TEST_BITS (16|32|64)
5+
%endif
6+
7+
%if (TEST_BITS) & 16
48
bits 16
59

610
ret
@@ -12,14 +16,23 @@
1216
retd
1317
retnd
1418
retfd
19+
o16 ret
20+
o16 retn
21+
o16 retf
22+
o32 ret
23+
o32 retn
24+
o32 retf
1525
%ifdef ERROR
1626
retq
1727
retnq
1828
retfq
29+
o64 ret
30+
o64 retn
31+
o64 retf
1932
%endif
2033
%endif
2134

22-
%ifdef TEST_BITS_32
35+
%if (TEST_BITS) & 32
2336
bits 32
2437

2538
ret
@@ -31,14 +44,23 @@
3144
retd
3245
retnd
3346
retfd
47+
o16 ret
48+
o16 retn
49+
o16 retf
50+
o32 ret
51+
o32 retn
52+
o32 retf
3453
%ifdef ERROR
3554
retq
3655
retnq
3756
retfq
57+
o64 ret
58+
o64 retn
59+
o64 retf
3860
%endif
3961
%endif
4062

41-
%ifdef TEST_BITS_64
63+
%if (TEST_BITS) & 64
4264
bits 64
4365

4466
ret
@@ -47,12 +69,21 @@
4769
retw
4870
retnw
4971
retfw
72+
o16 ret
73+
o16 retn
74+
o16 retf
5075
%ifdef ERROR
5176
retd
5277
retnd
53-
%endif
78+
o32 ret
79+
o32 retn
5480
%endif
5581
retfd
82+
o32 retf
5683
retq
5784
retnq
5885
retfq
86+
o64 ret
87+
o64 retn
88+
o64 retf
89+
%endif

travis/test/ret.bin.t

Lines changed: 0 additions & 1 deletion
This file was deleted.

travis/test/ret.json

Lines changed: 53 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,55 @@
11
[
2-
{
3-
"description": "Test all the flavors of RET",
4-
"id": "ret",
5-
"format": "bin",
6-
"source": "ret.asm",
7-
"option": "-Ox -DTEST_BITS_16 -DTEST_BITS_32 -DTEST_BITS_64",
8-
"target": [
9-
{ "output": "ret.bin" }
10-
]
11-
},
12-
{
13-
"description": "Test all the flavors of RET (err 16 bit)",
14-
"ref": "ret",
15-
"option": "-DERROR -DTEST_BITS_16",
16-
"target": [
17-
{ "stderr": "ret-16.stderr" }
18-
],
19-
"error": "expected"
20-
},
21-
{
22-
"description": "Test all the flavors of RET (err 32 bit)",
23-
"ref": "ret",
24-
"option": "-DERROR -DTEST_BITS_32",
25-
"target": [
26-
{ "stderr": "ret-32.stderr" }
27-
],
28-
"error": "expected"
29-
},
30-
{
31-
"description": "Test all the flavors of RET (err 64 bit)",
32-
"ref": "ret",
33-
"option": "-DERROR -DTEST_BITS_64",
34-
"target": [
35-
{ "stderr": "ret-64.stderr" }
36-
],
37-
"error": "expected"
38-
}
2+
{
3+
"description": "Test all the flavors of RET (16 bit)",
4+
"id": "ret",
5+
"format": "bin",
6+
"source": "ret.asm",
7+
"option": "-Ox -DTEST_BITS=16",
8+
"target": [
9+
{ "output": "ret-16.bin" }
10+
]
11+
},
12+
{
13+
"description": "Test all the flavors of RET (32 bit)",
14+
"ref": "ret",
15+
"option": "-Ox -DTEST_BITS=32",
16+
"target": [
17+
{ "output": "ret-32.bin" }
18+
]
19+
},
20+
{
21+
"description": "Test all the flavors of RET (64 bit)",
22+
"ref": "ret",
23+
"option": "-Ox -DTEST_BITS=64",
24+
"target": [
25+
{ "output": "ret-64.bin" }
26+
]
27+
},
28+
{
29+
"description": "Test all the flavors of RET (err 16 bit)",
30+
"ref": "ret",
31+
"option": "-Ox -DERROR -DTEST_BITS=16",
32+
"target": [
33+
{ "stderr": "ret-16.stderr" }
34+
],
35+
"error": "expected"
36+
},
37+
{
38+
"description": "Test all the flavors of RET (err 32 bit)",
39+
"ref": "ret",
40+
"option": "-Ox -DERROR -DTEST_BITS=32",
41+
"target": [
42+
{ "stderr": "ret-32.stderr" }
43+
],
44+
"error": "expected"
45+
},
46+
{
47+
"description": "Test all the flavors of RET (err 64 bit)",
48+
"ref": "ret",
49+
"option": "-Ox -DERROR -DTEST_BITS=64",
50+
"target": [
51+
{ "stderr": "ret-64.stderr" }
52+
],
53+
"error": "expected"
54+
}
3955
]

0 commit comments

Comments
 (0)