-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for x86 64 bit integer stack arguments.
- Loading branch information
1 parent
a400e9e
commit 9b2a33a
Showing
7 changed files
with
109 additions
and
34 deletions.
There are no files selected for viewing
Binary file not shown.
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,8 @@ | ||
unsigned long test(unsigned long a, unsigned long b, unsigned long c, unsigned long d,unsigned long e, unsigned long f, unsigned long g, unsigned long h) { | ||
return g - h; | ||
} | ||
|
||
int main() { | ||
return 0; | ||
} | ||
|
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,21 @@ | ||
enable_experimental; | ||
|
||
m <- llvm_load_module "test.bc"; | ||
|
||
let test_spec = do { | ||
x <- llvm_fresh_var "x" (llvm_int 64); | ||
llvm_execute_func | ||
[ llvm_term {{ 0 : [64] }} | ||
, llvm_term {{ 1 : [64] }} | ||
, llvm_term {{ 2 : [64] }} | ||
, llvm_term {{ 3 : [64] }} | ||
, llvm_term {{ 4 : [64] }} | ||
, llvm_term {{ 5 : [64] }} | ||
, llvm_term x | ||
, llvm_term {{ 1 : [64] }} | ||
]; | ||
llvm_return (llvm_term {{ x - 1 }}); | ||
}; | ||
|
||
llvm_verify_x86 m "./test" "test" [] true test_spec 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,9 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
clang -c -emit-llvm -g -frecord-command-line test.c | ||
# clang -c -target x86_64 test.c | ||
# ld.lld -o test test.o | ||
clang -o test 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