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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunused-parm-2.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-Wunused -W" }
3
 
4
template 
5
long
6
f1 (unsigned long long x)
7
{
8
  unsigned long long a = 1;
9
  const union { unsigned long long l; unsigned int p[2]; } b = { x };
10
  const union { unsigned long long l; unsigned int p[2]; } c = { a };
11
  return b.p[0] + c.p[0];
12
}
13
 
14
template 
15
int
16
f2 (int x, int y)
17
{
18
  int a = 1;
19
  int b[] = { 1, 2, x, a, 3, 4 };
20
  return b[y];
21
}
22
 
23
template 
24
int
25
f3 (int a)      // { dg-warning "unused parameter" }
26
{
27
  return 0;
28
}
29
 
30
template 
31
int
32
f4 (int a)      // { dg-warning "set but not used" }
33
{
34
  a = 1;
35
  return 0;
36
}
37
 
38
template 
39
int
40
f5 (int a)
41
{
42
  a = 1;
43
  return a;
44
}
45
 
46
void
47
test ()
48
{
49
  (void) f1<0> (0);
50
  (void) f2<0> (0, 0);
51
  (void) f3<0> (0);
52
  (void) f4<0> (0);
53
  (void) f5<0> (0);
54
}

powered by: WebSVN 2.1.0

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