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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunused-parm-1.C] - Blame information for rev 801

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 "-Wunused -W" }
3
 
4
long
5
f1 (unsigned long long x)
6
{
7
  unsigned long long a = 1;
8
  const union { unsigned long long l; unsigned int p[2]; } b = { x };
9
  const union { unsigned long long l; unsigned int p[2]; } c = { a };
10
  return b.p[0] + c.p[0];
11
}
12
 
13
int
14
f2 (int x, int y)
15
{
16
  int a = 1;
17
  int b[] = { 1, 2, x, a, 3, 4 };
18
  return b[y];
19
}
20
 
21
int
22
f3 (int a)      // { dg-warning "unused parameter" }
23
{
24
  return 0;
25
}
26
 
27
int
28
f4 (int a)      // { dg-warning "set but not used" }
29
{
30
  a = 1;
31
  return 0;
32
}
33
 
34
int
35
f5 (int a)
36
{
37
  a = 1;
38
  return a;
39
}
40
 
41
int
42
f6 (int &a)
43
{
44
  return a;
45
}
46
 
47
void
48
f7 (int &a)
49
{
50
  a = 1;
51
}
52
 
53
struct S
54
{
55
  S (int i) : j(i) {}
56
  S (long i) : j(i + 1) {}
57
  int j;
58
};

powered by: WebSVN 2.1.0

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