]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/torture/pr39074.c
Set nonnull attribute to ptr_info_def based on VRP
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / torture / pr39074.c
CommitLineData
9e39dba6
RG
1/* { dg-do run } */
2/* { dg-options "-fdump-tree-alias" } */
6778ae9d 3/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
9e39dba6 4
30235ede 5typedef __INTPTR_TYPE__ intptr_t;
60adb641 6
9e39dba6
RG
7int i;
8void __attribute__((noinline))
60adb641 9foo(long b, intptr_t q)
9e39dba6
RG
10{
11 int *y;
12 int **a = &y, **x;
13 int ***p;
14 if (b)
15 p = (int ***)q;
16 else
17 p = &a;
18 x = *p;
19 *x = &i; /* *ANYTHING = &i has to make sure that y points to i. */
20 *y = 0;
21}
22extern void abort (void);
23int main()
24{
25 i = 1;
26 foo (0, 0);
27 if (i != 0)
28 abort ();
29 return 0;
30}
31
9c09f152 32/* { dg-final { scan-tree-dump "y.._. = { i }" "alias" } } */
735b8f9f 33/* { dg-final { scan-tree-dump "y.._., points-to NULL, points-to vars: { D..... }" "alias" } } */