This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] [WebAssembly] Tests


This patch adds a number of tests for the WebAssembly GAS backend, as
well as a few tests for the WebAssembly BFD backend.

Locally, "./configure --target=wasm32-unknown-none --disable-gdb
--disable-ld --enable-maintainer-mode && make && make check" succeeds,
so all enabled tests appear to be passing.

Comments and improvements are most welcome.

Thanks,
Pip Cet
Suggested change log entries:
binutils/:
2017-03-27  Pip Cet  <pipcet@gmail.com>

    * testsuite/lib/binutils-common.exp (is_elf_format): Mark wasm32
as ELF target.
    (supports_gnu_unique): Mark wasm32 as supporting STB_GNU_UNIQUE.
    * testsuite/binutils-all/nm.exp: Mark wasm32 as requiring .size annotations.
    * testsuite/binutils-all/wasm32/create-wasm.d: New file.
    * testsuite/binutils-all/wasm32/create-wasm.s: Likewise.
    * testsuite/binutils-all/wasm32/custom-section.d: Likewise.
    * testsuite/binutils-all/wasm32/custom-section.s: Likewise.
    * testsuite/binutils-all/wasm32/invalid-wasm-1.d: Likewise.
    * testsuite/binutils-all/wasm32/invalid-wasm-1.s: Likewise.
    * testsuite/binutils-all/wasm32/long-sections.d: Likewise.
    * testsuite/binutils-all/wasm32/long-sections.s: Likewise.
    * testsuite/binutils-all/wasm32/parse-wasm.d: Likewise.
    * testsuite/binutils-all/wasm32/parse-wasm.s: Likewise.
    * testsuite/binutils-all/wasm32/parse-wasm-2.d: Likewise.
    * testsuite/binutils-all/wasm32/parse-wasm-2.s: Likewise.
    * testsuite/binutils-all/wasm32/prepared-section.d: Likewise.
    * testsuite/binutils-all/wasm32/prepared-section.s: Likewise.
    * testsuite/binutils-all/wasm32/wasm32.exp: New file, run tests.

