summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c
blob: 90b7bf8639d386ee921bf7d1552ef965f93e7a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* { dg-do run } */
/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta2-details" } */

#include <stdarg.h>

static void __attribute__((noinline,noclone))
foo (int i, ...)
{
  va_list ap;
  int *p;
  va_start (ap, i);
  p = va_arg (ap, int *);
  *p = 1;
  va_end (ap);
}
extern void abort (void);
int main()
{
  int i = 0;
  foo (0, &i);
  if (i != 1)
    abort ();
  return 0;
}

/* Verify we properly handle variadic arguments and do not let escape
   stuff through it.  */

/* { dg-final { scan-ipa-dump "ESCAPED = { (ESCAPED )?(NONLOCAL )?}" "pta2" } } */