FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 941014-2.c
blob3932a34ce92482a308aa0efbd3d8e98274156dc7
1 #include <stdio.h>
2 #include <stdlib.h>
4 typedef struct {
5 unsigned short a;
6 unsigned short b;
7 } foo_t;
9 void a1 (unsigned long offset) {}
11 volatile foo_t *
12 f ()
14 volatile foo_t *foo_p = (volatile foo_t *)malloc (sizeof (foo_t));
16 a1((unsigned long)foo_p-30);
17 if (foo_p->a & 0xf000)
18 printf("%d\n", foo_p->a);
19 foo_p->b = 0x0100;
20 a1 ((unsigned long)foo_p + 2);
21 a1 ((unsigned long)foo_p - 30);
22 return foo_p;
25 main ()
27 volatile foo_t *foo_p;
29 foo_p = f ();
30 if (foo_p->b != 0x0100)
31 abort ();
32 exit (0);