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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20071213-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR target/34281 */
2
 
3
#include <stdarg.h>
4
 
5
extern void abort (void);
6
 
7
void
8
h (int x, va_list ap)
9
{
10
  switch (x)
11
    {
12
    case 1:
13
      if (va_arg (ap, int) != 3 || va_arg (ap, int) != 4)
14
        abort ();
15
      return;
16
    case 5:
17
      if (va_arg (ap, int) != 9 || va_arg (ap, int) != 10)
18
        abort ();
19
      return;
20
    default:
21
      abort ();
22
    }
23
}
24
 
25
void
26
f1 (int i, long long int j, ...)
27
{
28
  va_list ap;
29
  va_start (ap, j);
30
  h (i, ap);
31
  if (i != 1 || j != 2)
32
    abort ();
33
  va_end (ap);
34
}
35
 
36
void
37
f2 (int i, int j, int k, long long int l, ...)
38
{
39
  va_list ap;
40
  va_start (ap, l);
41
  h (i, ap);
42
  if (i != 5 || j != 6 || k != 7 || l != 8)
43
    abort ();
44
  va_end (ap);
45
}
46
 
47
int
48
main ()
49
{
50
  f1 (1, 2, 3, 4);
51
  f2 (5, 6, 7, 8, 9, 10);
52
  return 0;
53
}

powered by: WebSVN 2.1.0

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