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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [va-arg-pack-2.C] - Blame information for rev 715

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

Line No. Rev Author Line
1 693 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
extern inline __attribute__((always_inline)) int
8
f2 (int y, ...)
9
{
10
  return bar (y, "", __builtin_va_arg_pack ());         /* { dg-error "invalid use of" } */
11
}
12
 
13
extern inline __attribute__((always_inline)) int
14
f3 (int y, ...)
15
{
16
  return bar (y, "", 5, __builtin_va_arg_pack ());
17
}
18
 
19
extern inline __attribute__((always_inline)) int
20
f4 (int y, ...)
21
{
22
  return bar (y, "", 4, __builtin_va_arg_pack (), 6);   /* { dg-error "invalid use of" } */
23
}
24
 
25
extern inline __attribute__((always_inline)) int
26
f5 (int y, ...)
27
{
28
  return baz (y, "", __builtin_va_arg_pack ());         /* { dg-error "invalid use of" } */
29
}
30
 
31
extern inline __attribute__((always_inline)) int
32
f6 (int y, ...)
33
{
34
  return __builtin_va_arg_pack ();                      /* { dg-error "invalid use of" } */
35
}
36
 
37
int
38
test (void)
39
{
40
  int a = f2 (5, "a", 6);
41
  a += f3 (6, "ab", 17LL);
42
  a += f4 (7, 1, 2, 3);
43
  a += f5 (8, 7L);
44
  a += f6 (9);
45
  return a;
46
}

powered by: WebSVN 2.1.0

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