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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr37146-2.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
// PR c++/37146
2
// { dg-do run }
3
 
4
extern "C" void abort ();
5
int a, b;
6
struct A { int i:8; int j:8; int k:16; int l:32; } c;
7
 
8
int
9
f1 (int x)
10
{
11
  return x ? a : b;
12
}
13
 
14
int
15
f2 (int x)
16
{
17
  return x ? c.i : c.j;
18
}
19
 
20
int
21
f3 (int x)
22
{
23
  return x ? c.i : a;
24
}
25
 
26
int
27
f4 (int x)
28
{
29
  return x ? c.i : c.k;
30
}
31
 
32
int
33
f5 (int x)
34
{
35
  return x ? c.l : b;
36
}
37
 
38
int
39
main ()
40
{
41
  a = 17;
42
  b = 18;
43
  c.i = 19;
44
  c.j = 20;
45
  c.k = 21;
46
  c.l = 22;
47
  if (f1 (1) != a)
48
    abort ();
49
  if (f1 (0) != b)
50
    abort ();
51
  if (f2 (1) != c.i)
52
    abort ();
53
  if (f2 (0) != c.j)
54
    abort ();
55
  if (f3 (1) != c.i)
56
    abort ();
57
  if (f3 (0) != a)
58
    abort ();
59
  if (f4 (1) != c.i)
60
    abort ();
61
  if (f4 (0) != c.k)
62
    abort ();
63
  if (f5 (1) != c.l)
64
    abort ();
65
  if (f5 (0) != b)
66
    abort ();
67
}

powered by: WebSVN 2.1.0

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