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] - Blame information for rev 713

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test for VLA size evaluation in va_arg.  */
2
/* Origin: Joseph Myers <joseph@codesourcery.com> */
3
/* { dg-do run } */
4
/* { dg-options "-std=gnu99" } */
5
 
6
#include <stdarg.h>
7
 
8
extern void exit (int);
9
extern void abort (void);
10
 
11
int a[10];
12
int i = 9;
13
 
14
void
15
f (int n, ...)
16
{
17
  va_list ap;
18
  void *p;
19
  va_start (ap, n);
20
  p = va_arg (ap, typeof (int (*)[++i]));
21
  if (p != a)
22
    abort ();
23
  if (i != n)
24
    abort ();
25
  va_end (ap);
26
}
27
 
28
int
29
main (void)
30
{
31
  f (10, &a);
32
  exit (0);
33
}

powered by: WebSVN 2.1.0

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