Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Oct 30, 2024
1 parent 27527cd commit d885eba
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions test-data/shift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,43 @@ post:
messages:
- "1:2: Code is unreachable after 1:2"

---
test-case: check that signed right shift by 0 is idempotent - MAX_UINT64

pre:
- r0.type=number
- r0.svalue=-1
- r0.uvalue=18446744073709551615
- r1.type=number
- r1.svalue=-1
- r1.uvalue=18446744073709551615

code:
<start>: |
r0 s>>= 0
if r1 == r0 goto <one>
r2 = 0
exit
<one>: |
r2 = 1
exit
post:
- r0.svalue=-1
- r0.svalue=r1.svalue
- r0.type=number
- r0.uvalue=18446744073709551615
- r0.uvalue=r1.uvalue
- r1.svalue=-1
- r1.type=number
- r1.uvalue=18446744073709551615
- r2.svalue=1
- r2.type=number
- r2.uvalue=1

messages:
- "1:2: Code is unreachable after 1:2"

---
test-case: check that signed right shift by 0 is idempotent - MIN_INT64 - via register

Expand Down Expand Up @@ -1425,6 +1462,49 @@ post:
messages:
- "1:2: Code is unreachable after 1:2"

---
test-case: check that signed right shift by 0 is idempotent - MAX_UINT64 - via register

pre:
- r0.type=number
- r0.svalue=-1
- r0.uvalue=18446744073709551615
- r1.type=number
- r1.svalue=-1
- r1.uvalue=18446744073709551615
- r3.type=number
- r3.uvalue=0
- r3.svalue=0

code:
<start>: |
r0 s>>= r3
if r1 == r0 goto <one>
r2 = 0
exit
<one>: |
r2 = 1
exit
post:
- r0.svalue=-1
- r0.svalue=r1.svalue
- r0.type=number
- r0.uvalue=18446744073709551615
- r0.uvalue=r1.uvalue
- r1.svalue=-1
- r1.type=number
- r1.uvalue=18446744073709551615
- r2.svalue=1
- r2.type=number
- r2.uvalue=1
- r3.type=number
- r3.uvalue=0
- r3.svalue=0

messages:
- "1:2: Code is unreachable after 1:2"

---
test-case: check that left shift by 0 is idempotent - MIN_INT64

Expand Down

0 comments on commit d885eba

Please sign in to comment.