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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [pr24231-3.C] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2" } */
3
/* PRE testcase for PR 24231, problem with PRE coalescing abnormal phis.  */
4
struct MemoryManager {
5
      virtual void deallocate() = 0;
6
};
7
struct XalanVector {
8
      ~XalanVector()   {
9
              m_memoryManager->deallocate();
10
                }
11
        void swap(XalanVector& theOther)   {
12
                MemoryManager* const theTempManager = m_memoryManager;
13
                    m_memoryManager = theOther.m_memoryManager;
14
                        theOther.m_memoryManager = theTempManager;
15
                            theOther.m_size = 0;
16
                              }
17
          void push_back()   {
18
                  XalanVector theTemp(*this);
19
                      theTemp.push_back();
20
                          swap(theTemp);
21
                            }
22
            MemoryManager* m_memoryManager;
23
              int m_size;
24
};
25
void f(void) {
26
      XalanVector tempVector;
27
        tempVector.push_back();
28
}

powered by: WebSVN 2.1.0

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