Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
devops committed Jul 26, 2024
2 parents f73063d + 869befa commit 815a335
Show file tree
Hide file tree
Showing 23 changed files with 72 additions and 1 deletion.
4 changes: 3 additions & 1 deletion k-distribution/include/kframework/builtin/domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,9 @@ module BYTES
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes((log2Int(I) +Int 9) /Int 8, I, E)
requires I >Int 0 [preserves-definedness]
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes((log2Int(~Int I) +Int 9) /Int 8, I, E)
requires I <Int 0 [preserves-definedness]
requires I <Int -1 [preserves-definedness]
rule Int2Bytes(I::Int, E::Endianness, Signed ) => Int2Bytes(1, -1, E)
requires I ==Int -1 [preserves-definedness]
endmodule
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\x01\x04" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\x04\x01" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\x04\x01" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\xff" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\xfb\xff" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\x01\x04" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\xff" ~> .K
</k>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<k>
b"\xff\xfb" ~> .K
</k>
6 changes: 6 additions & 0 deletions k-distribution/tests/regression-new/int2bytes-no-len/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DEF=test
EXT=test
TESTDIR=.
KOMPILE_BACKEND=llvm
KOMPILE_FLAGS=--syntax-module TEST
include ../../../include/kframework/ktest.mak
23 changes: 23 additions & 0 deletions k-distribution/tests/regression-new/int2bytes-no-len/test.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) Runtime Verification, Inc. All Rights Reserved.
// testing that krun pretty prints corectly Bytes
// kx should replace krun though, so if this test
// prevents a future upgrade, it should be removed

module TEST
imports BYTES
imports INT

configuration <k> $PGM:Int </k>
rule 0 => Int2Bytes(0, LE, Unsigned) +Bytes Int2Bytes(0, LE, Signed)
rule 1 => Int2Bytes(1025, LE, Unsigned)
rule 2 => Int2Bytes(1025, LE, Signed)
rule 3 => Int2Bytes(-1, LE, Signed)
rule 4 => Int2Bytes(-1025, LE, Signed)

rule 10 => Int2Bytes(0, BE, Unsigned) +Bytes Int2Bytes(0, BE, Signed)
rule 11 => Int2Bytes(1025, BE, Unsigned)
rule 12 => Int2Bytes(1025, BE, Signed)
rule 13 => Int2Bytes(-1, BE, Signed)
rule 14 => Int2Bytes(-1025, BE, Signed)

endmodule

0 comments on commit 815a335

Please sign in to comment.