extract tests out of src
This commit is contained in:
parent
aad52241c8
commit
36635660b4
35 changed files with 10 additions and 3 deletions
24
test/eucl.ssa
Normal file
24
test/eucl.ssa
Normal file
|
@ -0,0 +1,24 @@
|
|||
# euclide's algorithm in ssa
|
||||
# it is a fairly interesting
|
||||
# ssa program because of the
|
||||
# swap of b and a
|
||||
|
||||
function $test() {
|
||||
@start
|
||||
|
||||
@loop
|
||||
%a =w phi @start 380, @loop %r
|
||||
%b =w phi @start 747, @loop %a
|
||||
%r =w rem %b, %a
|
||||
jnz %r, @loop, @end
|
||||
|
||||
@end
|
||||
storew %a, $a
|
||||
ret
|
||||
}
|
||||
|
||||
# >>> driver
|
||||
# extern void test(void);
|
||||
# int a;
|
||||
# int main() { test(); return !(a == 1); }
|
||||
# <<<
|
Loading…
Add table
Add a link
Reference in a new issue