sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

0043-dc.sh (980B)


      1 #!/bin/sh
      2 
      3 tmp=$$.tmp
      4 
      5 trap 'rm -f $tmp' EXIT
      6 trap 'exit $?' HUP INT TERM
      7 
      8 # Test -i flag for extended register names
      9 # <n> syntax: n is parsed as decimal and used as register name byte
     10 # "str" syntax: str is used as multi-character register name
     11 
     12 $EXEC ../dc -i <<'EOF' >$tmp 2>&1
     13 [test 1:]pc 42 s<65> l<65> p c
     14 [test 2:]pc 100 s"foo" l"foo" p c
     15 [test 3:]pc 99 s<65> lA p c
     16 [test 4:]pc 1 S<66> 2 S<66> L<66> p L<66> p c
     17 [test 5:]pc 10 S"bar" 20 S"bar" L"bar" p L"bar" p c
     18 [test 6:]pc 5 s<67> lC p c
     19 [test 7:]pc 1 s"x" 2 s"xy" 3 s"xyz" l"x" p l"xy" p l"xyz" p c
     20 [test 8:]pc 77 s<0> l<0> p c
     21 [test 9:]pc 88 s"D" lD p c
     22 [test 10:]pc [42p] s<69> l<69> x c
     23 [test 11:]pc [99p] s"macro" l"macro" x c
     24 [test 12:]pc 1 s<70> 2 s<70> 3 s<70> l<70> p c
     25 [test 13:]pc 10 s"reg" 20 s"reg" 30 s"reg" l"reg" p c
     26 EOF
     27 
     28 diff -u - $tmp <<'EOF'
     29 test 1:
     30 42
     31 test 2:
     32 100
     33 test 3:
     34 99
     35 test 4:
     36 2
     37 1
     38 test 5:
     39 20
     40 10
     41 test 6:
     42 5
     43 test 7:
     44 1
     45 2
     46 3
     47 test 8:
     48 77
     49 test 9:
     50 88
     51 test 10:
     52 42
     53 test 11:
     54 99
     55 test 12:
     56 3
     57 test 13:
     58 30
     59 EOF