1 /* This program will most likely crash on systems that need shorts and ints
2    to be word aligned
3   Copyright (C) 2005 Free Software Foundation
4 
5   Copying and distribution of this file, with or without modification,
6   are permitted in any medium without royalty provided the copyright
7   notice and this notice are preserved.
8 
9 */
10 #include <stdlib.h>
11 
main()12 int main ()
13 {
14   char  *buf = malloc(30);
15   void  *v;
16   short *sp;
17   short *sq;
18   int   *ip;
19   int   *iq;
20   int   i;
21 
22   for (i = 0 ; i < 30; i++)
23     {
24       buf[i] = i;
25     }
26   v = buf;
27 
28   sp = (short*)(v + 1);
29   sq = (short*)(v + 2);
30   if (*sp == *sq)
31     {
32       return 1;
33     }
34 
35   ip = (int*)(v + 1);
36   iq = (int*)(v + 2);
37   if (*ip == *iq)
38     {
39       return 1;
40     }
41 
42   return 0;
43 }
44 
45