OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [va-arg-pack-1.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2" } */
3
 
4
int bar (int, const char *, int, ...);
5
int baz (int, const char *, long int);
6
 
7
int
8
f1 (int x, ...)
9
{
10
  return bar (5, "", 6, __builtin_va_arg_pack ());      /* { dg-error "invalid use of" } */
11
}
12
 
13
extern inline __attribute__((always_inline)) int
14
f2 (int y, ...)
15
{
16
  return bar (y, "", __builtin_va_arg_pack ());         /* { dg-error "invalid use of" } */
17
}
18
 
19
extern inline __attribute__((always_inline)) int
20
f3 (int y, ...)
21
{
22
  return bar (y, "", 5, __builtin_va_arg_pack ());
23
}
24
 
25
extern inline __attribute__((always_inline)) int
26
f4 (int y, ...)
27
{
28
  return bar (y, "", 4, __builtin_va_arg_pack (), 6);   /* { dg-error "invalid use of" } */
29
}
30
 
31
extern inline __attribute__((always_inline)) int
32
f5 (int y, ...)
33
{
34
  return baz (y, "", __builtin_va_arg_pack ());         /* { dg-error "invalid use of" } */
35
}
36
 
37
extern inline __attribute__((always_inline)) int
38
f6 (int y, ...)
39
{
40
  return __builtin_va_arg_pack ();                      /* { dg-error "invalid use of" } */
41
}
42
 
43
int
44
test (void)
45
{
46
  int a = f2 (5, "a", 6);
47
  a += f3 (6, "ab", 17LL);
48
  a += f4 (7, 1, 2, 3);
49
  a += f5 (8, 7L);
50
  a += f6 (9);
51
  return a;
52
}

powered by: WebSVN 2.1.0

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