-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macaw-symbolic
: Implement MacawFreshSymbolic
for all macaw
Type
s
Rather than `error`ing, we now generate fresh constants for all possible `macaw` `Type`s that are supplied to the `MacawFreshSymbolic` operation. Fixes #301.
- Loading branch information
1 parent
2e49eb5
commit 4611d67
Showing
6 changed files
with
100 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// In Ubuntu 20.04, compiling this C code will result in the assembly code in | ||
// strd.s. Sadly, Ubuntu 22.04's version of gcc will produce slightly different | ||
// assembly that does not include the strd instruction, which is critical for | ||
// testing the issue in https://github.com/GaloisInc/macaw/issues/301. As such, | ||
// I've checked in the assembly code to ensure that we can continue testing code | ||
// involving strd, but I've also checked in the original C code as a reference. | ||
#include <stdint.h> | ||
|
||
uint64_t x = 0; | ||
|
||
int __attribute__((noinline)) test_strd() { | ||
x = 42; | ||
return x == 42; | ||
} | ||
|
||
void _start() { | ||
test_strd(); | ||
} |
Binary file not shown.
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,31 @@ | ||
.global test_strd | ||
.syntax unified | ||
test_strd: | ||
push {fp} @ (str fp, [sp, #-4]!) | ||
add fp, sp, #0 | ||
movw r3, #312 @ 0x138 | ||
movt r3, #2 | ||
mov r0, #42 @ 0x2a | ||
mov r1, #0 | ||
strd r0, [r3] | ||
movw r3, #312 @ 0x138 | ||
movt r3, #2 | ||
ldrd r2, [r3] | ||
cmp r3, #0 | ||
cmpeq r2, #42 @ 0x2a | ||
moveq r3, #1 | ||
movne r3, #0 | ||
uxtb r3, r3 | ||
mov r0, r3 | ||
add sp, fp, #0 | ||
pop {fp} @ (ldr fp, [sp], #4) | ||
bx lr | ||
|
||
.global _start | ||
.syntax unified | ||
_start: | ||
push {fp, lr} | ||
add fp, sp, #4 | ||
bl test_strd | ||
nop {0} | ||
pop {fp, pc} |
Binary file not shown.
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