Branch Coverage

lib/SIRTX/VM/Assembler.pm
Criterion Covered Total %
branch 0 376 0.0


line true false branch
310 0 0 unless defined $fh
312 0 0 unless (ref $fh)
313 0 0 unless open my $x, "<", $fh
324 0 0 unless defined $fh
326 0 0 unless (ref $fh)
327 0 0 unless open my $x, ">", $fh
337 0 0 if (defined(my $profile = delete $opts{'profile'}))
338 0 0 unless ref $profile
345 0 0 if scalar keys %opts
354 0 0 if scalar @opts
363 0 0 if ($size & 1)
374 0 0 if $boundary < $s->[-1]
377 0 0 if ($boundary & 1)
378 0 0 if (defined $self->{'aliases'}{'size$out$'} and $self->{'aliases'}{'size$out$'}[-1] > $boundary) { }
394 0 0 if $boundary < $s->[-1]
397 0 0 if ($boundary & 1)
398 0 0 if (defined $self->{'aliases'}{'size$out$'} and $self->{'aliases'}{'size$out$'}[-1] > $boundary) { }
422 0 0 if defined $entry->{'update'}
427 0 0 if (scalar @{$self->{'pushback'};})
443 0 0 if scalar @opts
445 0 0 if (ref $dumpfilename) { }
489 0 0 unless open my $fh, $mode, $filename
516 0 0 if $hash->{$profile}
526 0 0 if (defined(my $entry = $_synthetic{$profile}{$cmd}))
536 0 0 if ($self->{'alignment'} % $req)
539 0 0 if ($error)
541 0 0 if ($warn > 1) { }
0 0 elsif ($warn) { }
564 0 0 if defined $self->{'aliases'}{$name}
595 0 0 unless (defined $loc)
596 0 0 if ($self->{'settings'}{'regmap_auto'})
601 0 0 unless defined $reg
608 0 0 unless defined $loc
628 0 0 unless defined $reg
651 0 0 unless defined $auto_host_defined and defined $auto_host_defined->[2]
655 0 0 if ($auto_host_defined->[2] > $auto_host_defined->[1])
682 0 0 if $line eq ""
685 0 0 if ($line =~ s/^("[^"]*")//u) { }
0 0 elsif ($line =~ m[^(?:;|//|#)]u) { }
0 0 elsif ($line =~ s/^([^\s,=]+)//u) { }
700 0 0 unless scalar @parts
703 0 0 if ($parts[0] =~ s/([\?\!])$//u)
704 0 0 if ($1 eq "!")
725 0 0 if ($cmd ne ".pushname" and $cmd ne ".popname")
729 0 0 unless $part =~ /^[a-z0-9]*\$/u
733 0 0 if ($allow_alts) { }
735 0 0 if (defined $self->{'aliases'}{$alt})
741 0 0 if defined $self->{'aliases'}{$alts[0]}
748 0 0 if ($arg eq "~auto")
753 0 0 if ($cmd eq '.quit' and scalar @args == 0) { }
0 0 elsif ($cmd eq '.profile' and scalar @args > 0) { }
0 0 elsif ($cmd eq '.pushname' and not scalar @args & 1) { }
0 0 elsif ($cmd eq '.popname') { }
0 0 elsif ($cmd eq '.tag' and scalar @args == 2 and $args[0] =~ /^[0-9a-zA-Z_]+$/u and defined $_type_to_sni{$args[1]}) { }
0 0 elsif ($cmd eq '.tag' and scalar @args == 2 and $args[0] =~ /^[0-9a-zA-Z_]+$/u and $self->_get_value_type($args[1]) =~ /:$/u) { }
0 0 elsif ($cmd eq '.tag' and scalar @args == 2 and $args[0] =~ /^[0-9a-zA-Z_]+$/u and $self->_get_value_type($args[1]) eq 'int') { }
0 0 elsif ($cmd eq '.tag' and scalar @args == 3 and $args[0] =~ /^[0-9a-zA-Z_]+$/u and $args[1] =~ /^[0-9a-zA-Z_]+$/u and $self->_get_value_type($args[2]) eq 'int') { }
0 0 elsif ($cmd eq '.utf8') { }
0 0 elsif ($cmd eq '.byte') { }
0 0 elsif ($cmd eq '.uint16') { }
0 0 elsif ($cmd eq '.uint16_half_up') { }
0 0 elsif ($cmd eq '.string' and scalar @args >= 2) { }
0 0 elsif ($cmd eq 'open' and scalar @args == 2 and $self->_get_value_type($args[0]) eq 'reg' and $self->_get_value_type($args[1]) eq 'string') { }
0 0 elsif ($cmd eq 'open' and scalar @args == 2 and $self->_get_value_type($args[0]) eq 'reg' and $self->_get_value_type($args[1]) eq 'port') { }
0 0 elsif ($cmd eq 'byte_transfer' and scalar @args == 2 and $self->_get_value_type($args[0]) eq 'reg' and $self->_get_value_type($args[1]) eq 'string') { }
0 0 elsif ($cmd eq '.rodata' and scalar @args == 0) { }
0 0 elsif ($cmd eq '.include') { }
0 0 elsif ($cmd eq '.cat') { }
0 0 elsif ($cmd eq '.noops' and scalar @args == 1) { }
0 0 elsif ($cmd eq '.org' and scalar @args == 1) { }
0 0 elsif ($cmd eq '.align' and scalar @args == 1) { }
0 0 elsif ($cmd eq '.host_defined_auto_range' and scalar @args == 2 and $self->_get_value_type($args[0]) eq 'int' and $self->_get_value_type($args[1]) eq 'int') { }
0 0 elsif ($cmd eq '.label' and scalar @args == 1 || scalar @args == 3 and $args[0] =~ /^[a-z0-9A-Z_]+$/u and scalar @args == 1 || $args[1] eq 'as' && $args[2] =~ /^~[0-9]+$/u) { }
0 0 elsif ($cmd eq '.endlabel' and scalar @args == 0 and defined $self->{'current'}{'label'}) { }
0 0 elsif ($cmd eq '.function' and scalar @args == 1 || scalar @args == 3 and $args[0] =~ /^[a-z0-9A-Z_]+$/u and scalar @args == 1 || $args[1] eq 'as' && $args[2] =~ /^~[0-9]+$/u) { }
0 0 elsif ($cmd eq '.endfunction' and scalar @args == 0 and defined $self->{'current'}{'function'}) { }
0 0 elsif ($cmd eq '.section' and scalar @args == 1 || scalar @args == 2 and not defined $self->{'current'}{'section'}) { }
0 0 elsif ($cmd eq '.endsection' and scalar @args == 0 and defined(my $section = $self->{'current'}{'section'})) { }
0 0 elsif ($cmd eq '.chunk' and scalar @args >= 2) { }
0 0 elsif ($cmd eq '.endchunk' and scalar @args == 0 and defined $self->{'current'}{'chunk'}) { }
0 0 elsif ($cmd =~ /^\.(regmap_auto|synthetic_auto_unref)$/u and scalar @args == 1) { }
0 0 elsif ($cmd eq '.map' and scalar @args == 2) { }
0 0 elsif ($cmd eq '.force_mapped') { }
0 0 elsif ($cmd eq '.mine' or $cmd eq '.yours' or $cmd eq '.theirs') { }
0 0 elsif ($cmd eq '.hot' or $cmd eq '.cold' or $cmd eq '.lukewarm') { }
0 0 elsif ($cmd eq '.regattr' and scalar @args >= 1) { }
0 0 elsif ($cmd eq 'map' and scalar @args == 2) { }
0 0 elsif (defined($opcode = eval { do { 'SIRTX::VM::Opcode'->from_template('parts', $parts, 'assembler', $self, 'size', $opts->{'size'}, 'line', $opts->{'line'}, 'out', $out, 'autodie', $autodie) } })) { }
0 0 elsif (defined($opcode = eval { do { 'SIRTX::VM::Opcode'->from_template('parts', [$parts->[0], map({scalar eval { do { $self->_get_value_type($_) eq 'alias' } } ? 65520 : $_;} @$parts[1 .. scalar(@{$parts;}) - 1])], 'assembler', $self, 'size', $opts->{'size'}, 'line', $opts->{'line'}, 'out', $out, 'autodie', $autodie) } })) { }
0 0 elsif (defined $_info{$cmd} and scalar @args > 1 and $args[0] =~ /^~0?$/u) { }
763 0 0 unless ($key =~ /^\$[0-9a-zA-Z_]+/u)
771 0 0 unless (defined $self->{'aliases'}{$key})
776 0 0 unless scalar @{$self->{'aliases'}{$key};}
829 0 0 if $args[0] ne "out"
834 0 0 if ($args[0] ne "out")
838 0 0 if $self->{'settings'}{'synthetic_auto_unref'}
845 0 0 if $self->{'settings'}{'synthetic_auto_unref'}
857 0 0 if defined $size
887 0 0 if $p & 1
896 0 0 if $end < $start or $start < 1
897 0 0 if defined $self->{'auto_host_defined'}
902 0 0 if (scalar @args == 3 and $args[1] eq "as" and $args[2] =~ /^~[0-9]+$/u)
913 0 0 if (scalar @args == 3 and $args[1] eq "as" and $args[2] =~ /^~[0-9]+$/u)
917 0 0 unless ($self->{'was_return'})
929 0 0 unless (defined $S)
934 0 0 if (defined(my $disabled = $_disabled_sections{$profile}))
935 0 0 if ($$disabled{$args[0]})
941 0 0 if (defined(my $bad = $_section_order_bad{$args[0]}))
943 0 0 unless defined $self->{'sections'}{$key}
944 0 0 if defined $bad->{$key}
948 0 0 if (scalar @args == 2)
951 0 0 if $l != 6 and $l != 4 and $l != 2 and $l != 0
965 0 0 unless ($self->_using_profile("minimal"))
974 0 0 unless ($self->_using_profile("minimal"))
975 0 0 if defined $section->{'close_opcode'}
990 0 0 if ($c eq 'of' || $c eq 'as' || $c eq 'name' and scalar @in) { }
0 0 elsif ($c eq 'standalone') { }
999 0 0 if (defined(my $as = $info{'as'}))
1000 0 0 unless ($as =~ /^~([0-9]+)$/u)
1007 0 0 if (defined $info{'name'} and length $info{'name'}) { }
0 0 elsif ($identifier) { }
1008 0 0 unless ($info{'name'} =~ /^[0-9a-z]+$/u)
1019 0 0 if defined $info{'as'}
1021 0 0 if (defined(my $of = $info{'of'})) { }
1022 0 0 if ($of =~ /^~([0-9]+)$/u) { }
1029 0 0 if ($t eq 'sid') { }
0 0 elsif ($t eq 'sni') { }
1041 0 0 if $info{'standalone'}
1042 0 0 if $identifier > 0
1058 0 0 if $identifier > 0
1072 0 0 $cmd eq '.yours' ? :
0 0 $cmd eq '.mine' ? :
1078 0 0 $cmd eq '.cold' ? :
0 0 $cmd eq '.hot' ? :
1088 0 0 if ($attr eq 'mine') { }
0 0 elsif ($attr eq 'yours') { }
0 0 elsif ($attr eq 'theirs') { }
0 0 elsif ($attr eq 'hot') { }
0 0 elsif ($attr eq 'cold') { }
0 0 elsif ($attr eq 'lukewarm') { }
0 0 elsif ($attr eq 'volatile') { }
1113 0 0 if $opcode->is_autodie
1116 0 0 if (scalar eval { do { $self->_get_value_type($_) eq 'alias' } }) { }
1126 0 0 if $opcode->is_autodie
1133 0 0 if (defined(my $entry = $self->_get_synthetic($cmd)))
1142 0 0 if (scalar @argmap >= 2 and $argmap[-2] eq 'any...') { }
1143 0 0 unless scalar(@args) * 2 >= scalar @argmap
1145 0 0 unless scalar(@args) * 2 == scalar @argmap
1154 0 0 if ($type =~ /^".+"$/u) { }
0 0 elsif ($type eq 'any') { }
0 0 elsif ($type eq 'any...') { }
1155 0 0 if $val ne $self->_parse_string($type)
1162 0 0 if (ref $type) { }
1166 0 0 if $t ne $tw and not $t =~ /:$/u && $tw eq 'id'
1170 0 0 unless $found
1172 0 0 if $t ne $type and not $t =~ /:$/u && $type eq 'id'
1176 0 0 if ($dst eq 'undef') { }
1195 0 0 ref $updates{${$_;}} ? :
0 0 if (ref $_) { }
1198 0 0 if ($parts[0] =~ s/\*$//u)
1206 0 0 if ($self->{'settings'}{'synthetic_auto_unref'})
1211 0 0 if $reset_autodie
1216 0 0 unless $done
1219 0 0 if (${$autodie;})
1234 0 0 if defined scalar eval { do { $self->{'rf'}->get_physical_by_name($value) } }
1235 0 0 if $value eq "true" or $value eq "false"
1236 0 0 if $value eq "undef"
1237 0 0 if $value =~ /^(?:"|U\+)/u
1238 0 0 if $value =~ /^'?[\+\-]?(?:0|[1-9][0-9]*|0x[0-9a-fA-F]+|0[0-7]+|0b[01]+)$/u
1239 0 0 if $value =~ /^%[a-zA-Z][:a-zA-Z0-9]*$/u
1241 0 0 if ($value =~ /^([a-z]+):(?:0|[1-9][0-9]*)$/u)
1243 0 0 if defined $_type_to_sni{$type}
1247 0 0 if ($value =~ /^([1-9][0-9]*):(?:0|[1-9][0-9]*)$/u)
1249 0 0 if (defined $_sni_to_type{$type}) { }
1256 0 0 if $value =~ /^logical:/u
1257 0 0 if $value =~ /^[a-z0-9]*\$/u
1274 0 0 if ($val =~ s/^-//u) { }
0 0 elsif ($val =~ s/^\+//u) { }
1282 0 0 if ($val =~ /^[1-9]/u) { }
0 0 elsif ($val =~ /^(?:0[0-7]*|0x[0-9a-fA-F]+|0b[01]+)$/u) { }
1290 0 0 if $neg
1298 0 0 if defined $_escapes{$esc}
1299 0 0 if $esc =~ /^x([0-9a-f]{2})$/u
1305 0 0 if ($str =~ s/^"(.*)"$/$1/u) { }
0 0 elsif ($str =~ /^U\+([0-9a-fA-F]{4,6})$/u) { }
1325 0 0 if ($str =~ /^([a-z]+):(0|[1-9][0-9]*)$/u) { }
0 0 elsif ($str =~ /^([1-9][0-9]*):(0|[1-9][0-9]*)$/u) { }
1330 0 0 if (defined $_sni_to_type{$type}) { }