OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vla-14.c] - Rev 754

Go to most recent revision | Compare with Previous | Blame | View Log

/* Test for VLA size evaluation in va_arg.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
 
#include <stdarg.h>
 
extern void exit (int);
extern void abort (void);
 
int a[10];
int i = 9;
 
void
f (int n, ...)
{
  va_list ap;
  void *p;
  va_start (ap, n);
  p = va_arg (ap, typeof (int (*)[++i]));
  if (p != a)
    abort ();
  if (i != n)
    abort ();
  va_end (ap);
}
 
int
main (void)
{
  f (10, &a);
  exit (0);
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.