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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [ptrmem6.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR tree-opt/18040
2
// { dg-do compile }
3
// { dg-options "-O3" }
4
 
5
int PyObject_IsTrue();
6
struct object_base
7
{
8
  void ptr() const;
9
  void ptr1() const;
10
};
11
struct object : public object_base
12
{
13
  typedef void (object::*bool_type)() const;
14
  inline operator bool_type() const
15
    { return PyObject_IsTrue()
16
       ? &object_base::ptr : &object::ptr1; }
17
};
18
void f();
19
void g (void)
20
{
21
    for (unsigned n = 0; n < 100; ++n)
22
    {
23
        object kv;
24
        if (kv)
25
          f();
26
    }
27
}
28
 

powered by: WebSVN 2.1.0

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