Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/pr103255.c

raw
1 /* PR tree-optimization/103255 */
2
3 struct H
4 {
5 unsigned a;
6 unsigned b;
7 unsigned c;
8 };
9
10 #if __SIZEOF_POINTER__ >= 4
11 #define ADDR 0x400000
12 #else
13 #define ADDR 0x4000
14 #endif
15 #define OFF 0x20
16
17 int
18 main ()
19 {
20 struct H *h = 0;
21 unsigned long o;
22 volatile int t = 1;
23
24 for (o = OFF; o <= OFF; o += 0x1000)
25 {
26 struct H *u;
27 u = (struct H *) (ADDR + o);
28 if (t)
29 {
30 h = u;
31 break;
32 }
33 }
34
35 if (h == 0)
36 return 0;
37 unsigned *tt = &h->b;
38 if ((__SIZE_TYPE__) tt != (ADDR + OFF + __builtin_offsetof (struct H, b)))
39 __builtin_abort ();
40 return 0;
41 }