-- version control marker $Id: cgtest76.occ,v 1.1 1997/03/31 09:07:36 djb1 Exp $
-- User Defined Operators tests by Jim Moores <jm40@ukc.ac.uk>


PROC cgtest76 (CHAN OF BYTE keyb, scr, err)

  #INCLUDE "cgmain.occ"
  #INCLUDE "cgreal.occ"

  PROC test0 ()
    INT FUNCTION "-" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := - a
      check.INT (c,INT(1),"test0")
  :

  PROC test1 ()
    INT32 FUNCTION "-" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := - a
      check.INT32 (c,INT32(2),"test1")
  :

  PROC test2 ()
    INT64 FUNCTION "-" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := - a
      check.INT64 (c,INT64(3),"test2")
  :

  PROC test3 ()
    REAL32 FUNCTION "-" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := - a
      check.REAL32 (c,REAL32 TRUNC(4),"test3")
  :

  PROC test4 ()
    REAL64 FUNCTION "-" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := - a
      check.REAL64 (c,REAL64 TRUNC(5),"test4")
  :

  PROC test5 ()
    BOOL FUNCTION "-" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := - a
      check.BOOL (c,TRUE,"test5")
  :

  PROC test6 ()
    INT FUNCTION "NOT" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := NOT a
      check.INT (c,INT(1),"test6")
  :

  PROC test7 ()
    INT32 FUNCTION "NOT" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := NOT a
      check.INT32 (c,INT32(2),"test7")
  :

  PROC test8 ()
    INT64 FUNCTION "NOT" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := NOT a
      check.INT64 (c,INT64(3),"test8")
  :

  PROC test9 ()
    REAL32 FUNCTION "NOT" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := NOT a
      check.REAL32 (c,REAL32 TRUNC(4),"test9")
  :

  PROC test10 ()
    REAL64 FUNCTION "NOT" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := NOT a
      check.REAL64 (c,REAL64 TRUNC(5),"test10")
  :

  PROC test11 ()
    BOOL FUNCTION "NOT" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := NOT a
      check.BOOL (c,TRUE,"test11")
  :

  PROC test12 ()
    INT FUNCTION "~" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := ~ a
      check.INT (c,INT(1),"test12")
  :

  PROC test13 ()
    INT32 FUNCTION "~" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := ~ a
      check.INT32 (c,INT32(2),"test13")
  :

  PROC test14 ()
    INT64 FUNCTION "~" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := ~ a
      check.INT64 (c,INT64(3),"test14")
  :

  PROC test15 ()
    REAL32 FUNCTION "~" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := ~ a
      check.REAL32 (c,REAL32 TRUNC(4),"test15")
  :

  PROC test16 ()
    REAL64 FUNCTION "~" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := ~ a
      check.REAL64 (c,REAL64 TRUNC(5),"test16")
  :

  PROC test17 ()
    BOOL FUNCTION "~" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := ~ a
      check.BOOL (c,TRUE,"test17")
  :

  PROC test18 ()
    INT FUNCTION "??" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := ?? a
      check.INT (c,INT(1),"test18")
  :

  PROC test19 ()
    INT32 FUNCTION "??" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := ?? a
      check.INT32 (c,INT32(2),"test19")
  :

  PROC test20 ()
    INT64 FUNCTION "??" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := ?? a
      check.INT64 (c,INT64(3),"test20")
  :

  PROC test21 ()
    REAL32 FUNCTION "??" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := ?? a
      check.REAL32 (c,REAL32 TRUNC(4),"test21")
  :

  PROC test22 ()
    REAL64 FUNCTION "??" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := ?? a
      check.REAL64 (c,REAL64 TRUNC(5),"test22")
  :

  PROC test23 ()
    BOOL FUNCTION "??" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := ?? a
      check.BOOL (c,TRUE,"test23")
  :

  PROC test24 ()
    INT FUNCTION "@@" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := @@ a
      check.INT (c,INT(1),"test24")
  :

  PROC test25 ()
    INT32 FUNCTION "@@" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := @@ a
      check.INT32 (c,INT32(2),"test25")
  :

  PROC test26 ()
    INT64 FUNCTION "@@" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := @@ a
      check.INT64 (c,INT64(3),"test26")
  :

  PROC test27 ()
    REAL32 FUNCTION "@@" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := @@ a
      check.REAL32 (c,REAL32 TRUNC(4),"test27")
  :

  PROC test28 ()
    REAL64 FUNCTION "@@" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := @@ a
      check.REAL64 (c,REAL64 TRUNC(5),"test28")
  :

  PROC test29 ()
    BOOL FUNCTION "@@" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := @@ a
      check.BOOL (c,TRUE,"test29")
  :

  PROC test30 ()
    INT FUNCTION "$$" (VAL INT a) IS INT(1):
    INT a:
    INT c:
    SEQ
      c := $$ a
      check.INT (c,INT(1),"test30")
  :

  PROC test31 ()
    INT32 FUNCTION "$$" (VAL INT32 a) IS INT32(2):
    INT32 a:
    INT32 c:
    SEQ
      c := $$ a
      check.INT32 (c,INT32(2),"test31")
  :

  PROC test32 ()
    INT64 FUNCTION "$$" (VAL INT64 a) IS INT64(3):
    INT64 a:
    INT64 c:
    SEQ
      c := $$ a
      check.INT64 (c,INT64(3),"test32")
  :

  PROC test33 ()
    REAL32 FUNCTION "$$" (VAL REAL32 a) IS REAL32 TRUNC(4):
    REAL32 a:
    REAL32 c:
    SEQ
      c := $$ a
      check.REAL32 (c,REAL32 TRUNC(4),"test33")
  :

  PROC test34 ()
    REAL64 FUNCTION "$$" (VAL REAL64 a) IS REAL64 TRUNC(5):
    REAL64 a:
    REAL64 c:
    SEQ
      c := $$ a
      check.REAL64 (c,REAL64 TRUNC(5),"test34")
  :

  PROC test35 ()
    BOOL FUNCTION "$$" (VAL BOOL a) IS TRUE:
    BOOL a:
    BOOL c:
    SEQ
      c := $$ a
      check.BOOL (c,TRUE,"test35")
  :
  SEQ
    init ("CG test 76","User Defined Operators 7")
    title("Testing operators (monadic)")
    test0()
    test1()
    test2()
    test3()
    test4()
    test5()
    test6()
    test7()
    test8()
    test9()
    test10()
    test11()
    test12()
    test13()
    test14()
    test15()
    test16()
    test17()
    test18()
    test19()
    test20()
    test21()
    test22()
    test23()
    test24()
    test25()
    test26()
    test27()
    test28()
    test29()
    test30()
    test31()
    test32()
    test33()
    test34()
    test35()
    finish ()
:
