aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/i386.exp13
-rw-r--r--gas/testsuite/gas/i386/nop-1.d31
-rw-r--r--gas/testsuite/gas/i386/nop-1.s21
-rw-r--r--gas/testsuite/gas/i386/nop-2.d40
-rw-r--r--gas/testsuite/gas/i386/nop-2.s22
-rw-r--r--gas/testsuite/gas/i386/nop-3.d20
-rw-r--r--gas/testsuite/gas/i386/nop-3.s15
-rw-r--r--gas/testsuite/gas/i386/nop-4.d23
-rw-r--r--gas/testsuite/gas/i386/nop-4.s18
-rw-r--r--gas/testsuite/gas/i386/nop-5.d25
-rw-r--r--gas/testsuite/gas/i386/nop-5.s19
-rw-r--r--gas/testsuite/gas/i386/nop-6.d17
-rw-r--r--gas/testsuite/gas/i386/nop-6.s25
-rw-r--r--gas/testsuite/gas/i386/nop-bad-1.l4
-rw-r--r--gas/testsuite/gas/i386/nop-bad-1.s4
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-1.d32
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-2.d41
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-3.d21
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-4.d24
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-5.d26
-rw-r--r--gas/testsuite/gas/i386/x86-64-nop-6.d18
21 files changed, 459 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index a21ef84..0ca49ea 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -431,6 +431,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "align-1a"
run_dump_test "align-1b"
run_list_test "inval-pseudo" "-al"
+ run_dump_test "nop-1"
+ run_dump_test "nop-2"
# These tests require support for 8 and 16 bit relocs,
# so we only run them for ELF and COFF targets.
@@ -494,6 +496,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "got-no-relax"
run_dump_test "addend"
+ run_dump_test "nop-3"
+ run_dump_test "nop-4"
+ run_dump_test "nop-5"
+ run_dump_test "nop-6"
if { [gas_64_check] } then {
run_dump_test "att-regs"
@@ -538,6 +544,7 @@ if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
run_list_test "space1" "-al"
run_dump_test rept
run_dump_test pr19498
+ run_list_test "nop-bad-1" ""
if [is_elf_format] then {
run_list_test_stdin "list-1" "-al"
run_list_test_stdin "list-2" "-al"
@@ -904,6 +911,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_list_test "x86-64-notrackbad" "-al"
run_dump_test "x86-64-movd"
run_dump_test "x86-64-movd-intel"
+ run_dump_test "x86-64-nop-1"
+ run_dump_test "x86-64-nop-2"
if { ![istarget "*-*-aix*"]
&& ![istarget "*-*-beos*"]
@@ -961,6 +970,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-gotpcrel-no-relax"
run_dump_test "x86-64-addend"
+ run_dump_test "x86-64-nop-3"
+ run_dump_test "x86-64-nop-4"
+ run_dump_test "x86-64-nop-5"
+ run_dump_test "x86-64-nop-6"
}
set ASFLAGS "$old_ASFLAGS"
diff --git a/gas/testsuite/gas/i386/nop-1.d b/gas/testsuite/gas/i386/nop-1.d
new file mode 100644
index 0000000..46422c8
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-1.d
@@ -0,0 +1,31 @@
+#objdump: -drw
+#name: i386 .nop 1
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <single>:
+ +[a-f0-9]+: 90 nop
+
+0+1 <pseudo_1>:
+ +[a-f0-9]+: 90 nop
+
+0+2 <pseudo_8>:
+ +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%eax,%eax,1\)
+
+0+a <pseudo_8_4>:
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
+
+0+12 <pseudo_20>:
+ +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+26 <pseudo_30>:
+ +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+#pass
diff --git a/gas/testsuite/gas/i386/nop-1.s b/gas/testsuite/gas/i386/nop-1.s
new file mode 100644
index 0000000..891783d
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-1.s
@@ -0,0 +1,21 @@
+ .text
+single:
+ .nop 0
+ nop
+
+pseudo_1:
+ .nop 1
+
+pseudo_8:
+ .nop 8
+
+pseudo_8_4:
+ .nop 8, 4
+
+pseudo_20:
+ .nop 20
+
+pseudo_30:
+ .nop 30
+
+ xor %eax, %eax
diff --git a/gas/testsuite/gas/i386/nop-2.d b/gas/testsuite/gas/i386/nop-2.d
new file mode 100644
index 0000000..332b990
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-2.d
@@ -0,0 +1,40 @@
+#objdump: -drw -Mi8086
+#name: i386 .nop 2
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <single>:
+ +[a-f0-9]+: 90 nop
+
+0+1 <pseudo_1>:
+ +[a-f0-9]+: 90 nop
+
+0+2 <pseudo_8>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+
+0+a <pseudo_8_4>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+
+0+12 <pseudo_20>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+
+0+26 <pseudo_30>:
+ +[a-f0-9]+: 89 f6 mov %si,%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 66 31 c0 xor %eax,%eax
+#pass
diff --git a/gas/testsuite/gas/i386/nop-2.s b/gas/testsuite/gas/i386/nop-2.s
new file mode 100644
index 0000000..2b71b97
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-2.s
@@ -0,0 +1,22 @@
+ .text
+ .code16
+single:
+ .nop 0
+ nop
+
+pseudo_1:
+ .nop 1
+
+pseudo_8:
+ .nop 8
+
+pseudo_8_4:
+ .nop 8, 4
+
+pseudo_20:
+ .nop 20
+
+pseudo_30:
+ .nop 30
+
+ xor %eax, %eax
diff --git a/gas/testsuite/gas/i386/nop-3.d b/gas/testsuite/gas/i386/nop-3.d
new file mode 100644
index 0000000..bebd24b
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-3.d
@@ -0,0 +1,20 @@
+#objdump: -drw
+#name: i386 .nop 3
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 0f 1f 00 nopl \(%eax\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: e9 fc ff ff ff jmp 1 <.altinstr_replacement\+0x1> 1: (R_386_PC)?(DISP)?32 foo
+#pass
diff --git a/gas/testsuite/gas/i386/nop-3.s b/gas/testsuite/gas/i386/nop-3.s
new file mode 100644
index 0000000..57370ff
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-3.s
@@ -0,0 +1,15 @@
+ .text
+_start:
+ xor %eax, %eax
+140:
+ testl %eax, %eax
+141:
+ .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b)),7
+142:
+ xor %eax, %eax
+ .pushsection .altinstr_replacement,"ax"
+143:
+ jmp foo
+144:
+ .popsection
+ xor %eax, %eax
diff --git a/gas/testsuite/gas/i386/nop-4.d b/gas/testsuite/gas/i386/nop-4.d
new file mode 100644
index 0000000..99ddcd3
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-4.d
@@ -0,0 +1,23 @@
+#objdump: -drw
+#name: i386 .nop 4
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: e9 fc ff ff ff jmp 7 <.altinstr_replacement\+0x7> 7: (R_386_PC)?(DISP)?32 foo
+#pass
diff --git a/gas/testsuite/gas/i386/nop-4.s b/gas/testsuite/gas/i386/nop-4.s
new file mode 100644
index 0000000..f7aa111
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-4.s
@@ -0,0 +1,18 @@
+ .text
+_start:
+ xor %eax, %eax
+140:
+ testl %eax, %eax
+141:
+ .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b))
+142:
+ xor %eax, %eax
+ .pushsection .altinstr_replacement,"ax"
+143:
+ mov %eax, %eax
+ mov %eax, %eax
+ mov %eax, %eax
+ jmp foo
+144:
+ .popsection
+ xor %eax, %eax
diff --git a/gas/testsuite/gas/i386/nop-5.d b/gas/testsuite/gas/i386/nop-5.d
new file mode 100644
index 0000000..aab4258
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-5.d
@@ -0,0 +1,25 @@
+#objdump: -drw
+#name: i386 .nop 5
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: e9 fc ff ff ff jmp 9 <.altinstr_replacement\+0x9> 9: (R_386_PC)?(DISP)?32 foo
+#pass
diff --git a/gas/testsuite/gas/i386/nop-5.s b/gas/testsuite/gas/i386/nop-5.s
new file mode 100644
index 0000000..4f563ce
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-5.s
@@ -0,0 +1,19 @@
+ .text
+_start:
+ xor %eax, %eax
+140:
+ testl %eax, %eax
+141:
+ .nop -(((144f-143f)-(141b-140b)) > 0)*((144f-143f)-(141b-140b)),6
+142:
+ xor %eax, %eax
+ .pushsection .altinstr_replacement,"ax"
+143:
+ mov %eax, %eax
+ mov %eax, %eax
+ mov %eax, %eax
+ mov %eax, %eax
+ jmp foo
+144:
+ .popsection
+ xor %eax, %eax
diff --git a/gas/testsuite/gas/i386/nop-6.d b/gas/testsuite/gas/i386/nop-6.d
new file mode 100644
index 0000000..93ee8de
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-6.d
@@ -0,0 +1,17 @@
+#objdump: -drw
+#name: i386 .nop 6
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%eax\)
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 75 fe jne 0 <_start>
+ +[a-f0-9]+: 89 c4 mov %eax,%esp
+#pass
diff --git a/gas/testsuite/gas/i386/nop-6.s b/gas/testsuite/gas/i386/nop-6.s
new file mode 100644
index 0000000..c7b1e2c
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-6.s
@@ -0,0 +1,25 @@
+.macro mknops nr_bytes
+ .nop \nr_bytes, 9
+.endm
+
+.macro ALTERNATIVE
+.L\@_orig_s:
+.L\@_orig_e:
+ mknops (-(((.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_e - .L\@_orig_s)) > 0) * ((.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_e - .L\@_orig_s)))
+.L\@_orig_p:
+
+ .section .discard, "a", @progbits
+ .byte (.L\@_orig_p - .L\@_orig_s)
+ .byte 0xff + (.L\@_repl_e\()1 - .L\@_repl_s\()1) - (.L\@_orig_p - .L\@_orig_s)
+
+ .section .altinstr_replacement, "ax", @progbits
+.L\@_repl_s\()1:
+.L\@_fill_rsb_loop:
+ jnz .L\@_fill_rsb_loop
+ mov %eax, %esp
+.L\@_repl_e\()1:
+.endm
+
+ .text
+_start:
+ALTERNATIVE
diff --git a/gas/testsuite/gas/i386/nop-bad-1.l b/gas/testsuite/gas/i386/nop-bad-1.l
new file mode 100644
index 0000000..34be496
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-bad-1.l
@@ -0,0 +1,4 @@
+.*: Assembler messages:
+.*:2: Warning: negative nop control byte, ignored
+.*:4: Warning: \.space, \.nop or \.fill with negative value, ignored
+.*:3: Error: invalide single nop size: 20 \(expect within \[0, [0-9]+\]\)
diff --git a/gas/testsuite/gas/i386/nop-bad-1.s b/gas/testsuite/gas/i386/nop-bad-1.s
new file mode 100644
index 0000000..53cc7d5
--- /dev/null
+++ b/gas/testsuite/gas/i386/nop-bad-1.s
@@ -0,0 +1,4 @@
+ .text
+ .nop 100, -2
+ .nop 100, 20
+ .nop -1
diff --git a/gas/testsuite/gas/i386/x86-64-nop-1.d b/gas/testsuite/gas/i386/x86-64-nop-1.d
new file mode 100644
index 0000000..f3edc7d
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-1.d
@@ -0,0 +1,32 @@
+#source: nop-1.s
+#objdump: -drw
+#name: x86-64 .nop 1
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <single>:
+ +[a-f0-9]+: 90 nop
+
+0+1 <pseudo_1>:
+ +[a-f0-9]+: 90 nop
+
+0+2 <pseudo_8>:
+ +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\)
+
+0+a <pseudo_8_4>:
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\)
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\)
+
+0+12 <pseudo_20>:
+ +[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%rax,%rax,1\)
+ +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+26 <pseudo_30>:
+ +[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl 0x0\(%rax,%rax,1\)
+ +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 67 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0\(%eax,%eax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-nop-2.d b/gas/testsuite/gas/i386/x86-64-nop-2.d
new file mode 100644
index 0000000..e894d2c
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-2.d
@@ -0,0 +1,41 @@
+#source: nop-2.s
+#objdump: -drw -Mi8086
+#name: x86-64 .nop 2
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <single>:
+ +[a-f0-9]+: 90 nop
+
+0+1 <pseudo_1>:
+ +[a-f0-9]+: 90 nop
+
+0+2 <pseudo_8>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+
+0+a <pseudo_8_4>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+
+0+12 <pseudo_20>:
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+
+0+26 <pseudo_30>:
+ +[a-f0-9]+: 89 f6 mov %si,%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 8d b4 00 00 lea 0x0\(%si\),%si
+ +[a-f0-9]+: 8d bd 00 00 lea 0x0\(%di\),%di
+ +[a-f0-9]+: 66 31 c0 xor %eax,%eax
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-nop-3.d b/gas/testsuite/gas/i386/x86-64-nop-3.d
new file mode 100644
index 0000000..b43239a
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-3.d
@@ -0,0 +1,21 @@
+#source: nop-3.s
+#objdump: -drw
+#name: x86-64 .nop 3
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 0f 1f 00 nopl \(%rax\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: e9 00 00 00 00 jmpq 5 <_start\+0x5> 1: R_X86_64_PLT32 foo-0x4
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-nop-4.d b/gas/testsuite/gas/i386/x86-64-nop-4.d
new file mode 100644
index 0000000..a910171
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-4.d
@@ -0,0 +1,24 @@
+#source: nop-4.s
+#objdump: -drw
+#name: x86-64 .nop 4
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw 0x0\(%rax,%rax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: e9 00 00 00 00 jmpq b <_start\+0xb> 7: R_X86_64_PLT32 foo-0x4
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-nop-5.d b/gas/testsuite/gas/i386/x86-64-nop-5.d
new file mode 100644
index 0000000..57493cf
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-5.d
@@ -0,0 +1,26 @@
+#source: nop-5.s
+#objdump: -drw
+#name: x86-64 .nop 5
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 85 c0 test %eax,%eax
+ +[a-f0-9]+: 0f 1f 44 00 00 nopl 0x0\(%rax,%rax,1\)
+ +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\)
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: 89 c0 mov %eax,%eax
+ +[a-f0-9]+: e9 00 00 00 00 jmpq d <_start\+0xd> 9: R_X86_64_PLT32 foo-0x4
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-nop-6.d b/gas/testsuite/gas/i386/x86-64-nop-6.d
new file mode 100644
index 0000000..520f590
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-nop-6.d
@@ -0,0 +1,18 @@
+#source: nop-6.s
+#objdump: -drw
+#name: x86-64 .nop 6
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+ +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\)
+
+Disassembly of section .altinstr_replacement:
+
+0+ <.altinstr_replacement>:
+ +[a-f0-9]+: 75 fe jne 0 <_start>
+ +[a-f0-9]+: 89 c4 mov %eax,%esp
+#pass