aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/binutils-all/nm.exp3
-rw-r--r--binutils/testsuite/binutils-all/wasm32/create-wasm.d10
-rw-r--r--binutils/testsuite/binutils-all/wasm32/create-wasm.s6
-rw-r--r--binutils/testsuite/binutils-all/wasm32/custom-section.d11
-rw-r--r--binutils/testsuite/binutils-all/wasm32/custom-section.s4
-rw-r--r--binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d6
-rw-r--r--binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s7
-rw-r--r--binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d6
-rw-r--r--binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s7
-rw-r--r--binutils/testsuite/binutils-all/wasm32/long-sections.d13
-rw-r--r--binutils/testsuite/binutils-all/wasm32/long-sections.s9
-rw-r--r--binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d15
-rw-r--r--binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s43
-rw-r--r--binutils/testsuite/binutils-all/wasm32/parse-wasm.d8
-rw-r--r--binutils/testsuite/binutils-all/wasm32/parse-wasm.s7
-rw-r--r--binutils/testsuite/binutils-all/wasm32/prepared-section.d10
-rw-r--r--binutils/testsuite/binutils-all/wasm32/prepared-section.s6
-rw-r--r--binutils/testsuite/binutils-all/wasm32/wasm32.exp30
-rw-r--r--binutils/testsuite/lib/binutils-common.exp4
19 files changed, 204 insertions, 1 deletions
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
index 13eafa6..fdcf194 100644
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -175,7 +175,8 @@ if { [is_elf_format]
|| [istarget *-*-tpf*]
|| [istarget *-*-uclinux*]
|| [istarget ia64-*-*vms*]
- || [istarget *-*-vxworks*] } {
+ || [istarget *-*-vxworks*]
+ || [istarget wasm32-*-*] } {
set nm_1_src "nm-elf-1.s"
} else {
set nm_1_src "nm-1.s"
diff --git a/binutils/testsuite/binutils-all/wasm32/create-wasm.d b/binutils/testsuite/binutils-all/wasm32/create-wasm.d
new file mode 100644
index 0000000..3a1c18a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/create-wasm.d
@@ -0,0 +1,10 @@
+#PROG: objcopy
+#source: create-wasm.s
+#as:
+#objcopy: -Ielf32-wasm32 -Owasm
+#objdump: -bbinary -s
+
+.*:.*file format binary
+
+Contents of section .data:
+ 0000 0061736d 01000000 01030100 00030100 .asm............
diff --git a/binutils/testsuite/binutils-all/wasm32/create-wasm.s b/binutils/testsuite/binutils-all/wasm32/create-wasm.s
new file mode 100644
index 0000000..5c360cc
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/create-wasm.s
@@ -0,0 +1,6 @@
+ .section .wasm.function
+ .byte 0
+ .section .wasm.type
+ .byte 1
+ .byte 0
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/custom-section.d b/binutils/testsuite/binutils-all/wasm32/custom-section.d
new file mode 100644
index 0000000..3a39e77
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/custom-section.d
@@ -0,0 +1,11 @@
+#PROG: objcopy
+#source: custom-section.s
+#as:
+#objcopy: -Ielf32-wasm32 -Owasm
+#objdump: -bbinary -s
+
+.*:.*file format binary
+
+Contents of section .data:
+ 0000 0061736d 01000000 0008046e 616d6502 .asm.......name.
+ 0010 0100 .. *$
diff --git a/binutils/testsuite/binutils-all/wasm32/custom-section.s b/binutils/testsuite/binutils-all/wasm32/custom-section.s
new file mode 100644
index 0000000..81fa671
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/custom-section.s
@@ -0,0 +1,4 @@
+ .section .wasm.name
+ .byte 2
+ .byte 1
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d
new file mode 100644
index 0000000..e916fad
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d
@@ -0,0 +1,6 @@
+#PROG: objcopy
+#source: invalid-wasm-1.s
+#as:
+#objcopy: -Ielf32-wasm32 -Obinary
+#objdump: -bwasm -sD
+#error: : File format not recognized \ No newline at end of file
diff --git a/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s
new file mode 100644
index 0000000..50d6690
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s
@@ -0,0 +1,7 @@
+ .data
+ .byte 0
+ .ascii "ASM"
+ .byte 1
+ .byte 0
+ .byte 0
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d
new file mode 100644
index 0000000..da28775
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d
@@ -0,0 +1,6 @@
+#PROG: objcopy
+#source: invalid-wasm-2.s
+#as:
+#objcopy: -Ielf32-wasm32 -Obinary
+#objdump: -bwasm -sD
+#exit: 1 \ No newline at end of file
diff --git a/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s
new file mode 100644
index 0000000..4270e9d
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s
@@ -0,0 +1,7 @@
+ .data
+ .byte 0
+ .ascii "asm"
+ .byte 2
+ .byte 0
+ .byte 0
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/long-sections.d b/binutils/testsuite/binutils-all/wasm32/long-sections.d
new file mode 100644
index 0000000..edf9058
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/long-sections.d
@@ -0,0 +1,13 @@
+#PROG: objcopy
+#source: long-sections.s
+#as:
+#objcopy: -Ielf32-wasm32 -Owasm
+#objdump: -bbinary -s
+
+.*:.*file format binary
+
+Contents of section .data:
+ 00000 0061736d 01000000 01800200 00000000 .asm............
+#...
+ 00100 00000000 00000000 0000000a 80800400 ................
+#pass
diff --git a/binutils/testsuite/binutils-all/wasm32/long-sections.s b/binutils/testsuite/binutils-all/wasm32/long-sections.s
new file mode 100644
index 0000000..a8642d2
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/long-sections.s
@@ -0,0 +1,9 @@
+ .section .wasm.type
+ .rept 256
+ .byte 0
+ .endr
+
+ .section .wasm.code
+ .rept 65536
+ .byte 0
+ .endr
diff --git a/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d b/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d
new file mode 100644
index 0000000..8b59c74
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d
@@ -0,0 +1,15 @@
+#PROG: objcopy
+#source: parse-wasm-2.s
+#as:
+#objcopy: -Ielf32-wasm32 -Obinary
+#objdump: -bwasm -s
+
+.*:.*file format wasm
+
+Contents of section .wasm.type:
+ 80000000 01600001 7f .`...
+Contents of section .wasm.function:
+ 80000005 0100 ..
+Contents of section .wasm.code:
+ 80000007 01858080 80000041 2a0f0b .......A\*..
+#pass
diff --git a/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s b/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s
new file mode 100644
index 0000000..bc918b7
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s
@@ -0,0 +1,43 @@
+ .data
+ .byte 0
+ .ascii "asm"
+ .byte 1
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 1
+ .byte 0x85
+ .byte 0x80
+ .byte 0x80
+ .byte 0x80
+ .byte 0
+ .byte 1
+ .byte 0x60
+ .byte 0
+ .byte 1
+ .byte 0x7f
+ .byte 3
+ .byte 0x82
+ .byte 0x80
+ .byte 0x80
+ .byte 0x80
+ .byte 0
+ .byte 1
+ .byte 0
+ .byte 0x0a
+ .byte 0x8b
+ .byte 0x80
+ .byte 0x80
+ .byte 0x80
+ .byte 0
+ .byte 1
+ .byte 0x85
+ .byte 0x80
+ .byte 0x80
+ .byte 0x80
+ .byte 0
+ .byte 0
+ .byte 0x41
+ .byte 0x2a
+ .byte 0x0f
+ .byte 0x0b
diff --git a/binutils/testsuite/binutils-all/wasm32/parse-wasm.d b/binutils/testsuite/binutils-all/wasm32/parse-wasm.d
new file mode 100644
index 0000000..fd8bc70
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/parse-wasm.d
@@ -0,0 +1,8 @@
+#PROG: objcopy
+#source: parse-wasm.s
+#as:
+#objcopy: -Ielf32-wasm32 -Obinary
+#objdump: -bwasm -s
+
+.*:.*file format wasm
+
diff --git a/binutils/testsuite/binutils-all/wasm32/parse-wasm.s b/binutils/testsuite/binutils-all/wasm32/parse-wasm.s
new file mode 100644
index 0000000..d495ea1
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/parse-wasm.s
@@ -0,0 +1,7 @@
+ .data
+ .byte 0
+ .ascii "asm"
+ .byte 1
+ .byte 0
+ .byte 0
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/prepared-section.d b/binutils/testsuite/binutils-all/wasm32/prepared-section.d
new file mode 100644
index 0000000..c5bfafa
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/prepared-section.d
@@ -0,0 +1,10 @@
+#PROG: objcopy
+#source: prepared-section.s
+#as:
+#objcopy: -Ielf32-wasm32 -Owasm
+#objdump: -bbinary -s
+
+.*:.*file format binary
+
+Contents of section .data:
+ 0000 0061736d 01000000 0006046e 616d6500 .asm.......name.
diff --git a/binutils/testsuite/binutils-all/wasm32/prepared-section.s b/binutils/testsuite/binutils-all/wasm32/prepared-section.s
new file mode 100644
index 0000000..574f6e0
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/prepared-section.s
@@ -0,0 +1,6 @@
+ .section .prepared
+ .byte 0
+ .byte 0x6
+ .byte 4
+ .ascii "name"
+ .byte 0
diff --git a/binutils/testsuite/binutils-all/wasm32/wasm32.exp b/binutils/testsuite/binutils-all/wasm32/wasm32.exp
new file mode 100644
index 0000000..b95569a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/wasm32/wasm32.exp
@@ -0,0 +1,30 @@
+# Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# Copyright (C) 2017 Pip Cet <pipcet@gmail.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+if { ![istarget "wasm32-*-*"] } then {
+ return
+}
+
+run_dump_test "create-wasm"
+run_dump_test "custom-section"
+run_dump_test "long-sections"
+run_dump_test "parse-wasm"
+run_dump_test "parse-wasm-2"
+run_dump_test "prepared-section"
+
+#run_dump_test "invalid-wasm-1"
+#run_dump_test "invalid-wasm-2"
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 327db46..70b6773 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -41,6 +41,7 @@ proc is_elf_format {} {
&& ![istarget *-*-solaris2*]
&& ![istarget *-*-sysv4*]
&& ![istarget *-*-unixware*]
+ && ![istarget *-*-wasm32*]
&& ![istarget avr-*-*]
&& ![istarget bfin-*-uclinux]
&& ![istarget frv-*-uclinux*]
@@ -183,6 +184,9 @@ proc supports_gnu_unique {} {
if { [istarget "arm*-*-*eabi*"] } {
return 1
}
+ if { [istarget "wasm32*-*-*"] } {
+ return 1
+ }
if { ![istarget "*-*-elf*"] } {
return 0
}