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 */
9 char rcs_id[] = "$Id: bugs.c,v 2.4 1994/06/24 12:08:03 ceriel Exp $" ;
11 /* This programs is a collection of derived from small tests develloped
12 for specific bugs/features in the C->EM compiler
17 set_err(s) char *s ; {
22 printf("%s: error %d\n",err_name,i) ;
40 /* Some compilers magically transform the second < into a > */
46 result= ( (j-i<0) == (j-i<0) ) ? 1 : 0 ;
57 if ( &p1-&p2 != -1 ) e(1) ;
58 if ( &i-&p1 >=0 ) e(2) ;
59 if ( &p1-&i <=0 ) e(3) ;
65 con_flo( (1 ? 3 : 4.5), 200, 200, 200 ) ;
70 con_flo(d) double d ; {
71 if ( d>3.00001 || d<2.99999 ) e(1) ;
88 i = ( *pc++ = 01777 ) ;
93 if ( !s_extend ) e(2) ;
96 if ( s_extend ) e(3) ;
117 struct s1 { char s1_a[3] ; } ss1, is1 ;
127 set_err("acc_struct") ;
129 is1.s1_a[0]=1 ; is1.s1_a[1]=100 ; is1.s1_a[2]=127 ;
130 ss3.s3_s2.s2_s1= is1 ;
131 ss1 = ps3->s3_s2.s2_s1 ;
132 if ( ss1.s1_a[0]!=1 ) e(1) ;
133 if ( ss1.s1_a[1]!=100 ) e(2) ;
134 if ( ss1.s1_a[2]!=127 ) e(3) ;
138 set_err("char_param") ;
142 fcall(c1,c2,c3) char c1,c2,c3 ; {
146 if ( c1!=127 ) e(3) ;
151 c_alter(ptr,val) char *ptr ; int val ; {
161 if ( &a[6] != a+i ) e(1) ;
166 set_err("compl_ind") ;
168 i=0 ; if ( arr[i+10] != 111 ) e(1) ;