summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/parse/module/bad-export-global-name-undefined.txt7
-rw-r--r--test/parse/module/bad-export-global-undefined.txt7
-rw-r--r--test/parse/module/bad-export-memory-name-undefined.txt7
-rw-r--r--test/parse/module/bad-export-memory-undefined.txt (renamed from test/parse/module/bad-export-memory-no-memory.txt)2
-rw-r--r--test/parse/module/bad-export-table-name-undefined.txt7
-rw-r--r--test/parse/module/bad-export-table-undefined.txt7
-rw-r--r--test/parse/module/bad-import-global-redefinition.txt9
-rw-r--r--test/parse/module/bad-import-memory-redefinition.txt9
-rw-r--r--test/parse/module/bad-import-table-redefinition.txt9
-rw-r--r--test/parse/module/export-global.txt5
-rw-r--r--test/parse/module/export-table.txt3
-rw-r--r--test/parse/module/global.txt5
-rw-r--r--test/parse/module/import-global.txt6
-rw-r--r--test/parse/module/import-memory.txt3
-rw-r--r--test/parse/module/import-table.txt3
15 files changed, 88 insertions, 1 deletions
diff --git a/test/parse/module/bad-export-global-name-undefined.txt b/test/parse/module/bad-export-global-name-undefined.txt
new file mode 100644
index 00000000..61c5af9b
--- /dev/null
+++ b/test/parse/module/bad-export-global-name-undefined.txt
@@ -0,0 +1,7 @@
+;;; ERROR: 1
+(module (export "foo" (global $bar)))
+(;; STDERR ;;;
+parse/module/bad-export-global-name-undefined.txt:2:31: undefined global variable "$bar"
+(module (export "foo" (global $bar)))
+ ^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-export-global-undefined.txt b/test/parse/module/bad-export-global-undefined.txt
new file mode 100644
index 00000000..f2b5ad7c
--- /dev/null
+++ b/test/parse/module/bad-export-global-undefined.txt
@@ -0,0 +1,7 @@
+;;; ERROR: 1
+(module (export "foo" (global 0)))
+(;; STDERR ;;;
+parse/module/bad-export-global-undefined.txt:2:31: global variable out of range (max 0)
+(module (export "foo" (global 0)))
+ ^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-export-memory-name-undefined.txt b/test/parse/module/bad-export-memory-name-undefined.txt
new file mode 100644
index 00000000..feb4158c
--- /dev/null
+++ b/test/parse/module/bad-export-memory-name-undefined.txt
@@ -0,0 +1,7 @@
+;;; ERROR: 1
+(module (export "foo" (memory $bar)))
+(;; STDERR ;;;
+parse/module/bad-export-memory-name-undefined.txt:2:31: undefined memory variable "$bar"
+(module (export "foo" (memory $bar)))
+ ^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-export-memory-no-memory.txt b/test/parse/module/bad-export-memory-undefined.txt
index eb884d07..d56971c1 100644
--- a/test/parse/module/bad-export-memory-no-memory.txt
+++ b/test/parse/module/bad-export-memory-undefined.txt
@@ -2,7 +2,7 @@
(module
(export "mem" (memory 0)))
(;; STDERR ;;;
-parse/module/bad-export-memory-no-memory.txt:3:25: memory variable out of range (max 0)
+parse/module/bad-export-memory-undefined.txt:3:25: memory variable out of range (max 0)
(export "mem" (memory 0)))
^
;;; STDERR ;;)
diff --git a/test/parse/module/bad-export-table-name-undefined.txt b/test/parse/module/bad-export-table-name-undefined.txt
new file mode 100644
index 00000000..ee8717aa
--- /dev/null
+++ b/test/parse/module/bad-export-table-name-undefined.txt
@@ -0,0 +1,7 @@
+;;; ERROR: 1
+(module (export "foo" (table $bar)))
+(;; STDERR ;;;
+parse/module/bad-export-table-name-undefined.txt:2:30: undefined table variable "$bar"
+(module (export "foo" (table $bar)))
+ ^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-export-table-undefined.txt b/test/parse/module/bad-export-table-undefined.txt
new file mode 100644
index 00000000..86ec83bb
--- /dev/null
+++ b/test/parse/module/bad-export-table-undefined.txt
@@ -0,0 +1,7 @@
+;;; ERROR: 1
+(module (export "foo" (table 0)))
+(;; STDERR ;;;
+parse/module/bad-export-table-undefined.txt:2:30: table variable out of range (max 0)
+(module (export "foo" (table 0)))
+ ^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-import-global-redefinition.txt b/test/parse/module/bad-import-global-redefinition.txt
new file mode 100644
index 00000000..6877f70a
--- /dev/null
+++ b/test/parse/module/bad-import-global-redefinition.txt
@@ -0,0 +1,9 @@
+;;; ERROR: 1
+(module
+ (import "foo" "bar" (global $baz i32))
+ (import "oof" "rab" (global $baz i32)))
+(;; STDERR ;;;
+parse/module/bad-import-global-redefinition.txt:4:3: redefinition of global "$baz"
+ (import "oof" "rab" (global $baz i32)))
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-import-memory-redefinition.txt b/test/parse/module/bad-import-memory-redefinition.txt
new file mode 100644
index 00000000..1610382a
--- /dev/null
+++ b/test/parse/module/bad-import-memory-redefinition.txt
@@ -0,0 +1,9 @@
+;;; ERROR: 1
+(module
+ (import "foo" "bar" (memory $baz 0))
+ (import "foo" "blah" (memory $baz 0)))
+(;; STDERR ;;;
+parse/module/bad-import-memory-redefinition.txt:4:3: redefinition of memory "$baz"
+ (import "foo" "blah" (memory $baz 0)))
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/bad-import-table-redefinition.txt b/test/parse/module/bad-import-table-redefinition.txt
new file mode 100644
index 00000000..1ca01851
--- /dev/null
+++ b/test/parse/module/bad-import-table-redefinition.txt
@@ -0,0 +1,9 @@
+;;; ERROR: 1
+(module
+ (import "foo" "bar" (table $baz 0 anyfunc))
+ (import "foo" "blah" (table $baz 0 anyfunc)))
+(;; STDERR ;;;
+parse/module/bad-import-table-redefinition.txt:4:3: redefinition of table "$baz"
+ (import "foo" "blah" (table $baz 0 anyfunc)))
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+;;; STDERR ;;)
diff --git a/test/parse/module/export-global.txt b/test/parse/module/export-global.txt
new file mode 100644
index 00000000..361efd32
--- /dev/null
+++ b/test/parse/module/export-global.txt
@@ -0,0 +1,5 @@
+(module
+ (global i32)
+ (global (mut f32))
+ (export "global0" (global 0))
+ (export "global1" (global 1)))
diff --git a/test/parse/module/export-table.txt b/test/parse/module/export-table.txt
new file mode 100644
index 00000000..12c926f0
--- /dev/null
+++ b/test/parse/module/export-table.txt
@@ -0,0 +1,3 @@
+(module
+ (table 0 anyfunc)
+ (export "my_table" (table 0)))
diff --git a/test/parse/module/global.txt b/test/parse/module/global.txt
index b473f0a6..13ad845f 100644
--- a/test/parse/module/global.txt
+++ b/test/parse/module/global.txt
@@ -1,4 +1,9 @@
(module
+ (global i32)
+ (global i64)
+ (global f32)
+ (global f64)
+
(global i32 (i32.const 1))
(global i64 (i64.const 2))
(global f32 (f32.const 3))
diff --git a/test/parse/module/import-global.txt b/test/parse/module/import-global.txt
new file mode 100644
index 00000000..93b86cf8
--- /dev/null
+++ b/test/parse/module/import-global.txt
@@ -0,0 +1,6 @@
+(module
+ (import "foo" "1" (global i32))
+ (import "foo" "2" (global i64))
+ (import "foo" "3" (global f32))
+ (import "foo" "4" (global f64))
+ (import "foo" "5" (global (mut i32))))
diff --git a/test/parse/module/import-memory.txt b/test/parse/module/import-memory.txt
new file mode 100644
index 00000000..3d30fe0f
--- /dev/null
+++ b/test/parse/module/import-memory.txt
@@ -0,0 +1,3 @@
+(module
+ (import "foo" "1" (memory 0))
+ (import "foo" "2" (memory 0 2)))
diff --git a/test/parse/module/import-table.txt b/test/parse/module/import-table.txt
new file mode 100644
index 00000000..5a8f078d
--- /dev/null
+++ b/test/parse/module/import-table.txt
@@ -0,0 +1,3 @@
+(module
+ (import "foo" "1" (table 0 anyfunc))
+ (import "foo" "2" (table 0 10 anyfunc)))