2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 /* Author: E.G. Keizer */
8 static char rcs_id[]= "$Id$" ;
10 /* test for structure parameters, assignment and return */
37 /* test structure assignment */
38 struct w1 st1, st2, *st3 ;
39 struct w2 s2t1, s2t2, *s2t3 ;
40 struct w3 s3t1, s3t2, *s3t3 ;
48 printf("\tst2.w1_i %d\n",st2.w1_i) ;
50 printf("\t(*st3).w1_i %d\n",(*st3).w1_i) ;
53 printf("\tst1.w1_i %d\n",st1.w1_i) ;
54 printf("\tst2.w1_i %d\n",st2.w1_i) ;
56 printf("\tes2[2].w1_i %d\n",es2[2].w1_i) ;
60 for ( i=0 ; i<2 ; i++ ) {
61 st2 = ( i ? st1 : es1 ) ;
62 printf("\tst2.w1_i %d\n",st2.w1_i) ;
66 printf("\tst1.w1_i %d\n",st1.w1_i) ;
72 printf("\ts2t2: .w2_i %d .w2_l %ld\n",s2t2.w2_i,s2t2.w2_l) ;
74 printf("\ts2t3->w2_l %ld\n",s2t3->w2_l) ;
77 for ( i = 0 ; i<ASIZE ; i++ ) {
83 for ( i = 0 ; i<ASIZE ; i++ ) {
84 printf("s3t2.w3_a[%2d] %c\n",i,s3t2.w3_a[i]) ;
86 printf("s3t2.w3_u %x\n",s3t2.w3_u) ;
88 for ( i = 0 ; i<ASIZE ; i++ ) {
92 for ( i = 0 ; i<ASIZE ; i++ ) {
93 printf("s3t1.w3_a[%2d] %c\n",i,s3t1.w3_a[i]) ;
95 printf("s3t1.w3_u %x",s3t1.w3_u) ;
101 /* test structure parameters */
107 for ( i=0 ; i<ASIZE ; i++ ) {
111 printf("\nstructure parameters\n") ;
115 psc(before,str,after) int before, after ; struct w3 str ; {
118 printf("before %d\n",before) ;
119 for ( i=0 ; i<ASIZE ; i++ ) {
120 printf("str.w3_a[%2d]\t%d\n",i,str.w3_a[i]) ;
122 printf("str.w3_u %x\n",str.w3_u) ;
123 printf("after %d\n",after) ;
127 /* test structure valued functions */
128 extern struct w3 setp1(), setp2() ;
132 printf("\nStucture valued functions\n") ;
134 printf("myp.w3_a:\n") ;
135 for ( i=0 ; i<ASIZE ; i++ ) {
136 printf("\t%2d\t%d\n",i,myp.w3_a[i]) ;
141 for ( i=0 ; i<ASIZE ; i++ ) {
142 printf("\t%2d\t%d\n",i,myp.w3_a[i]) ;
146 struct w3 setp1(count) {
152 myp = setp1(count-1) ;
153 myp.w3_a[count-1] = 99-count-1 ;
157 static struct w3 myp2 ;
163 for ( i=0 ; i<ASIZE ; i++ ) {