// Test allocate and free //% set debug_print_ccode = true main module T1 use TEXTIO declare Flex_array is packed array [1..?n] of char P is pointer Flex_array T1,T2,T3,T4: static P temp1: static packed array[1..5] of char temp2: static packed array[1..7] of char h1: static integer initially 3 h2: static integer initially 22 enddeclare T1 := allocate P ("ABCDE") T2 := allocate P ((h1+h2)/5) // 5 T3 := allocate P (N: 5) T4 := allocate P (N: 6) T2@ := "ABCDE" T3@ := "ABCDE" T4@ := "ABCDEF" out_string (tty, "(true): ") out_boolean (tty, t1@=t2@ and T1@=T3@ and T1@<>T4@) out_string (tty, " ") out_boolean (tty, t1@=t2@) out_string (tty, " ") out_boolean (tty, t1@=t3@) out_string (tty, " ") out_boolean (tty, t1@<>t4@) out_record (tty) endmodule