//------------------------------------------------------------------------ // Test multiple comparisons and calls with allocated flexible arrays //------------------------------------------------------------------------ main module ALLOCATE9 use TEXTIO declare Flex_array is packed array [1..?n] of char P is pointer Flex_array T1, T2 : static P temp1, temp2 : static packed array[1..5] of char b : static boolean enddeclare procedure testit (a: in ref packed array[1..?n] of char) out_string (tty, "a=") out_string (tty, a) out_string (tty, " Result=") out_boolean (tty, T1@=a) out_string (tty, " ") out_boolean (tty, a=T1@) out_record (tty) endprocedure procedure testit_again (a: in ref packed array[1..?n] of char) out_string (tty, "a=") out_string (tty, a) out_string (tty, " Result=") out_boolean (tty, a="ABCDE") out_string (tty, " ") out_boolean (tty, "ABCDE"=a) out_record (tty) endprocedure procedure testit_twice (a,b: in ref packed array[1..?n] of char) out_string (tty, "a=") out_string (tty, a) out_String (tty, " b=") out_string (tty, b) out_string (tty, " Result=") out_boolean (tty, a=b) out_string (tty, " ") out_boolean (tty, b=a) out_record (tty) endprocedure T1 := allocate P ("ABCDE") T2 := allocate P ("ABCDE") testit ("ABCDE") testit (T2@) testit ("ABCD") testit ("ABCDEF") testit_again ("ABCDE") testit_again (T2@) testit_again ("ABCD") testit_again ("ABCDEF") testit_twice ("ABCDE", "ABCDE") testit_twice ("ABCDE",T1@) testit_twice (T1@,T2@) testit_twice ("ABCD","ABCDE") testit_twice ("ABCD",T1@) endmodule