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 17, 2024
1 parent 8c795c1 commit 5254526
Showing 1 changed file with 165 additions and 0 deletions.
165 changes: 165 additions & 0 deletions test-data/uninit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@ post:
messages:
- "0: Only numbers can be used as divisors (r3 != 0)"

---
test-case: signed division of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s/= r3
post:
- "r0.svalue=[-1, 1]"
- "r0.type=number"

messages:
- "0: Only numbers can be used as divisors (r3 != 0)"

---
test-case: modulo of a number and an uninitialized register

Expand All @@ -95,6 +114,27 @@ post:
messages:
- "0: Only numbers can be used as divisors (r3 != 0)"

---
test-case: signed modulo of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s%= r3
post:
- "r0.svalue=[0, 1]"
- "r0.svalue=r0.uvalue"
- "r0.type=number"
- "r0.uvalue=[0, 1]"

messages:
- "0: Only numbers can be used as divisors (r3 != 0)"

---
test-case: AND of a number and an uninitialized register

Expand Down Expand Up @@ -150,3 +190,128 @@ post:

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: LSH of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 <<= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: RSH of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 >>= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: ARSH of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s>>= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: MOVSX8 of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s8= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: MOVSX16 of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s16= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: MOVSX32 of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 s32= r3
post:
- "r0.type=number"

messages:
- "0: Invalid type (r3.type == number)"

---
test-case: MOV of a number and an uninitialized register

pre:
- "r0.type=number"
- "r0.uvalue=1"
- "r0.svalue=1"

code:
<start>: |
r0 = r3
post:
- "r0.svalue=r3.svalue"
- "r0.type=r3.type"
- "r0.uvalue=r3.uvalue"

0 comments on commit 5254526

Please sign in to comment.