-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #847 from GaloisInc/x86-return-trunc
x86: Truncate RAX when matching smaller return values
- Loading branch information
Showing
5 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
section .bss | ||
section .text | ||
global returntest | ||
returntest: | ||
mov rax, 42 | ||
ret | ||
global _start | ||
_start: | ||
mov rax, 60 | ||
syscall |
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,8 @@ | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
|
||
extern uint32_t returntest(); | ||
|
||
uint32_t test() { | ||
return returntest(); | ||
}; |
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,10 @@ | ||
enable_experimental; | ||
|
||
m <- llvm_load_module "test.bc"; | ||
|
||
let returntest_setup = do { | ||
crucible_execute_func []; | ||
|
||
crucible_return (crucible_term {{ 42 : [32] }}); | ||
}; | ||
crucible_llvm_verify_x86 m "./test" "returntest" [] false returntest_setup w4; |
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,6 @@ | ||
set -e | ||
|
||
yasm -felf64 test.S | ||
ld test.o -o test | ||
clang -c -emit-llvm test.c | ||
$SAW test.saw |
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