testsuite: Tests the pattern folding x/sqrt(x) to sqrt(x) for Float16
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr15262-1.c
blobc6453d98d054a8bc985f222841bf12de23ffe3d7
1 /* PR 15262.
2 The alias analyzer only considers relations between pointers and
3 symbols. If two pointers P and Q point to the same symbol S, then
4 their respective memory tags will either be the same or they will
5 have S in their alias set.
7 However, if there are no common symbols between P and Q, TBAA will
8 currently miss their alias relationship altogether. */
10 void abort (void);
12 struct A
14 int t;
15 int i;
18 int foo () { return 3; }
20 int
21 main (void)
23 struct A loc, *locp;
24 float f, g, *p;
25 int T355, *T356;
27 /* Avoid the partial hack in TBAA that would consider memory tags if
28 the program had no addressable symbols. */
29 f = 3;
30 g = 2;
31 p = foo () ? &g : &f;
32 if (*p > 0.0)
33 g = 1;
35 /* Store into *locp and cache its current value. */
36 locp = __builtin_malloc (sizeof (*locp));
37 locp->i = 10;
38 T355 = locp->i;
40 /* Take the address of one of locp's fields and write to it. */
41 T356 = &locp->i;
42 *T356 = 1;
44 /* Read the recently stored value. If TBAA fails, this will appear
45 as a redundant load that will be replaced with '10'. */
46 T355 = locp->i;
47 if (T355 != 1)
48 abort ();
50 return 0;