gas/:
2017-03-27  Pip Cet  <pipcet@gmail.com>

    * testsuite/gas/wasm32/allinsn.d: New file.
    * testsuite/gas/wasm32/allinsn.s: Likewise.
    * testsuite/gas/wasm32/illegal.l: Likewise.
    * testsuite/gas/wasm32/illegal.s: Likewise.
    * testsuite/gas/wasm32/illegal-2.l: Likewise.
    * testsuite/gas/wasm32/illegal-2.s: Likewise.
    * testsuite/gas/wasm32/illegal-3.l: Likewise.
    * testsuite/gas/wasm32/illegal-3.s: Likewise.
    * testsuite/gas/wasm32/illegal-4.l: Likewise.
    * testsuite/gas/wasm32/illegal-4.s: Likewise.
    * testsuite/gas/wasm32/illegal-5.l: Likewise.
    * testsuite/gas/wasm32/illegal-5.s: Likewise.
    * testsuite/gas/wasm32/illegal-6.l: Likewise.
    * testsuite/gas/wasm32/illegal-6.s: Likewise.
    * testsuite/gas/wasm32/illegal-7.l: Likewise.
    * testsuite/gas/wasm32/illegal-7.s: Likewise.
    * testsuite/gas/wasm32/illegal-8.l: Likewise.
    * testsuite/gas/wasm32/illegal-8.s: Likewise.
    * testsuite/gas/wasm32/illegal-9.l: Likewise.
    * testsuite/gas/wasm32/illegal-9.s: Likewise.
    * testsuite/gas/wasm32/illegal-10.l: Likewise.
    * testsuite/gas/wasm32/illegal-10.s: Likewise.
    * testsuite/gas/wasm32/illegal-11.l: Likewise.
    * testsuite/gas/wasm32/illegal-11.s: Likewise.
    * testsuite/gas/wasm32/illegal-12.l: Likewise.
    * testsuite/gas/wasm32/illegal-12.s: Likewise.
    * testsuite/gas/wasm32/illegal-13.l: Likewise.
    * testsuite/gas/wasm32/illegal-13.s: Likewise.
    * testsuite/gas/wasm32/illegal-14.l: Likewise.
    * testsuite/gas/wasm32/illegal-14.s: Likewise.
    * testsuite/gas/wasm32/illegal-15.l: Likewise.
    * testsuite/gas/wasm32/illegal-15.s: Likewise.
    * testsuite/gas/wasm32/illegal-16.l: Likewise.
    * testsuite/gas/wasm32/illegal-16.s: Likewise.
    * testsuite/gas/wasm32/illegal-17.l: Likewise.
    * testsuite/gas/wasm32/illegal-17.s: Likewise.
    * testsuite/gas/wasm32/illegal-18.l: Likewise.
    * testsuite/gas/wasm32/illegal-18.s: Likewise.
    * testsuite/gas/wasm32/illegal-19.l: Likewise.
    * testsuite/gas/wasm32/illegal-19.s: Likewise.
    * testsuite/gas/wasm32/illegal-20.l: Likewise.
    * testsuite/gas/wasm32/illegal-20.s: Likewise.
    * testsuite/gas/wasm32/illegal-21.l: Likewise.
    * testsuite/gas/wasm32/illegal-21.s: Likewise.
    * testsuite/gas/wasm32/illegal-22.l: Likewise.
    * testsuite/gas/wasm32/illegal-22.s: Likewise.
    * testsuite/gas/wasm32/illegal-24.l: Likewise.
    * testsuite/gas/wasm32/illegal-24.s: Likewise.
    * testsuite/gas/wasm32/illegal-25.l: Likewise.
    * testsuite/gas/wasm32/illegal-25.s: Likewise.
    * testsuite/gas/wasm32/reloc.d: New file.
    * testsuite/gas/wasm32/reloc.s: Likewise.
    * testsuite/gas/wasm32/wasm32.exp: New tests for WebAssembly
    architecture.
---------
diff --git a/binutils/testsuite/binutils-all/nm.exp
b/binutils/testsuite/binutils-all/nm.exp
index 13eafa6515..fdcf194b4f 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 0000000000..3a1c18a1b6
--- /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 0000000000..5c360cc872
--- /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 0000000000..3a39e774d2
--- /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 0000000000..81fa671389
--- /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 0000000000..e916fad64b
--- /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 0000000000..50d669057d
--- /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 0000000000..da287757c2
--- /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 0000000000..4270e9dda3
--- /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 0000000000..edf905847c
--- /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 0000000000..a8642d2783
--- /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 0000000000..8b59c74fe5
--- /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 0000000000..bc918b7ac9
--- /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 0000000000..fd8bc703da
--- /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 0000000000..d495ea119d
--- /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 0000000000..c5bfafa6f4
--- /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 0000000000..574f6e0c83
--- /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 0000000000..b95569a744
--- /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 327db46e6c..70b6773894 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
     }
