|
| 1 | +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
| 2 | +;; RUN: wasm-ctor-eval %s --ctors=return,drop,passthrough --quiet -all -S -o - | filecheck %s |
| 3 | + |
| 4 | +;; The relaxed SIMD operation here cannot be optimized by wasm-ctor-eval, as we |
| 5 | +;; do not know how the VM that the code will run on should execute it. We can |
| 6 | +;; optimize nothing here, and should not error. |
| 7 | + |
| 8 | +(module |
| 9 | + ;; CHECK: (type $0 (func (result v128))) |
| 10 | + |
| 11 | + ;; CHECK: (type $1 (func)) |
| 12 | + |
| 13 | + ;; CHECK: (export "drop" (func $drop)) |
| 14 | + |
| 15 | + ;; CHECK: (export "passthrough" (func $passthrough)) |
| 16 | + |
| 17 | + ;; CHECK: (func $return (type $0) (result v128) |
| 18 | + ;; CHECK-NEXT: (f32x4.relaxed_max |
| 19 | + ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) |
| 20 | + ;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) |
| 21 | + ;; CHECK-NEXT: ) |
| 22 | + ;; CHECK-NEXT: ) |
| 23 | + (func $return (export "return") (result v128) |
| 24 | + ;; This function returns a nonconstant value directly. |
| 25 | + (f32x4.relaxed_max |
| 26 | + (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) |
| 27 | + (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) |
| 28 | + ) |
| 29 | + ) |
| 30 | + |
| 31 | + ;; CHECK: (func $drop (type $1) |
| 32 | + ;; CHECK-NEXT: (drop |
| 33 | + ;; CHECK-NEXT: (call $return) |
| 34 | + ;; CHECK-NEXT: ) |
| 35 | + ;; CHECK-NEXT: ) |
| 36 | + (func $drop (export "drop") |
| 37 | + ;; This function swallows a nonconstant value. |
| 38 | + (drop |
| 39 | + (call $return) |
| 40 | + ) |
| 41 | + ) |
| 42 | + |
| 43 | + ;; CHECK: (func $passthrough (type $0) (result v128) |
| 44 | + ;; CHECK-NEXT: (call $return) |
| 45 | + ;; CHECK-NEXT: ) |
| 46 | + (func $passthrough (export "passthrough") (result v128) |
| 47 | + ;; This function passes through a nonconstant value. |
| 48 | + (call $return) |
| 49 | + ) |
| 50 | +) |
| 51 | + |
0 commit comments