diff options
author | comex | 2015-01-10 22:44:55 -0500 |
---|---|---|
committer | comex | 2015-01-10 22:44:55 -0500 |
commit | 102a7371f0a19ee5569d1cd2e8761d7ab3fec75b (patch) | |
tree | 6e0f718543fde994a8f727b08a6cabfcb7122fae /test | |
parent | add licensing (diff) | |
download | substitute-102a7371f0a19ee5569d1cd2e8761d7ab3fec75b.tar.gz |
...
Diffstat (limited to 'test')
-rw-r--r-- | test/test-dis.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test-dis.c b/test/test-dis.c new file mode 100644 index 0000000..127b0b4 --- /dev/null +++ b/test/test-dis.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include "dis.h" +unsigned f(unsigned x) { + struct bitslice addr = {.nruns = 4, .runs = (struct bitslice_run[]) {{0,0,4}, {5,5,7}, {16,13,4}, {23,12,1}}}; + return bs_get(addr, x); + +} +unsigned fs(unsigned val, unsigned op) { + struct bitslice addr = {.nruns = 4, .runs = (struct bitslice_run[]) {{0,0,4}, {5,5,7}, {16,13,4}, {23,12,1}}}; + return bs_set(addr, val, op); + +} +int main() { + printf("%x\n", f(0xdeadbeef)); + printf("%x\n", f(0xdeadbeee)); + printf("%x\n", f(0xfeedface)); + printf("%x\n", fs(0xdead, 0xdeadbeef)); + +} |