diff --git a/gas/testsuite/gas/wasm32/allinsn.d
b/gas/testsuite/gas/wasm32/allinsn.d
new file mode 100644
index 0000000000..06124be4d6
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/allinsn.d
@@ -0,0 +1,198 @@
+#as:
+#objdump: -d
+#name: allinsn
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+00000000 <.text>:
+   0:    02 40               block\[\]
+   2:    0c 00               br 0
+   4:    0d 00               br_if 0
+   6:    0e 01 01 01         br_table 1 1
+   a:    10 00               call 0x0
+   c:    11 00 00            call_indirect 0 0
+   f:    1a                  drop
+  10:    05                  else
+  11:    0b                  end
+  12:    8b                  f32.abs
+  13:    92                  f32.add
+  14:    8d                  f32.ceil
+  15:    43 d0 0f 49         f32.const 3.141590118408203125
+  19:    40
+  1a:    b2                  f32.convert_s_i32
+  1b:    b4                  f32.convert_s_i64
+  1c:    b3                  f32.convert_u_i32
+  1d:    b5                  f32.convert_u_i64
+  1e:    98                  f32.copysign
+  1f:    b6                  f32.demote_f64
+  20:    95                  f32.div
+  21:    5b                  f32.eq
+  22:    8e                  f32.floor
+  23:    60                  f32.ge
+  24:    5e                  f32.gt
+  25:    5f                  f32.le
+  26:    2a 00 00            f32.load a=0 0
+  29:    5d                  f32.lt
+  2a:    97                  f32.max
+  2b:    96                  f32.min
+  2c:    94                  f32.mul
+  2d:    5c                  f32.ne
+  2e:    90                  f32.nearest
+  2f:    8c                  f32.neg
+  30:    be                  f32.reinterpret_i32
+  31:    91                  f32.sqrt
+  32:    38 00 00            f32.store a=0 0
+  35:    93                  f32.sub
+  36:    8f                  f32.trunc
+  37:    99                  f64.abs
+  38:    a0                  f64.add
+  39:    9b                  f64.ceil
+  3a:    44 97 5f 4f         f64.const 3.14158999999999976088e\+200
+  3e:    fd bc 6a 90
+  42:    69
+  43:    b7                  f64.convert_s_i32
+  44:    b9                  f64.convert_s_i64
+  45:    b8                  f64.convert_u_i32
+  46:    ba                  f64.convert_u_i64
+  47:    a6                  f64.copysign
+  48:    a3                  f64.div
+  49:    61                  f64.eq
+  4a:    9c                  f64.floor
+  4b:    66                  f64.ge
+  4c:    64                  f64.gt
+  4d:    65                  f64.le
+  4e:    2b 00 00            f64.load a=0 0
+  51:    63                  f64.lt
+  52:    a5                  f64.max
+  53:    a4                  f64.min
+  54:    a2                  f64.mul
+  55:    62                  f64.ne
+  56:    9e                  f64.nearest
+  57:    9a                  f64.neg
+  58:    bb                  f64.promote_f32
+  59:    bf                  f64.reinterpret_i64
+  5a:    9f                  f64.sqrt
+  5b:    39 00 00            f64.store a=0 0
+  5e:    a1                  f64.sub
+  5f:    9d                  f64.trunc
+  60:    23 00               get_global 0 <\$got>
+  62:    20 00               get_local 0 <\$dpc>
+  64:    6a                  i32.add
+  65:    71                  i32.and
+  66:    67                  i32.clz
+  67:    41 ef fd b6         i32.const 3735928559
+  6b:    f5 0d
+  6d:    68                  i32.ctz
+  6e:    6d                  i32.div_s
+  6f:    6e                  i32.div_u
+  70:    46                  i32.eq
+  71:    45                  i32.eqz
+  72:    4e                  i32.ge_s
+  73:    4f                  i32.ge_u
+  74:    4a                  i32.gt_s
+  75:    4b                  i32.gt_u
+  76:    4c                  i32.le_s
+  77:    4d                  i32.le_u
+  78:    28 00 00            i32.load a=0 0
+  7b:    2e 00 00            i32.load16_s a=0 0
+  7e:    2f 00 00            i32.load16_u a=0 0
+  81:    2c 00 00            i32.load8_s a=0 0
+  84:    2d 00 00            i32.load8_u a=0 0
+  87:    48                  i32.lt_s
+  88:    49                  i32.lt_u
+  89:    6c                  i32.mul
+  8a:    47                  i32.ne
+  8b:    72                  i32.or
+  8c:    69                  i32.popcnt
+  8d:    bc                  i32.reinterpret_f32
+  8e:    6f                  i32.rem_s
+  8f:    70                  i32.rem_u
+  90:    77                  i32.rotl
+  91:    78                  i32.rotr
+  92:    74                  i32.shl
+  93:    75                  i32.shr_s
+  94:    76                  i32.shr_u
+  95:    36 00 00            i32.store a=0 0
+  98:    3b 00 00            i32.store16 a=0 0
+  9b:    3a 00 00            i32.store8 a=0 0
+  9e:    6b                  i32.sub
+  9f:    a8                  i32.trunc_s_f32
+  a0:    aa                  i32.trunc_s_f64
+  a1:    a9                  i32.trunc_u_f32
+  a2:    ab                  i32.trunc_u_f64
+  a3:    a7                  i32.wrap_i64
+  a4:    73                  i32.xor
+  a5:    7c                  i64.add
+  a6:    83                  i64.and
+  a7:    79                  i64.clz
+  a8:    42 ef fd b6         i64.const -2401053088876216593
+  ac:    f5 fd dd ef
+  b0:    d6 5e
+  b2:    7a                  i64.ctz
+  b3:    7f                  i64.div_s
+  b4:    80                  i64.div_u
+  b5:    51                  i64.eq
+  b6:    50                  i64.eqz
+  b7:    ac                  i64.extend_s_i32
+  b8:    ad                  i64.extend_u_i32
+  b9:    59                  i64.ge_s
+  ba:    5a                  i64.ge_u
+  bb:    55                  i64.gt_s
+  bc:    56                  i64.gt_u
+  bd:    57                  i64.le_s
+  be:    58                  i64.le_u
+  bf:    29 00 00            i64.load a=0 0
+  c2:    32 00 00            i64.load16_s a=0 0
+  c5:    33 00 00            i64.load16_u a=0 0
+  c8:    34 00 00            i64.load32_s a=0 0
+  cb:    35 00 00            i64.load32_u a=0 0
+  ce:    30 00 00            i64.load8_s a=0 0
+  d1:    31 00 00            i64.load8_u a=0 0
+  d4:    53                  i64.lt_s
+  d5:    54                  i64.lt_u
+  d6:    7e                  i64.mul
+  d7:    52                  i64.ne
+  d8:    84                  i64.or
+  d9:    7b                  i64.popcnt
+  da:    bd                  i64.reinterpret_f64
+  db:    81                  i64.rem_s
+  dc:    82                  i64.rem_u
+  dd:    89                  i64.rotl
+  de:    8a                  i64.rotr
+  df:    86                  i64.shl
+  e0:    87                  i64.shr_s
+  e1:    88                  i64.shr_u
+  e2:    37 00 00            i64.store a=0 0
+  e5:    3d 00 00            i64.store16 a=0 0
+  e8:    3e 00 00            i64.store32 a=0 0
+  eb:    3c 00 00            i64.store8 a=0 0
+  ee:    7d                  i64.sub
+  ef:    ae                  i64.trunc_s_f32
+  f0:    b0                  i64.trunc_s_f64
+  f1:    af                  i64.trunc_u_f32
+  f2:    b1                  i64.trunc_u_f64
+  f3:    85                  i64.xor
+  f4:    04 7f               if\[i\]
+  f6:    03 7e               loop\[l\]
+  f8:    01                  nop
+  f9:    0f                  return
+  fa:    1b                  select
+  fb:    24 00               set_global 0 <\$got>
+  fd:    21 00               set_local 0 <\$dpc>
+  ff:    60                  f32.ge
+ 100:    08                  .byte 08
+
+ 101:    7f                  i64.div_s
+ 102:    7e                  i64.mul
+ 103:    7c                  i64.add
+ 104:    7d                  i64.sub
+ 105:    7d                  i64.sub
+ 106:    7c                  i64.add
+ 107:    7e                  i64.mul
+ 108:    7f                  i64.div_s
+ 109:    00                  unreachable
+ 10a:    22 00               tee_local 0 <\$dpc>
+    ...
diff --git a/gas/testsuite/gas/wasm32/allinsn.s
b/gas/testsuite/gas/wasm32/allinsn.s
new file mode 100644
index 0000000000..c2714b3473
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/allinsn.s
@@ -0,0 +1,171 @@
+    block[]
+    br 0
+    br_if 0
+    br_table 1 1 1
+    call 0
+    call_indirect 0 0
+    drop
+    else
+    end
+    f32.abs
+    f32.add
+    f32.ceil
+    f32.const 3.14159
+    f32.convert_s/i32
+    f32.convert_s/i64
+    f32.convert_u/i32
+    f32.convert_u/i64
+    f32.copysign
+    f32.demote/f64
+    f32.div
+    f32.eq
+    f32.floor
+    f32.ge
+    f32.gt
+    f32.le
+    f32.load a=0 0
+    f32.lt
+    f32.max
+    f32.min
+    f32.mul
+    f32.ne
+    f32.nearest
+    f32.neg
+    f32.reinterpret/i32
+    f32.sqrt
+    f32.store a=0 0
+    f32.sub
+    f32.trunc
+    f64.abs
+    f64.add
+    f64.ceil
+    f64.const 3.14159e200
+    f64.convert_s/i32
+    f64.convert_s/i64
+    f64.convert_u/i32
+    f64.convert_u/i64
+    f64.copysign
+    f64.div
+    f64.eq
+    f64.floor
+    f64.ge
+    f64.gt
+    f64.le
+    f64.load a=0 0
+    f64.lt
+    f64.max
+    f64.min
+    f64.mul
+    f64.ne
+    f64.nearest
+    f64.neg
+    f64.promote/f32
+    f64.reinterpret/i64
+    f64.sqrt
+    f64.store a=0 0
+    f64.sub
+    f64.trunc
+    get_global 0
+    get_local 0
+    i32.add
+    i32.and
+    i32.clz
+    i32.const 0xdeadbeef
+    i32.ctz
+    i32.div_s
+    i32.div_u
+    i32.eq
+    i32.eqz
+    i32.ge_s
+    i32.ge_u
+    i32.gt_s
+    i32.gt_u
+    i32.le_s
+    i32.le_u
+    i32.load a=0 0
+    i32.load16_s a=0 0
+    i32.load16_u a=0 0
+    i32.load8_s a=0 0
+    i32.load8_u a=0 0
+    i32.lt_s
+    i32.lt_u
+    i32.mul
+    i32.ne
+    i32.or
+    i32.popcnt
+    i32.reinterpret/f32
+    i32.rem_s
+    i32.rem_u
+    i32.rotl
+    i32.rotr
+    i32.shl
+    i32.shr_s
+    i32.shr_u
+    i32.store a=0 0
+    i32.store16 a=0 0
+    i32.store8 a=0 0
+    i32.sub
+    i32.trunc_s/f32
+    i32.trunc_s/f64
+    i32.trunc_u/f32
+    i32.trunc_u/f64
+    i32.wrap/i64
+    i32.xor
+    i64.add
+    i64.and
+    i64.clz
+    i64.const 0xdeadbeefdeadbeef
+    i64.ctz
+    i64.div_s
+    i64.div_u
+    i64.eq
+    i64.eqz
+    i64.extend_s/i32
+    i64.extend_u/i32
+    i64.ge_s
+    i64.ge_u
+    i64.gt_s
+    i64.gt_u
+    i64.le_s
+    i64.le_u
+    i64.load a=0 0
+    i64.load16_s a=0 0
+    i64.load16_u a=0 0
+    i64.load32_s a=0 0
+    i64.load32_u a=0 0
+    i64.load8_s a=0 0
+    i64.load8_u a=0 0
+    i64.lt_s
+    i64.lt_u
+    i64.mul
+    i64.ne
+    i64.or
+    i64.popcnt
+    i64.reinterpret/f64
+    i64.rem_s
+    i64.rem_u
+    i64.rotl
+    i64.rotr
+    i64.shl
+    i64.shr_s
+    i64.shr_u
+    i64.store a=0 0
+    i64.store16 a=0 0
+    i64.store32 a=0 0
+    i64.store8 a=0 0
+    i64.sub
+    i64.trunc_s/f32
+    i64.trunc_s/f64
+    i64.trunc_u/f32
+    i64.trunc_u/f64
+    i64.xor
+    if[i]
+    loop[l]
+    nop
+    return
+    select
+    set_global 0
+    set_local 0
+        signature FvildffdliE
+    tee_local 0
+    unreachable
diff --git a/gas/testsuite/gas/wasm32/illegal-10.l
b/gas/testsuite/gas/wasm32/illegal-10.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-10.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-10.s
b/gas/testsuite/gas/wasm32/illegal-10.s
new file mode 100644
index 0000000000..201d3ae5f2
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-10.s
@@ -0,0 +1 @@
+        br_if -2
diff --git a/gas/testsuite/gas/wasm32/illegal-11.l
b/gas/testsuite/gas/wasm32/illegal-11.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-11.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-11.s
b/gas/testsuite/gas/wasm32/illegal-11.s
new file mode 100644
index 0000000000..d08f159498
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-11.s
@@ -0,0 +1 @@
+        br_table 0 0 0
diff --git a/gas/testsuite/gas/wasm32/illegal-12.l
b/gas/testsuite/gas/wasm32/illegal-12.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-12.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-12.s
b/gas/testsuite/gas/wasm32/illegal-12.s
new file mode 100644
index 0000000000..58a6a9e17e
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-12.s
@@ -0,0 +1 @@
+        br_table 0 1 2
diff --git a/gas/testsuite/gas/wasm32/illegal-13.l
b/gas/testsuite/gas/wasm32/illegal-13.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-13.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-13.s
b/gas/testsuite/gas/wasm32/illegal-13.s
new file mode 100644
index 0000000000..1bfe729c6b
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-13.s
@@ -0,0 +1 @@
+        br_table 2 0
diff --git a/gas/testsuite/gas/wasm32/illegal-14.l
b/gas/testsuite/gas/wasm32/illegal-14.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-14.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-14.s
b/gas/testsuite/gas/wasm32/illegal-14.s
new file mode 100644
index 0000000000..ef458f1c7f
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-14.s
@@ -0,0 +1 @@
+        br_table
diff --git a/gas/testsuite/gas/wasm32/illegal-15.l
b/gas/testsuite/gas/wasm32/illegal-15.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-15.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-15.s
b/gas/testsuite/gas/wasm32/illegal-15.s
new file mode 100644
index 0000000000..8a79ff36f2
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-15.s
@@ -0,0 +1 @@
+        br_table[i]
diff --git a/gas/testsuite/gas/wasm32/illegal-16.l
b/gas/testsuite/gas/wasm32/illegal-16.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-16.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-16.s
b/gas/testsuite/gas/wasm32/illegal-16.s
new file mode 100644
index 0000000000..d32b771843
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-16.s
@@ -0,0 +1 @@
+        call 0 1
diff --git a/gas/testsuite/gas/wasm32/illegal-17.l
b/gas/testsuite/gas/wasm32/illegal-17.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-17.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-17.s
b/gas/testsuite/gas/wasm32/illegal-17.s
new file mode 100644
index 0000000000..ec2d05072c
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-17.s
@@ -0,0 +1 @@
+        call[i] 0
diff --git a/gas/testsuite/gas/wasm32/illegal-18.l
b/gas/testsuite/gas/wasm32/illegal-18.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-18.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-18.s
b/gas/testsuite/gas/wasm32/illegal-18.s
new file mode 100644
index 0000000000..32fbe67b53
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-18.s
@@ -0,0 +1 @@
+        drop 3
diff --git a/gas/testsuite/gas/wasm32/illegal-19.l
b/gas/testsuite/gas/wasm32/illegal-19.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-19.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-19.s
b/gas/testsuite/gas/wasm32/illegal-19.s
new file mode 100644
index 0000000000..9a801936e9
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-19.s
@@ -0,0 +1 @@
+        else[i]
diff --git a/gas/testsuite/gas/wasm32/illegal-2.l
b/gas/testsuite/gas/wasm32/illegal-2.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-2.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-2.s
b/gas/testsuite/gas/wasm32/illegal-2.s
new file mode 100644
index 0000000000..584c46728b
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-2.s
@@ -0,0 +1 @@
+    block[ii]
diff --git a/gas/testsuite/gas/wasm32/illegal-20.l
b/gas/testsuite/gas/wasm32/illegal-20.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-20.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-20.s
b/gas/testsuite/gas/wasm32/illegal-20.s
new file mode 100644
index 0000000000..39d4d4c559
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-20.s
@@ -0,0 +1 @@
+        end[i]
diff --git a/gas/testsuite/gas/wasm32/illegal-21.l
b/gas/testsuite/gas/wasm32/illegal-21.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-21.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-21.s
b/gas/testsuite/gas/wasm32/illegal-21.s
new file mode 100644
index 0000000000..d51ac99708
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-21.s
@@ -0,0 +1 @@
+        f32.abs 0
diff --git a/gas/testsuite/gas/wasm32/illegal-22.l
b/gas/testsuite/gas/wasm32/illegal-22.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-22.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-24.l
b/gas/testsuite/gas/wasm32/illegal-24.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-24.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-24.s
b/gas/testsuite/gas/wasm32/illegal-24.s
new file mode 100644
index 0000000000..db6d2017a7
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-24.s
@@ -0,0 +1 @@
+        f32.demote_f32
diff --git a/gas/testsuite/gas/wasm32/illegal-25.l
b/gas/testsuite/gas/wasm32/illegal-25.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-25.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-25.s
b/gas/testsuite/gas/wasm32/illegal-25.s
new file mode 100644
index 0000000000..b956386378
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-25.s
@@ -0,0 +1 @@
+        f32.load 0 a=0
diff --git a/gas/testsuite/gas/wasm32/illegal-3.l
b/gas/testsuite/gas/wasm32/illegal-3.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-3.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-3.s
b/gas/testsuite/gas/wasm32/illegal-3.s
new file mode 100644
index 0000000000..253bc2c798
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-3.s
@@ -0,0 +1 @@
+        block[li]
diff --git a/gas/testsuite/gas/wasm32/illegal-4.l
b/gas/testsuite/gas/wasm32/illegal-4.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-4.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-4.s
b/gas/testsuite/gas/wasm32/illegal-4.s
new file mode 100644
index 0000000000..157147532a
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-4.s
@@ -0,0 +1 @@
+        block[q]
diff --git a/gas/testsuite/gas/wasm32/illegal-5.l
b/gas/testsuite/gas/wasm32/illegal-5.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-5.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-5.s
b/gas/testsuite/gas/wasm32/illegal-5.s
new file mode 100644
index 0000000000..17cc4bb788
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-5.s
@@ -0,0 +1 @@
+        block 3
diff --git a/gas/testsuite/gas/wasm32/illegal-6.l
b/gas/testsuite/gas/wasm32/illegal-6.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-6.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-6.s
b/gas/testsuite/gas/wasm32/illegal-6.s
new file mode 100644
index 0000000000..ff7d1fc54a
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-6.s
@@ -0,0 +1 @@
+        block[i] 3
diff --git a/gas/testsuite/gas/wasm32/illegal-7.l
b/gas/testsuite/gas/wasm32/illegal-7.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-7.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-7.s
b/gas/testsuite/gas/wasm32/illegal-7.s
new file mode 100644
index 0000000000..f3de667e07
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-7.s
@@ -0,0 +1 @@
+        br
diff --git a/gas/testsuite/gas/wasm32/illegal-8.l
b/gas/testsuite/gas/wasm32/illegal-8.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-8.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-8.s
b/gas/testsuite/gas/wasm32/illegal-8.s
new file mode 100644
index 0000000000..92826025a5
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-8.s
@@ -0,0 +1 @@
+        br 0 1
diff --git a/gas/testsuite/gas/wasm32/illegal-9.l
b/gas/testsuite/gas/wasm32/illegal-9.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-9.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal-9.s
b/gas/testsuite/gas/wasm32/illegal-9.s
new file mode 100644
index 0000000000..ef1c2d698d
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal-9.s
@@ -0,0 +1 @@
+        br -1
diff --git a/gas/testsuite/gas/wasm32/illegal.l
b/gas/testsuite/gas/wasm32/illegal.l
new file mode 100644
index 0000000000..4eb2cd8477
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal.l
@@ -0,0 +1,3 @@
+#...
+.*Error.*
+#pass
diff --git a/gas/testsuite/gas/wasm32/illegal.s
b/gas/testsuite/gas/wasm32/illegal.s
new file mode 100644
index 0000000000..dfbdea9574
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/illegal.s
@@ -0,0 +1 @@
+        block[ii]
diff --git a/gas/testsuite/gas/wasm32/reloc.d b/gas/testsuite/gas/wasm32/reloc.d
new file mode 100644
index 0000000000..9317e6e9a3
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/reloc.d
@@ -0,0 +1,18 @@
+#as:
+#objdump: -dr
+#name: reloc
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+00000000 <.text>:
+   0:    41 80 80 80         i32.const 0
+   4:    80 00
+            1: R_ASMJS_LEB128_PLT    f
+   6:    41 80 80 80         i32.const 0
+   a:    80 00
+            7: R_ASMJS_LEB128_GOT    x
+   c:    41 80 80 80         i32.const 0
+  10:    80 00
+            d: R_ASMJS_LEB128_GOT_CODE    f
diff --git a/gas/testsuite/gas/wasm32/reloc.s b/gas/testsuite/gas/wasm32/reloc.s
new file mode 100644
index 0000000000..8cdfd58b96
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/reloc.s
@@ -0,0 +1,3 @@
+        i32.const f@plt
+        i32.const x@got
+        i32.const f@gotcode
diff --git a/gas/testsuite/gas/wasm32/wasm32.exp
b/gas/testsuite/gas/wasm32/wasm32.exp
new file mode 100644
index 0000000000..e6d1819677
--- /dev/null
+++ b/gas/testsuite/gas/wasm32/wasm32.exp
@@ -0,0 +1,58 @@
+# Expect script for wasm32 tests.
+#   Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# 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.
+
+# wasm32 assembler testsuite.
+
+if [istarget wasm32-*-*] {
+    # no disassembler support yet
+    setup_xfail "wasm32-*-*"
+    run_dump_test "allinsn"
+    # no GOT/PLT relocs yet.
+    setup_xfail "wasm32-*-*"
+    run_dump_test "reloc"
+    run_list_test "illegal"
+    run_list_test "illegal-2"
+    run_list_test "illegal-3"
+    run_list_test "illegal-4"
+    run_list_test "illegal-5"
+    run_list_test "illegal-6"
+    run_list_test "illegal-7"
+    run_list_test "illegal-8"
+    run_list_test "illegal-9"
+    run_list_test "illegal-10"
+    setup_xfail "wasm32-*-*"
+    run_list_test "illegal-11"
+    setup_xfail "wasm32-*-*"
+    run_list_test "illegal-12"
+    setup_xfail "wasm32-*-*"
+    run_list_test "illegal-13"
+    run_list_test "illegal-14"
+    run_list_test "illegal-15"
+    run_list_test "illegal-16"
+    run_list_test "illegal-17"
+    run_list_test "illegal-18"
+    run_list_test "illegal-19"
+    run_list_test "illegal-20"
+    run_list_test "illegal-21"
+    run_list_test "illegal-22"
+    # illegal-23 has become legal
+    run_list_test "illegal-24"
+    run_list_test "illegal-25"
+}

Attachment: binutils-wasm-006.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]