-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move generated spec test to `chakra_generated`
- Loading branch information
Showing
15 changed files
with
267 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
13/13 tests passed. |
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 @@ | ||
13/13 tests passed. |
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 @@ | ||
18/18 tests passed. |
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 @@ | ||
18/18 tests passed. |
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,29 @@ | ||
(module | ||
;; todo make this a shared memory | ||
(memory 1) | ||
(data (i32.const 16) "\ff\ff\ff\ff\ff\ff\ff\ff") | ||
(data (i32.const 24) "\12\34\56\78\00\00\ce\41") | ||
|
||
(func (export "load") (param i32) (result i64) | ||
(i64.atomic.load32_u offset=15 (get_local 0)) | ||
) | ||
) | ||
|
||
(assert_return (invoke "load" (i32.const 1)) (i64.const 0xffffffff)) | ||
(assert_return (invoke "load" (i32.const 5)) (i64.const 0xffffffff)) | ||
(assert_return (invoke "load" (i32.const 9)) (i64.const 0x78563412)) | ||
(assert_return (invoke "load" (i32.const 13)) (i64.const 0x41ce0000)) | ||
(assert_trap (invoke "load" (i32.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 2)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 3)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 4)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 6)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 7)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 8)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 10)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 11)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 12)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "load" (i32.const 14)) "atomic memory access is unaligned") | ||
|
||
(assert_return (invoke "load" (i32.const 65517)) (i64.const 0)) | ||
(assert_trap (invoke "load" (i32.const 65521)) "out of bounds memory access") |
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,28 @@ | ||
(module | ||
;; todo make this a shared memory | ||
(memory 1) | ||
|
||
(func (export "store") (param i32 i64) (result i32) | ||
(i64.atomic.store offset=15 (get_local 0) (get_local 1)) | ||
(i32.atomic.load offset=19 (get_local 0)) | ||
) | ||
) | ||
|
||
(assert_return (invoke "store" (i32.const 1) (i64.const 0xffffffff41ce0000)) (i32.const 0xffffffff)) | ||
(assert_return (invoke "store" (i32.const 9) (i64.const 0x78563412ffffffff)) (i32.const 0x78563412)) | ||
(assert_trap (invoke "store" (i32.const 0) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 2) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 3) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 4) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 5) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 6) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 7) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 8) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 10) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 11) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 12) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 13) (i64.const 0)) "atomic memory access is unaligned") | ||
(assert_trap (invoke "store" (i32.const 14) (i64.const 0)) "atomic memory access is unaligned") | ||
|
||
(assert_return (invoke "store" (i32.const 65513) (i64.const 0x78563412ffffffff)) (i32.const 0x78563412)) | ||
(assert_trap (invoke "store" (i32.const 65521) (i64.const 0)) "out of bounds memory access") |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,50 @@ | ||
(module | ||
;; todo make this a shared memory | ||
(memory 1) | ||
(data (i32.const 0) "\ff\ff\ff\ff") | ||
(data (i32.const 4) "\00\00\ce\41") | ||
(data (i32.const 8) "\00\00\00\00\00\ff\8f\40") | ||
|
||
(func (export "i32.atomic.load8_u") (result i32) | ||
i32.const 1 i32.atomic.load8_u) | ||
(func (export "i32.atomic.load16_u") (result i32) | ||
i32.const 2 i32.atomic.load16_u) | ||
(func (export "i32.atomic.load") (result i32) | ||
i32.const 4 i32.atomic.load) | ||
|
||
(func (export "i64.atomic.load8_u") (result i64) | ||
i32.const 1 i64.atomic.load8_u) | ||
(func (export "i64.atomic.load16_u") (result i64) | ||
i32.const 2 i64.atomic.load16_u) | ||
(func (export "i64.atomic.load32_u") (result i64) | ||
i32.const 4 i64.atomic.load32_u) | ||
(func (export "i64.atomic.load") (result i64) | ||
i32.const 0 i64.atomic.load) | ||
|
||
;; Test bad alignment | ||
|
||
(func (export "bad.align-i32.atomic.load16_u") (result i32) | ||
i32.const 1 i32.atomic.load16_u) | ||
(func (export "bad.align-i32.atomic.load") (result i32) | ||
i32.const 2 i32.atomic.load) | ||
|
||
(func (export "bad.align-i64.atomic.load16_u") (result i64) | ||
i32.const 1 i64.atomic.load16_u) | ||
(func (export "bad.align-i64.atomic.load32_u") (result i64) | ||
i32.const 2 i64.atomic.load32_u) | ||
(func (export "bad.align-i64.atomic.load") (result i64) | ||
i32.const 4 i64.atomic.load) | ||
) | ||
|
||
(assert_return (invoke "i32.atomic.load8_u") (i32.const 255)) | ||
(assert_return (invoke "i32.atomic.load16_u") (i32.const 65535)) | ||
(assert_return (invoke "i32.atomic.load") (i32.const 1104019456)) | ||
(assert_return (invoke "i64.atomic.load8_u") (i64.const 255)) | ||
(assert_return (invoke "i64.atomic.load16_u") (i64.const 65535)) | ||
(assert_return (invoke "i64.atomic.load32_u") (i64.const 1104019456)) | ||
(assert_return (invoke "i64.atomic.load") (i64.const 4741727461962678271)) | ||
(assert_trap (invoke "bad.align-i32.atomic.load16_u") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i32.atomic.load") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.load16_u") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.load32_u") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.load") "atomic memory access is unaligned") |
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,68 @@ | ||
(module | ||
;; todo make this a shared memory | ||
(memory 1) | ||
|
||
(func (export "i32.atomic.store8") (result i32) | ||
i32.const 0 i32.const 0xfb i32.atomic.store8 | ||
i32.const 1 i32.const 0xfc i32.atomic.store8 | ||
i32.const 2 i32.const 0xfd i32.atomic.store8 | ||
i32.const 3 i32.const 0xfe i32.atomic.store8 | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i32.atomic.store16") (result i32) | ||
i32.const 0 i32.const 0xcac9 i32.atomic.store16 | ||
i32.const 2 i32.const 0xcccb i32.atomic.store16 | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i32.atomic.store") (result i32) | ||
i32.const 0 i32.const -123456 i32.atomic.store | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i64.atomic.store8") (result i32) | ||
i32.const 0 i64.const 0xeeeeeeeeeeeeeefb i64.atomic.store8 | ||
i32.const 1 i64.const 0xeeeeeeeeeeeeeefc i64.atomic.store8 | ||
i32.const 2 i64.const 0xeeeeeeeeeeeeeefd i64.atomic.store8 | ||
i32.const 3 i64.const 0xeeeeeeeeeeeeeefe i64.atomic.store8 | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i64.atomic.store16") (result i32) | ||
i32.const 0 i64.const 0xeeeeeeeeeeeecac9 i64.atomic.store16 | ||
i32.const 2 i64.const 0xeeeeeeeeeeeecccb i64.atomic.store16 | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i64.atomic.store32") (result i32) | ||
i32.const 0 i64.const -123456 i64.atomic.store32 | ||
i32.const 0 i32.load) | ||
|
||
(func (export "i64.atomic.store") (result i64) | ||
i32.const 0 i64.const 0xbaddc0de600dd00d i64.atomic.store | ||
i32.const 0 i64.load) | ||
|
||
;; Test bad alignment | ||
|
||
(func (export "bad.align-i32.atomic.store16") | ||
i32.const 1 i32.const 0 i32.atomic.store16) | ||
(func (export "bad.align-i32.atomic.store") | ||
i32.const 2 i32.const 0 i32.atomic.store) | ||
|
||
(func (export "bad.align-i64.atomic.store16") | ||
i32.const 1 i64.const 0 i64.atomic.store16) | ||
(func (export "bad.align-i64.atomic.store32") | ||
i32.const 2 i64.const 0 i64.atomic.store32) | ||
(func (export "bad.align-i64.atomic.store") | ||
i32.const 4 i64.const 0 i64.atomic.store) | ||
|
||
) | ||
|
||
(assert_return (invoke "i32.atomic.store8") (i32.const 4278058235)) | ||
(assert_return (invoke "i32.atomic.store16") (i32.const 3435907785)) | ||
(assert_return (invoke "i32.atomic.store") (i32.const 4294843840)) | ||
(assert_return (invoke "i64.atomic.store8") (i32.const 4278058235)) | ||
(assert_return (invoke "i64.atomic.store16") (i32.const 3435907785)) | ||
(assert_return (invoke "i64.atomic.store32") (i32.const 4294843840)) | ||
(assert_return (invoke "i64.atomic.store") (i64.const 13465130522234441741)) | ||
(assert_trap (invoke "bad.align-i32.atomic.store16") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i32.atomic.store") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.store16") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.store32") "atomic memory access is unaligned") | ||
(assert_trap (invoke "bad.align-i64.atomic.store") "atomic memory access is unaligned") |
Oops, something went wrong.