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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr33887-1.C] - Blame information for rev 320

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

Line No. Rev Author Line
1 301 jeremybenn
/* { dg-do run } */
2
 
3
extern "C" void abort (void);
4
struct S { unsigned int i : 24; } x;
5
void __attribute__((noinline)) test1()
6
{
7
  if (--x.i != 0x00ffffff)
8
    abort ();
9
  if (x.i != 0x00ffffff)
10
    abort ();
11
}
12
void __attribute__((noinline)) test2()
13
{
14
  if (x.i-- != 0)
15
    abort ();
16
  if (x.i != 0x00ffffff)
17
    abort ();
18
}
19
void __attribute__((noinline)) test3()
20
{
21
  if (++x.i != 0)
22
    abort ();
23
  if (x.i != 0)
24
    abort ();
25
}
26
void __attribute__((noinline)) test4()
27
{
28
  if (x.i++ != 0x00ffffff)
29
    abort ();
30
  if (x.i != 0)
31
    abort ();
32
}
33
int main()
34
{
35
  x.i = 0;
36
  test1();
37
  x.i = 0;
38
  test2();
39
  x.i = 0x00ffffff;
40
  test3();
41
  x.i = 0x00ffffff;
42
  test4();
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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