]> git.imager.perl.org - imager.git/blob - t/t59assem.t
fix handling of yoff for untransformed image based fills
[imager.git] / t / t59assem.t
1 #!perl -w
2 use strict;
3 use Test::More tests => 6;
4
5 BEGIN { use_ok('Imager::Expr::Assem') }
6
7 SKIP:
8 {
9   my $expr = Imager::Expr->new
10     ({assem=><<EOS,
11         var count:n ; var p:p
12         count = 0
13         p = getp1 x y
14 loop:
15 # this is just a delay
16         count = add count 1
17         var temp:n
18         temp = lt count totalcount
19         jumpnz temp loop
20         ret p
21 EOS
22       variables=>[qw(x y)],
23       constants=>{totalcount=>5}
24      });
25   ok($expr, "compile simple assembler")
26     or do {
27       print "# ", Imager::Expr->error, "\n";
28       skip("didn't compile", 4);
29     };
30   my $code = $expr->dumpcode();
31   my @code = split /\n/, $code;
32   ok($code[-1] =~ /:\s+ret/, "last op is a ret");
33   ok($code[0] =~ /:\s+set/, "first op is a set");
34   ok($code[1] =~ /:\s+getp1/, "next is a getp1");
35   ok($code[3] =~ /:\s+lt/, "found comparison");
36 }