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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr19317-3.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
// PR c++/19317
2
// { dg-options "-O2" }
3
// { dg-do run }
4
 
5
extern "C" void abort (void);
6
 
7
struct A { int c; int d; int e; int f; };
8
 
9
A
10
foo (const A *x, const A *r)
11
{
12
  A t;
13
  t.c = -1;
14
  t.c += x->c < r->c ? x->c : r->c;
15
  t.d = 0;
16
  t.e = 0;
17
  t.f = 0;
18
  return t;
19
}
20
 
21
int
22
main ()
23
{
24
  A a;
25
  a.c = 10;
26
  a.d = 0;
27
  a.e = 0;
28
  a.f = 0;
29
  A b;
30
  b.c = 100;
31
  b.d = 0;
32
  b.e = 0;
33
  b.f = 0;
34
  a = foo (&b, &a);
35
  if (a.c != 9)
36
    abort ();
37
}

powered by: WebSVN 2.1.0

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