summaryrefslogtreecommitdiff
path: root/test/lit/exec/negative-zero.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/exec/negative-zero.wast')
-rw-r--r--test/lit/exec/negative-zero.wast117
1 files changed, 117 insertions, 0 deletions
diff --git a/test/lit/exec/negative-zero.wast b/test/lit/exec/negative-zero.wast
new file mode 100644
index 000000000..4a1e339ca
--- /dev/null
+++ b/test/lit/exec/negative-zero.wast
@@ -0,0 +1,117 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.
+
+;; RUN: wasm-opt %s -all --fuzz-exec -o /dev/null 2>&1 | filecheck %s
+
+(module
+ ;; CHECK: [fuzz-exec] calling min1
+ ;; CHECK-NEXT: [fuzz-exec] note result: min1 => -0
+ (func "min1" (result f64)
+ ;; This should return -0.
+ (f64.min
+ (f64.const 0)
+ (f64.const -0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling min2
+ ;; CHECK-NEXT: [fuzz-exec] note result: min2 => -0
+ (func "min2" (result f64)
+ ;; Flipped arms; still -0.
+ (f64.min
+ (f64.const -0)
+ (f64.const 0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling min1-f32
+ ;; CHECK-NEXT: [fuzz-exec] note result: min1-f32 => -0
+ (func "min1-f32" (result f32)
+ ;; As above, but f32 and not f64
+ (f32.min
+ (f32.const 0)
+ (f32.const -0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling min2-f32
+ ;; CHECK-NEXT: [fuzz-exec] note result: min2-f32 => -0
+ (func "min2-f32" (result f32)
+ ;; Flipped arms; still -0.
+ (f32.min
+ (f32.const -0)
+ (f32.const 0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling max1
+ ;; CHECK-NEXT: [fuzz-exec] note result: max1 => 0
+ (func "max1" (result f64)
+ ;; This should return 0.
+ (f64.max
+ (f64.const 0)
+ (f64.const -0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling max2
+ ;; CHECK-NEXT: [fuzz-exec] note result: max2 => 0
+ (func "max2" (result f64)
+ ;; Flipped arms; still 0.
+ (f64.max
+ (f64.const -0)
+ (f64.const 0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling max1-f32
+ ;; CHECK-NEXT: [fuzz-exec] note result: max1-f32 => 0
+ (func "max1-f32" (result f32)
+ ;; As above, but f32 and not f64
+ (f32.max
+ (f32.const 0)
+ (f32.const -0)
+ )
+ )
+
+ ;; CHECK: [fuzz-exec] calling max2-f32
+ ;; CHECK-NEXT: [fuzz-exec] note result: max2-f32 => 0
+ ;; CHECK-NEXT: warning: no passes specified, not doing any work
+ (func "max2-f32" (result f32)
+ ;; Flipped arms; still 0.
+ (f32.max
+ (f32.const -0)
+ (f32.const 0)
+ )
+ )
+)
+;; CHECK: [fuzz-exec] calling min1
+;; CHECK-NEXT: [fuzz-exec] note result: min1 => -0
+
+;; CHECK: [fuzz-exec] calling min2
+;; CHECK-NEXT: [fuzz-exec] note result: min2 => -0
+
+;; CHECK: [fuzz-exec] calling min1-f32
+;; CHECK-NEXT: [fuzz-exec] note result: min1-f32 => -0
+
+;; CHECK: [fuzz-exec] calling min2-f32
+;; CHECK-NEXT: [fuzz-exec] note result: min2-f32 => -0
+
+;; CHECK: [fuzz-exec] calling max1
+;; CHECK-NEXT: [fuzz-exec] note result: max1 => 0
+
+;; CHECK: [fuzz-exec] calling max2
+;; CHECK-NEXT: [fuzz-exec] note result: max2 => 0
+
+;; CHECK: [fuzz-exec] calling max1-f32
+;; CHECK-NEXT: [fuzz-exec] note result: max1-f32 => 0
+
+;; CHECK: [fuzz-exec] calling max2-f32
+;; CHECK-NEXT: [fuzz-exec] note result: max2-f32 => 0
+;; CHECK-NEXT: [fuzz-exec] comparing max1
+;; CHECK-NEXT: [fuzz-exec] comparing max1-f32
+;; CHECK-NEXT: [fuzz-exec] comparing max2
+;; CHECK-NEXT: [fuzz-exec] comparing max2-f32
+;; CHECK-NEXT: [fuzz-exec] comparing min1
+;; CHECK-NEXT: [fuzz-exec] comparing min1-f32
+;; CHECK-NEXT: [fuzz-exec] comparing min2
+;; CHECK-NEXT: [fuzz-exec] comparing min2-f32