-
Notifications
You must be signed in to change notification settings - Fork 717
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generate-dyncalls and directize passed under table64 (#6604)
- Loading branch information
Showing
4 changed files
with
99 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. | ||
|
||
;; RUN: wasm-opt %s --directize --enable-memory64 -S -o - | filecheck %s | ||
|
||
(module | ||
;; CHECK: (type $ii (func (param i32 i32))) | ||
(type $ii (func (param i32 i32))) | ||
|
||
;; CHECK: (table $0 i64 5 5 funcref) | ||
(table $0 i64 5 5 funcref) | ||
|
||
;; CHECK: (elem $elem (i64.const 1) $foo) | ||
(elem $elem (i64.const 1) $foo) | ||
|
||
;; CHECK: (func $foo (param $0 i32) (param $1 i32) | ||
;; CHECK-NEXT: (unreachable) | ||
;; CHECK-NEXT: ) | ||
(func $foo (param i32) (param i32) | ||
;; helper function | ||
(unreachable) | ||
) | ||
|
||
;; CHECK: (func $bar (param $x i32) (param $y i32) | ||
;; CHECK-NEXT: (call $foo | ||
;; CHECK-NEXT: (local.get $x) | ||
;; CHECK-NEXT: (local.get $y) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: ) | ||
(func $bar (param $x i32) (param $y i32) | ||
(call_indirect (type $ii) | ||
(local.get $x) | ||
(local.get $y) | ||
(i64.const 1) | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
;; RUN: wasm-opt %s --generate-dyncalls --enable-memory64 -S -o - | filecheck %s | ||
|
||
(module | ||
;; CHECK: (type $0 (func (result i32))) | ||
|
||
;; CHECK: (type $1 (func (param i32) (result i64))) | ||
|
||
;; CHECK: (type $2 (func (param i64) (result i32))) | ||
|
||
;; CHECK: (type $3 (func (param i64 i32) (result i64))) | ||
|
||
;; CHECK: (memory $m i64 1) | ||
(memory $m i64 1) | ||
;; CHECK: (table $t i64 2 2 funcref) | ||
(table $t i64 2 2 funcref) | ||
;; CHECK: (elem $elem (i64.const 0) $f1 $f2) | ||
(elem $elem (i64.const 0) $f1 $f2) | ||
|
||
;; CHECK: (export "dynCall_i" (func $dynCall_i)) | ||
|
||
;; CHECK: (export "dynCall_ji" (func $dynCall_ji)) | ||
|
||
;; CHECK: (func $f1 (result i32) | ||
;; CHECK-NEXT: (i32.const 1024) | ||
;; CHECK-NEXT: ) | ||
(func $f1 (result i32) | ||
(i32.const 1024) | ||
) | ||
;; CHECK: (func $f2 (param $0 i32) (result i64) | ||
;; CHECK-NEXT: (i64.const 42) | ||
;; CHECK-NEXT: ) | ||
(func $f2 (param i32) (result i64) | ||
(i64.const 42) | ||
) | ||
) | ||
;; CHECK: (func $dynCall_i (param $fptr i64) (result i32) | ||
;; CHECK-NEXT: (call_indirect (type $0) | ||
;; CHECK-NEXT: (local.get $fptr) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: ) | ||
|
||
;; CHECK: (func $dynCall_ji (param $fptr i64) (param $0 i32) (result i64) | ||
;; CHECK-NEXT: (call_indirect (type $1) | ||
;; CHECK-NEXT: (local.get $0) | ||
;; CHECK-NEXT: (local.get $fptr) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: ) |