-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #483 Signed-off-by: Dave Thaler <[email protected]>
- Loading branch information
Showing
4 changed files
with
247 additions
and
29 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
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 |
---|---|---|
@@ -1,28 +1,194 @@ | ||
# Copyright (c) Prevail Verifier contributors. | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
test-case: atomic add number register | ||
|
||
pre: | ||
- r10.type=stack | ||
- r10.stack_offset=512 | ||
- s[504...511].type=number | ||
- s[504...511].svalue=1 | ||
- s[504...511].uvalue=1 | ||
- r1.type=number | ||
- r1.svalue=2 | ||
- r1.uvalue=2 | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r10 - 8) += r1 | ||
post: | ||
- r1.type=number | ||
- r1.svalue=2 | ||
- r1.uvalue=2 | ||
- r10.type=stack | ||
- r10.stack_offset=512 | ||
- s[504...511].type=number | ||
- s[504...511].svalue=3 | ||
- s[504...511].uvalue=3 | ||
test-case: atomic 32-bit ADD | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) += r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit ADD and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) += r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit ADD | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) += r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit ADD and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) += r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit AND | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) &= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit AND and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) &= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit AND | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) &= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit AND and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) &= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit OR | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) |= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit OR and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) |= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit OR | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) |= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit OR and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) |= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit XOR | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) ^= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 32-bit XOR and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u32 *)(r2 + 4) ^= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=12", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit XOR | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) ^= r1 | ||
post: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
--- | ||
test-case: atomic 64-bit XOR and fetch | ||
|
||
pre: ["r1.type=number", "r1.svalue=2", "r1.uvalue=2", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] | ||
|
||
code: | ||
<start>: | | ||
lock *(u64 *)(r2 + 4) ^= r1 fetch | ||
post: ["r1.type=number", | ||
"r2.type=shared", "r2.shared_region_size=16", "r2.shared_offset=4", "r2.svalue=[1, 2147418112]", "r2.uvalue=[1, 2147418112]", "r2.svalue=r2.uvalue"] |