docs: Document that __builtin_assoc_barrier also can be used for FMAs [PR115023]
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / builtins / pr22237.c
blob957a47c0f74c27e4a6158d0d31eb13555ab18edf
1 extern void abort (void);
2 extern void exit (int);
3 struct s { unsigned char a[256]; };
4 union u { struct { struct s b; int c; } d; struct { int c; struct s b; } e; };
5 static union u v;
6 static union u v0;
7 static struct s *p = &v.d.b;
8 static struct s *q = &v.e.b;
10 static inline struct s rp (void) { return *p; }
11 static inline struct s rq (void) { return *q; }
12 static void pq (void) { *p = rq(); }
13 static void qp (void) { *q = rp(); }
15 static void
16 init (struct s *sp)
18 int i;
19 for (i = 0; i < 256; i++)
20 sp->a[i] = i;
23 static void
24 check (struct s *sp)
26 int i;
27 for (i = 0; i < 256; i++)
28 if (sp->a[i] != i)
29 abort ();
32 void
33 main_test (void)
35 v = v0;
36 init (p);
37 qp ();
38 check (q);
39 v = v0;
40 init (q);
41 pq ();
42 check (p);
43 exit (0);