summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-09-06 14:13:29 -0700
committerGitHub <noreply@github.com>2017-09-06 14:13:29 -0700
commitd2a401d27ef3592638e0e7689eebed317966334a (patch)
tree13f627f7cd3aaeb20ac1708ad1bf244bf7ec07c4 /test
parent192b59a8bc8e5376ca120dc592d5abad7c654230 (diff)
downloadbinaryen-d2a401d27ef3592638e0e7689eebed317966334a.tar.gz
binaryen-d2a401d27ef3592638e0e7689eebed317966334a.tar.bz2
binaryen-d2a401d27ef3592638e0e7689eebed317966334a.zip
Add support for sign-extension operators from threading proposal (#1167)
These are not atomic operations, but are added with the atomic operations to keep from having to define atomic versions of all the sign-extending loads (an atomic zero-extending load + signext operation can be used instead).
Diffstat (limited to 'test')
-rw-r--r--test/signext.wast12
-rw-r--r--test/signext.wast.from-wast33
-rw-r--r--test/signext.wast.fromBinary36
-rw-r--r--test/signext.wast.fromBinary.noDebugInfo36
4 files changed, 117 insertions, 0 deletions
diff --git a/test/signext.wast b/test/signext.wast
new file mode 100644
index 000000000..3370e9b16
--- /dev/null
+++ b/test/signext.wast
@@ -0,0 +1,12 @@
+(module
+ (type $0 (func))
+ (func $signext (type $0)
+ (local $0 i32)
+ (local $1 i64)
+ (drop (i32.extend8_s (get_local $0)))
+ (drop (i32.extend16_s (get_local $0)))
+ (drop (i64.extend8_s (get_local $1)))
+ (drop (i64.extend16_s (get_local $1)))
+ (drop (i64.extend32_s (get_local $1)))
+ )
+)
diff --git a/test/signext.wast.from-wast b/test/signext.wast.from-wast
new file mode 100644
index 000000000..6828723b5
--- /dev/null
+++ b/test/signext.wast.from-wast
@@ -0,0 +1,33 @@
+(module
+ (type $0 (func))
+ (memory $0 0)
+ (func $signext (type $0)
+ (local $0 i32)
+ (local $1 i64)
+ (drop
+ (i32.extend8_s
+ (get_local $0)
+ )
+ )
+ (drop
+ (i32.extend16_s
+ (get_local $0)
+ )
+ )
+ (drop
+ (i64.extend8_s
+ (get_local $1)
+ )
+ )
+ (drop
+ (i64.extend16_s
+ (get_local $1)
+ )
+ )
+ (drop
+ (i64.extend32_s
+ (get_local $1)
+ )
+ )
+ )
+)
diff --git a/test/signext.wast.fromBinary b/test/signext.wast.fromBinary
new file mode 100644
index 000000000..ec9b50aa2
--- /dev/null
+++ b/test/signext.wast.fromBinary
@@ -0,0 +1,36 @@
+(module
+ (type $0 (func))
+ (memory $0 0)
+ (func $signext (type $0)
+ (local $var$0 i32)
+ (local $var$1 i64)
+ (block $label$0
+ (drop
+ (i32.extend8_s
+ (get_local $var$0)
+ )
+ )
+ (drop
+ (i32.extend16_s
+ (get_local $var$0)
+ )
+ )
+ (drop
+ (i64.extend8_s
+ (get_local $var$1)
+ )
+ )
+ (drop
+ (i64.extend16_s
+ (get_local $var$1)
+ )
+ )
+ (drop
+ (i64.extend32_s
+ (get_local $var$1)
+ )
+ )
+ )
+ )
+)
+
diff --git a/test/signext.wast.fromBinary.noDebugInfo b/test/signext.wast.fromBinary.noDebugInfo
new file mode 100644
index 000000000..04ada421c
--- /dev/null
+++ b/test/signext.wast.fromBinary.noDebugInfo
@@ -0,0 +1,36 @@
+(module
+ (type $0 (func))
+ (memory $0 0)
+ (func $0 (type $0)
+ (local $var$0 i32)
+ (local $var$1 i64)
+ (block $label$0
+ (drop
+ (i32.extend8_s
+ (get_local $var$0)
+ )
+ )
+ (drop
+ (i32.extend16_s
+ (get_local $var$0)
+ )
+ )
+ (drop
+ (i64.extend8_s
+ (get_local $var$1)
+ )
+ )
+ (drop
+ (i64.extend16_s
+ (get_local $var$1)
+ )
+ )
+ (drop
+ (i64.extend32_s
+ (get_local $var$1)
+ )
+ )
+ )
+ )
+)
+